ImageEn, unit iesettings

TIEPdfViewerDefaults


Declaration

TIEPdfViewerDefaults = class
  SelectionColor : TColor;
  SelectionMerging : Integer;
  HighlightColor : TColor;
  FormFieldColor : TColor;
  FormFieldAlpha : Integer;
  Options : TIEPdfOptions;
  DPI : Integer;
end;


Description

Class of PdfViewerDefaults to specify defaults when initializing the PdfViewer and PDF loading methods when using the PDFium PlugIn.

Property Description Default Value
SelectionColor The color of selected text in the PdfViewer clElectricBlue ($00FE8E32)
SelectionMerging Merges closely aligned selections into single ones. Sometimes the words in PDF documents have widely spaced letters that show as multiple selections. If you specify a value other than zero for SelectionMerging, then selections that are less than that number PDF points apart will be merged into one 3
HighlightColor The color of highlighted text when HighlightText is used clTangerine ($00328EFE)
FormFieldColor The color of all editable form fields when form editing is enabled clElectricBlue ($00FE8E32)
FormFieldAlpha The transparency of the form field color fill when form editing is enabled 25
Options Default value for Options [iepoAutoButtons, iepoAnnotations, iepoOptimizeForLCD]
DPI The scale to load pdf files when rendering to bitmap (does not affect PdfViewer) 72


Examples

// Don't draw annotations when rendering PDF files
IEGlobalSettings().PdfViewerDefaults.Options := IEGlobalSettings().PdfViewerDefaults.Options - [iepoAnnotations];

// Highlight form fields with yellow fill
IEGlobalSettings().PdfViewerDefaults.FormFieldColor := clYellow;
IEGlobalSettings().PdfViewerDefaults.FormFieldAlpha := 50;
ImageEnView1.PDFViewer.Update;

// Do not highlight form fields
IEGlobalSettings().PdfViewerDefaults.FormFieldAlpha := 0;
ImageEnView1.PDFViewer.Update;

// Update selection color
IEGlobalSettings().PdfViewerDefaults.SelectionColor := clRed;
ImageEnView1.Update();

// When rendering PDF files scale to double size
// Note: This assumes ImageEnView1.PdfViewer.Enabled = False, because the PdfViewer always outputs at full resolution of the display
IEGlobalSettings().PdfViewerDefaults.DPI := 144; // PDF files are 72 DPI, so 144 is 200% size
ImageEnView1.IO.LoadFromFilePDF( 'C:\Test.pdf' );

// Do not show very close selections as a single selection
IEGlobalSettings().PdfViewerDefaults.SelectionMerging := 0;
ImageEnView1.Update();