PDFiumVCL Docs

Colour property

Component: TPdfView  ·  Unit: PDFium
Sets the background colour drawn between the page rectangles and around the document edges.

Syntax

property Colour: TColor; // published, inherited from TControl

Description

Color fills the area of the viewer client rectangle that lies outside the page artwork — the margin between consecutive pages, the area around the document when it is narrower than the viewport, and any region revealed by aggressive scrolling. Together with PageColor, PageBorderColor and PageShadowColor it determines the overall look of the reader.

The most common dark-mode reader effect is achieved by setting Color := clBlack (or a deep grey such as $303030) and keeping PageColor light so the paper still appears bright. For a printed-page metaphor leave Color at its default and add a non-zero PageShadowSize to give each page a drop shadow against the background.

The colour is also visible during the brief moment a page is still being rasterised by PDFium — before the first bitmap is available the viewer paints LoadingColor on top of Color, then replaces it with the rendered page bitmap once it arrives.

Remarks

Example

// Configure a soft dark-mode reader
procedure TForm1.ApplyDarkTheme;
begin
  PdfView1.Colour := $202020;
  PdfView1.PageColor := clWhite;
  PdfView1.PageBorderColor := $404040;
  PdfView1.PageShadowColor := $101010;
  PdfView1.PageShadowSize := 6;
  PdfView1.LoadingColor := $202020;
  PdfView1.Invalidate;
end;

See Also

PageColor, PageBorderColor, PageShadowColor, LoadingColor