TImageEnMIO.LoadFromFilePDF
Declaration
function LoadFromFilePDF(const FileName: string; Width: Integer = -1; Height: Integer = -1; const Password: string = ''): Boolean;
Description
Loads a PDF image or a multipage PDF 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).
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.
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
◼LoadFromFilePDF is not compatible with
SaveToFilePDF. 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 LoadFromFilePDF should never be called from a separate thread
◼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
Examples
ImageEnMView1.Clear();
ImageEnMView1.MIO.LoadFromFilePDF('C:\Test.pdf');
// Save multi-page PDF image in TImageEnMView as a TIFF file
ImageEnMView.MIO.LoadFromFilePDF('C:\multipage.pdf');
ImageEnMView1.MIO.Params[0].TIFF_Compression := ioTIFF_JPEG;
ImageEnMView1.MIO.Params[0].TIFF_JPEGQuality := 85;
ImageEnMView1.MIO.DuplicateCompressionInfo();
ImageEnMView1.MIO.SaveToFileTIFF('D:\output.tiff');