ImageEn, unit imageenio

TImageEnIO.LoadFromFilePDF

TImageEnIO.LoadFromFilePDF


Declaration

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


Description

Loads a PDF image PDF into the attached TImageEnView or TIEBitmap 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:
- 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.
- Use ImageIndex to specify which page of the PDF file to load


Example

// Load the 3rd page of a PDF file with max dimensions of 1000x1000
ImageEnView1.ImageIndex := 2;
ImageEnView1.IO.LoadFromFilePDF( 'C:\Test.pdf', 1000, 1000 );