ImageEn, unit iemio

TImageEnMIO.LoadFromStreamPDF

TImageEnMIO.LoadFromStreamPDF

Declaration

function LoadFromStreamPDF(Stream: TStream; Width: Integer = -1; Height: Integer = -1; const Password: string = ''): Boolean;

Description

Loads a PDF from a stream into the attached TImageEnMView or TIEMultiBitmap using a plug-in.
You can optionally specify a size to load the PDF file to improve quality (the size will be automatically adjusted to maintain the aspect ratio).
If the file is encrypted you can specify the password (otherwise a password prompt can be displayed if you enable AutoPromptForPassword. You can also use the OnPassword event).
The result will be False if an error is encountered, e.g. the file in the stream is not PDF format or a PDF plug-in is not found(Aborting will be True).

PDF loading requires one of the following plug-ins:
ImageEn's PDFium Plug-in
WPViewPDF commercial plug-in
ImageMagick + GhostScript


Note:
PDF loading creates a rasterized image of each page
The quality of the PDF page is controlled by IEGlobalSettings().PdfViewerDefaults.DPI
LoadFromStreamPDF is not compatible with SaveToStreamPDF. If you save a file using this method each PDF page will be an image (e.g. text cannot be selected)
PDFium is not thread-safe, so LoadFromStreamPDF should never be called from a separate thread
LoadFromStreamPDF does not reset the position of the stream, so you may need to first call Stream.Position := 0;
Existing content is not cleared. Call Clear to remove existing content before loading
To abort while loading set Aborting to True
Read more about ImageEn PDF Support