ImageEn, unit iexUserInteractions

PDFium PlugIn

PDFium is a Google library providing support for Adobe PDF files.

ImageEn uses PDFium to support PDF in two ways:

1. PDF Viewer

By enabling the PdfViewer property, you can view and manipulate files in a TImageEnView. The following features are supported:
- Scaling and auto-fit options
- View all pages at once *
- Page and document rotation
- Editing of form fields
- Importing, deleting and moving * of pages
- Saving of changed PDF files
- Selection of text and images * with clipboard support
- Text searching and highlighting
- High quality printing and exporting to bitmap
- Page thumbnail viewer with one-click navigation *
- Access to file attachments
- Keyboard shortcuts
- Web Link support

2. Rasterized PDF Loading

When the PDFium plug-in is available and registered, ImageEn can load PDF pages in the same way as multi-frame images.
For best quality you should load the page at the intended display size using LoadFromFilePDF or by specifying the auto-scaling properties.

- PDFium support requires Delphi/BCB 2009 or newer
- Items marked by are ImageEn custom features (not available in standard PDFium)
- Download the PDFium plug-in from:
- It needs to be registered once by your application
- PDFium support requires Delphi/BCB 2009 or newer
- Specify which page to load using ImageIndex (between 0 and ImageCount-1) or use a TImageEnMView to load and display all pages


Demo  Demos\Other\PdfViewer\PdfViewer.dpr
Demo  Demos\Other\PdfViewerToolbar\PdfViewerToolbar.dpr
Demo  Demos\Actions\Actions_PdfViewer\PdfViewerActions.dpr


// Register the PDFium Plug-In
IEGlobalSettings().RegisterPlugIns([ iepiPDFium ]);

// Display a PDF document (and allow text and image selection, scaled viewing, etc)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.MouseInteractGeneral := [ miPdfSelectText, miPdfSelectRgn ];
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Display a PDF document and image selection (no text selection)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.MouseInteractGeneral := [ miPdfSelectRgn ];
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Display a PDF page (as an image)
ImageEnView1.PdfViewer.Enabled := False; // Default is false anyway
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Display third page of a PDF document
ImageEnView1.IO.Params.ImageIndex := 2;
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Enable form editing
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.PdfViewer.AllowFormEditing := True;
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Display all pages of a PDF in a TImageEnMView
ImageEnMView1.MIO.LoadFromFilePDF( 'C:\document.pdf' );

// Show thumbnail preview of all pages of a PDF document
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.AttachedImageEnView := ImageEnView1;
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

See Also

- TIEPdfViewerInteraction
- PdfViewer
- LoadFromFilePDF