<< Click to Display Table of Contents >>

COMPDF_SinglepageMode      = 148

 

Enables / Disables the single page view for the main viewer. The thumbnail view (if enabled) will always show the whole file. You can use command COMPDF_ZoomThumbnails to change zoom in thumbnail view.

 

COMPDF_SETPAPERCOLOR = 54

 

Select the paper color. IntParam is a RGB value.

 

COMPDF_SETDESKCOLOR = 53

 

Select the background color. IntParam is a RGB value.

 

COMPDF_SETDESKCOLORTO = 59

 

WPViewPDF can also paint a vertical marquee effect in the background. To select the second color use this command.

 

 

Possible with WPViewPDF VCL:

 Add the conditional THEMEDWPVIEWPDF to your project options to use the style service to paint the background of the viewer.

 This disables the DeskColor

 

COMPDF_AdvancedFontDrawing= 135

 

Changes the condition under which fonts are loaded and rendered by the vector engine.  

 

IntParam can have this values:

 

0: (default) Render outlines (only) for embedded subset fonts or fonts which are NOT installed on system

1: renders all fonts as outlines, also installed fonts

2: renders all embedded fonts as outlines

 

Add 4 to one of the above values and the engine will print unscaled text through regular GDI. This setting must be applied before the PDF is loaded to be effective.

 

Add 8 to switch off any outline drawing. All text will be rendered as text and not as outlines. This only works for fonts which are installed on the system. Please use it with care. The usual "Helvetica" font will be rendered as Arial.

 

 

WPViewPDF can display different panels with buttons.

If a certain panel is displayed or not is controlled by COMPDF_SelectControls = 50.

 

IntParam is a bitfield to select which panels to see:

1=Vertical Scroll,

2=Horizontal Scroll,

4=View(Zoom +-..)Panel,

8=Search(Navigation <->)Panel,

16=Option "?" Button

 

View_Controls

 

wpViewLeftPanel can also be switched on/off with command COMPDF_ShowNavigation.

 

 

COMPDF_SelectViewOptions  = 51

 

This command is used to enable or disable certain features of the UI. It is also used to disable the usual highlighting of hyperlinks.

 

IntParam is expected as bitfield with this bit values.

 

1 : wpDontUseHyperlinks - do not auto jump on click on hyperlinks

2 : wpDontHighlightLinks - do not paint links with blue background

2048: wpInactivateHyperlinks - don't use links at all

4 : wpDontAskForPassword - don't display a password dialog for protected files

 

This flags allow page selection:

 

16: wpPageSelectionWithKeyboard - activate/deactivate the selection by keyboard

Use Shift + Page up/Down, Home and End keys. Press Ctrl to add to selection.

Please also check out the possibilities to change the behaviour of left and mouse button (COMPDF_SelectMode).

 

32: wpPageMultiSelection - the user can press CTRL to select multiple pages

 

Instead of hiding pages which are marked for deletion, cross them out:

 

8192: wpShowDeletionCross (for deleted pages)

 

Disable the hint displayed when the user scrolls:

 

128: wpDisablePagenrHint

 

Disable the zoom hint:

 

256: wpDisableZoomHint

 

Modify the bookmark view

 

1024: wpDisableBookmarkView

4096: wpExpandAllBookmarks

 

Mark deleted pages with a cross

8192: wpShowDeletionCross

 

Don't show a blue rectangle for selected pages in main viewer:

8192*256: wpHidePageSelection

 

8192*2048: wpHidePageSelectionThumbnails, disable the blue frame in thumbnails

 

Make the thumbnail view interactive. The user can select pages and reorder them, if also wpSelectPages was used. Also see (COMPDF_SelectMode).

8192*512 : wpInteractiveThumbnails

 

8192*1024: wpThumbnailAtozoomToSquareWH. If used, the thumbnails will be sized to make them fit into the window wether they are rotated or not. This helps to avoid change of zoom when pages are rotated in the thumbnail window.

 

 

COMPDF_SetPageModeDefault = 615:

 

Set the page mode for PDF files which do not define the PageMode property.

 0=Auto

 1=None

 2=Outlines

 3=Thumbnails

 

COMPDF_EnableNavigationAfterLoad = 616:

 

0: If the user disabled the left pane it will not be reactivated after loading a new file - default

1: The navigation panel will be activated and the the outlines / thumbs as defined with COMPDF_SetPageModeDefault will be displayed

2: The navigation panel will be activated and the the outlines / thumbs as defined in the PDF with PageMode or, if not defined, with     COMPDF_SetPageModeDefault will be displayed.

 

 

COMPDF_SetExViewOptions  = 81

 

IntParam is expected to be a bit field with this values  

1: Show Page Numbers in main viewer. (default: no page numbers)

   Use COMPDF_SetPageNumberString to modify the displayed page number text.

2: Hide Page Frames in main viewer    (default: frames)

4: FastZoom Mode in main viewer       (default: off)

16: Hide Page Numbers in thumbnail viewer   (default: display page numbers)

32: Hide Page Frames in thumbnail viewer     (default: frames)

64: FastZoom Mode in thumbnail viewer        (default: off)

 

COMPDF_SetPageNumberString = 82

 

Set the page number format string. First %d=page number, second %d=page count. Default is ' %d ', you can also set '%d/%d'

 

Configure Popup Menu

 

The following IDs can be used to set the captions of the popup menu selectable on the [?] button in the upper right corner. You can pass "" to disable the menu entry.

 

 COMPDF_SetDocumentProperties = 61

 COMPDF_SetShowAbout  = 66;

 COMPDF_SetPrintSetup = 68;

 COMPDF_SetPrint  = 69;

 

Configure Hints

 

The following ID can be used to set the hints for certain buttons:

 COMPDF_SetShowHint  = 71;

 

The value of IntParam selects the hint, StrParam is the new hint text.

   pdf_hint_ONOFF = 0 -  Use StrParam="1" to activate, "0" to deactivate

   pdf_hint_LeftPanel = 1-  Set string: left panel, thumbnails etc

   pdf_hint_Zoom100 = 10;

   pdf_hint_ZoomIn = 11;

   pdf_hint_ZoomOut = 12;

   pdf_hint_ZoomWidth = 13;

   pdf_hint_ZoomPage = 14;

   pdf_hint_ZoomTwoPages = 15;

   pdf_hint_ZoomThumbnails = 16;

 

 

COMPDF_UseGDIPainter = 141

 

Switches the renderer for screen display. The default is IntPar=1 which selects the GDI+ Renderer, IntPar=0 selects the AGG Renderer. The latter produces better looking letters and better scaled images (antialias), but implements only basic clipping. Printing will always use GDI+.

 

COMPDF_DisableThreading = 146

 

Pass 1 to disable the multithreaded paint, 0 to enable multithreaded painting. The change will take effect after the next load operation.

 

COMPDF_ShowNavigation  = 134

 

This command can be used to force the display of the navigation panel (Bookmarks and Thumbnails).

Use IntPar=0 to hide it, 1 to show it and 2 to toggle its visibility.

 

COMPDF_ZoomThumbnails     = 77

 

Pass a value>=10 to set the thumbnail viewer zoom (default 10)

Use -9..9 to increase or decrease the zoom value.

 

COMPDF_GetHWND = 1001

 

Special method to retrieve the HWND handle of these internal windows:

 

1: thumbnails, 2: bookmarks, 3: viewer, 4: left panel

 

If you also pass the string parameter "noresize", it will disable the internal resizing and show/hide logic.

 

This Example moves the thumbnails to a different window:

 

  Panel1.Visible := true;

  FThumbHandle := HWND(  WPViewPDF1.command(COMPDF_GetHWND,1) );

  if FThumbHandle<>0 then

  begin

     SendMessage( WPViewPDF1.CommandStrEx(COMPDF_GetHWND,'noresize',4), WM_SIZE,200,0);

     Windows.SetParent(FThumbHandle, Panel1.Handle );

     Panel1Resize(nil);

  end;

 

Use this OnResize handler for the parent panel:

 

procedure TForm1.Panel1Resize(Sender: TObject);

begin

  if FThumbHandle<>0 then

  begin

     SendMessage( FThumbHandle, WM_SIZE, 200, (Panel1.Width-2) or ((Panel1.Height-2) shl 16));

     SendMessage( FThumbHandle, WM_MOVE, 200, (1) or ((1) shl 16));

  end;

end;

 

 

Control Page and Page content caching:

 

COMPDF_SetMaxCachePixels = 1295;

 

Set the maximum size of cache bitmap pixels for the viewer (default = 30 MegaPixels)

 

COMPDF_SetMaxCachePixelsThumbs = 1296

 

Set the maximum size of cache bitmap pixels for the thumbnails (default = 5 MegaPixels)

 

COMPDF_SetMaxCachePathLockTime = 1297

 

Set the maximum count of milliseconds to cache page contents. Use 0 to infinitely cache such contents. This may be useful if interaction with the text is required.

 

Initialize the JBIG2 decoding

 

It is usually not required to call the command COMPDF_SetJBIG2Tool when the converter DLLs have been copied to the EXE directory.

The Command COMPDF_SetJBIG2Tool with an integer parameter 1 and the path as string parameter however can be used to manually load the decoding DLL.

It will return 1 if the DLL was loaded, 0 if not.