Printing

<< Click to Display Table of Contents >>

Navigation:  Commands >

Printing

Please note: If security settings of a PDF file forbid printing, the component will not print. You as developer can override this at Your own risk. Use command(COMPDF_DisableSecurityOverride,1) to disable this check.

 

COMPDF_DisablePrint = 123

 

You can disable printing globally by using this command. It is not possible to enable it again!

 

COMPDF_DisableHQPrint  = 124

 

Disable high quality print - if print, only low quality!

 

COMPDF_PrinterSetup  = 30

 

Show printer selection and setup dialog

 

COMPDF_PrintDialog  = 32

 

Display the print dialog.

 

This commands can be used to preset the values for the print dialog:

COMPDF_SelectPrintDiaFromPage  = 56 - set the "from page" value

COMPDF_SelectPrintDiaToPage    = 57 - set the "to page" value

COMPDF_SelectPrintDiaDontCollate = 58 - unset the "collate" checkbox.

 

 

COMPDF_Print  = 31

 

Print the loaded PDF data.

 

IntParam: if not 0 it is interpreted as the page range. The low word is the first page, the high word is the last page to be printed. Pages numbers are in the range 1...page count.

 

StrParam:

 

If not empty, this string is interpreted as page range, i.e. "1-3,7,15". It is also possible to specify the number of copies with "*", i.e. "1-3*2" to print two copies of the pages 1 to 3.

 

If you have a problem is cropped output due to physical printer margins,

you can activate the automatic scaling using

  WPViewPDF.Command( COMPDF_PrintUseScaling , 3);

 

 

COMPDF_PrintUseScaling  = 155

 

This command selects different supported scaling methods. Possible values for IntParam are:

 

0=off, do not scale at all.

1=shrink only if required,

2=shrink to page area, this is the default setting. (Do not enlarge.)

3=scale to printable area - this can also cause enlargement

4=scale to page area- this can also cause enlargement

5=multi page mode. Print multiple pages on one paper sheet. The default is two pages side by side. The command id COMPDF_MultiPagePrintColRow  (=139) is used to change the count of rows and columns. The high byte of the IntParam is the count of rows, the low byte the count of columns.

 

16= Do not scale the pages, except for pages larger that A3. They will be scaled on DinA3 which will be selected in the printer. This avoids problems with A3 printers which allow larger paper to be selected.

 

COMPDF_GetPrinter = 33

 

Read the current printer name as string. It expects IntParam to be either 0  a pointer to a 256 ansi char buffer which will be filled with the name. If IntParam was 0, the name can be loaded by the command COMPDF_GetTextLen and COMPDF_GetTextBuf.

 

COMPDF_SelectPrinter = 35

 

Select a certain printer. The routine will first try an exact match, later searches for the matching printer by checking if the printer name contains the name in the string parameter StrParam.

 

COMPDF_BeginPrint = 36 & COMPDF_EndPrint = 37

 

Opens and closes a print job. This makes it possible to send several PDF files into one printing cue using COMPDF_Print.

 

Hint: You can use the command COMPDF_AppendPage =325 with parameter 0 to add an empty page prior to printout in case you  use duplex printing and the page count of a PDF file is uneven.

 

COMPDF_SetPrintTitle = 70

 

Set the name of the printing cue

 

COMPDF_SelectDuplexMode  = 34

 

IntParam is used a duplex mode identifier. Possible values are 0=off, 1=horizontal, 2=vertical

 

COMPDF_SelectCopies  = 55

 

Select the count of copies to be printed.

 

COMPDF_SelectPrintColorMode = 350

 

Select the color mode for printing. 0=default, 1=monochrome, 2=color

 

COMPDF_SelectPrinterBin0  = 38

 

Select a certain paper bin for all pages. The paper bin id is used in DEVMODE dmDefaultSource element.

 

COMPDF_SelectPrinterBin1  = 39

 

Sets the paper bin for the first page.

 

COMPDF_PrintUseBitmaps    = 138

 

Prints the pages to a bitmap and the prints this bitmap on the printer device.

 

If the IntParam is in range=1..10 a colored  bitmap with Resultion = Printer-Resultion / Value will be created

  A larger value will be used directly as printing resolution.

  A negative value will enable the use of monochrome image

  0 disable the buffered print.

 

 

COMPDF_AdvancedFontDrawing= 135

 

Changes the condition under which fonts are loaded and rendered by the vector engine.  See "configuration" command group.

Please note that since printing is done through GDI+ many text elements will be converted to graphic paths, even if our engine is using the installed fonts. After using the value 4 in this command, the engine will print unscaled text through regular GDI to avoid this effect.

 

COMPDF_DONTSETDEVMODE      = 158

 

If IntParam=1 the printer configuration will not be updated, if it is 0 it will if necessary.

If IntParam=3 none of the printer parameter will be updated, except for the page orientation.

 

COMPDF_PrintSetDEVMODE     = 156

 

Pass a unicode DEV mode as IntParam. The current DEVMODE will be overwritten. IntParam must be a pointer to the DevModeW record.

 

COMPDF_PrintGetDEVMODE     = 159

 

Result is a HGLOBAL of the printer DEVMODE record.

 

 

COMPDF_PrinterSetMediatype = 181

 

Set mediatype for printing.

Internally this calls: WinSpool.DeviceCapabilities(Device, Port, DC_MEDIATYPES, nil, nil);

 

COMPDF_PrintAbort = 180

 

Usually this has no effect since the data is sent to the spooler much quicker than the actual printing takes.

 

 

COMPDF_SelectPaperWidth       = 73

 

If larger than 0, set the value for the DEVMODE dmPaperWidth member which will be set in the printer structure.

 

COMPDF_SelectPaperLength      = 74

 

If larger than 0, set the value for the DEVMODE dmPaperLength member which will be set in the printer structure.

 

COMPDF_SelectPaperSize        = 75

 

If larger than 0, set the value for the DEVMODE dmPaperSize member which will be set in the printer structure.  

If -1 is used, the value will be not set and the default paper size defined for the printer will be preserved. (Switch off automatic paper size switching)

 

 

Useful to create a page list prior to printing:

 

COMPDF_GetPageNumbersInView    = 223

 

Gets a string result with all the numbers of the pages which are currently displayed (at least partly).

First Page is "1" so the string can be directly displayed to the user.