ImageEn, unit iemio

TImageEnMIO.LoadFromFilePDF

TImageEnMIO.LoadFromFilePDF


Declaration


function LoadFromFilePDF(const FileName: string; Width: Integer = -1; Height: Integer = -1; Password: string = ''): Boolean;


Description


Loads a PDF image or a multipage PDF into the attached TImageEnMView or TIEMultiBitmap using either the TIEMiscPluginsImageMagick plug-in or the WPViewPDF commercial plug-in.
This method is necessary when the PDF file has no extension or valid PDF header, but you are sure that is a PDF file.
Result will be false if the file is not PDF format or no PDF plug-ins are available (Aborting will be true). Loading errors due to a file not being available will raise an exception.

If you are using the WPViewPDF commercial plug-in, you can optionally specify a size to load the PDF file and/or a password.

Notes:
- Existing content is not cleared
- PDF files are documents without specified pixel dimensions, so the Dpi is used to calculate image dimensions based on the page size of the PDF.


Example


ImageEnMView1.Clear;
ImageEnMView1.MIO.LoadFromFilePDF('c:\test.pdf');