Okay, I have the pfdium example working in both 32bit and 64bit.
There is an unitialised poiner in Pdfiumcore.pas which is causing the problem.
I added ”BmpBits := nil;” to the code as indicated where the stars are below. No more access violation.
procedure TPdfPage.Draw(bitmap : TBitmap; Rotate: TPdfPageRotation; const Options: TPdfPageRenderOptions);
var
PdfBmp: TPdfBitmap;
BitmapInfo: TBitmapInfo;
Bmp, OldBmp: HBITMAP;
BmpBits: Pointer;
BmpDC: HDC;
vbmp : TBitmap;
begin
Open;
{$IFDEF NON_DC_DRAWING}
******* BmpBits := nil; *******
PdfBmp := TPdfBitmap.Create(bitmap.Width, bitmap.Height, bfBGRA, BmpBits, bitmap.Width * 4);
try
if Transparency then
PdfBmp.FillRect(0, 0, bitmap.Width, bitmap.Height, $00FFFFFF)
else
PdfBmp.FillRect(0, 0, bitmap.Width, bitmap.Height, $FFFFFFFF);
DrawToPdfBitmap(PdfBmp, 0, 0, bitmap.Width, bitmap.Height, Rotate, Options);
DrawFormToPdfBitmap(PdfBmp, 0, 0, bitmap.Width, bitmap.Height, Rotate, Options);
PdfBmp.toBitmap(bitmap);
finally
PdfBmp.Free;
end;
…… more lines
Thank you to everyone for their help.