CIB pdf toolbox technical guide (EN)

14. Internal modules in detail

14.1. CIB pdf/print

General
Special options for print output
Printing via CUPS
Practical examples of direct printing requirements

General

CIB pdf/print is used as PDF print interpreter. It is designed to render and print the complete text content of the PDF file to a specified printer. The result should look as close as possible to the comparable standard tool (Acrobat Reader) of the format manufacturer (Adobe). The PDF specification of version 1.8 (Acrobat Reader 8) is supported. The graphic API of the respective operating system is used. All printer drivers and font installations of the respective platform are supported.


Special options for print output

Property description

Type

Functionality

Kind

DocumentUsedFonts

(since CIB pdf toolbox 1.6.115)

String

Output of the fonts used in a document {name;size;attributes}.

Example:
{Frutiger VR;6-48;normal,bold,italic,bold italic;};{Courier New;6-48;normal,bold,italic,bold italic;}

Get

DocumentReplacedFonts

(since CIB pdf toolbox 1.6.115)

String

Output of the font replacements made during document processing.

If a font is not available on the system, the CIB pdf tollbox will replace it with a font installed as "similar" as possible. The font replacements performed are documented in this property in the form:

<font-replacement> ::= <font-replacement> | <font-replacement> „;“<font-replacement>

<font-replacement> ::= „{“ <old font> „;“<new font> „}“

<old font> ::= <fontname>

<new font> ::= <fontname>

<fontname> ::= <text>

Each font replacement is output only once.

Example:
DocumentReplacedFonts = {FrutigerVR;Times};{HelveticaNeueLT Com 65Md;Times};{Arial;Times}

Get

DocumentUsedOriginFonts

(since CIB pdf toolbox 1.6.115)

String

Output of the original fonts used in a document {name;size;attributes}.

Example:
{Frutiger VR;6-48;normal,bold,italic,bolditalic;};{Arial;10,12;normal,bold italic;}

Get

DuplexPrint2

Char*

DuplexPrint2 extends the specification for duplex printing and is used instead of the DuplexPrint property.

„DuplexDefault“:
The default value set in the printer driver is used in Windows. Under Linux/Unix, the value from the PPD file set by property is used. If there is no PPD file, DuplexPrintLong is used.

„DuplexPrintShort“:
It is printed on both sides, whereby the sheet is turned on the short side like a calendar.

„DuplexPrintLong“:
It is printed on both sides whereby the sheet is turned on the long side like a book.

„SimplexPrint“:
It is printed on one side.

 

Get/
Set

PageSelection

 

 

 

 

 

 

 

 

 

 

 

 

(since CIB pdf toolbox 1.4.83):

Char*

Enter the desired page selection here.
Example:

The indication "1-3" corresponds to pages 1 to 3,

by specifying "1;3" you get page 1 and 3 (semicolon as separator !)

Specification of copies::
<Bookmarkname>;<Bookmarkname2>
oder
<Bookmarkname>,<Number of additional copies>
Note:
Semicolon separates the names of the copies. Comma appends the number of additional copies.


Instead of a page range, you can also specify the name of a bookmark of an RTF document converted to Pdf.

Set/
Get

PaperBin

Char*

Targeted control of a specific printer tray.

The following are possible:
- Printer specific tray numbers,
            for example 258
            (since CIB pdf toolbox 1.4.109)
- Printer specific tray identifiers

            For example tray 1
- System standard trays:
            „BinOnlyOne“
            „BinLower“
            „BinManual“
            „BinMiddle“
            „BinUpper“
            „BinLargeCapacity“
            „BinTray5“
            „BinEnvelope“
            „BinDefault“

Note:
The system default trays are not supported by every printer driver, resulting in printing on the default tray of the respective printer.

It is possible to use different trays for the first page and the rest of the document. The two trays are then separated by semicolons.

Example:
PaperBin=“258;260“

Set

PaperBinReset

Char*

First page is printed on a different tray. Possible values:

=„Bookmarks“ (Default)

   The first page of each copy, copy and partial document is printed on the first page tray.

=“PartialDocuments“
The first page of each copy and sub-document is printed on the first page tray.

=“Copies“
The first page of each copy is printed on the first page tray.

=“None“
The first page of the print job is printed on the first page tray.

Set

ReceiverCopyMap

(since CIB pdftoolbox 1.4.106)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(since CIB pdftoolbox 1.14.0)

Char*

In a table, meaningful names can be assigned to the bookmarks set in the documents (copies).
The names assigned here can be used in the PageSelection property.

Syntax:
<r-copy> | <r-copy> “;” <ReceiverCopyMap>

<r-copy> ::= „{“ <NameNew> „;“ <bookmark> „;“
<PapertypePage1> „;“ <PapertypeRest> „}“

<NameNew> ::= <empty> | <empty>

<Bookmark> ::= <text>

<PapertypePage1> ::= <empty> | <text>

<PapiertypeRest> ::= <empty> | <text>

Example:
ReceiverCopyMap={client;COPY1;letterhead;letter};{bank;COPY2;blank;blank}

Special case:  One of the two shafts is missing:

ReceiverCopyMap=
{client;COPY1;letterhead;}   or

{client;COPY1;letterhead}   or

{client;COPY1;;letterhead}

Have the same result:
No duplex blank page is inserted after the 1st page.

But:

ReceiverCopyMap=
{client;COPY1;;}   oder

{client;COPY1;}

generate an error - 304.

Set

PaperTypeMap

(since CIB pdftoolbox 1.4.106)

Char*

In a table, the printer trays in which this paper is stored can be assigned to the paper types used.

Tray names or tray numbers are printer-specific.
This table is a prerequisite for paper type related printing. Otherwise, the printout is made on the printer's default tray (or on trays defined by other properties.

Syntax:
<PaperTypeMap> ::= <Entry> | <Entry> „;“ <PaperTypeMap>

<Entry> ::= <Papertype> „,“ <Tray>

<Papertype> ::= <Text>

<Tray> ::= <Text> | <Number>

Example:
PaperTypeMap={letterhead,Tray1;
Letter,Tray2;blank,260}.

Set

PaperTypes

(since CIB pdftoolbox 1.4.106)

Char*

Default paper types can be set for the printout if no ReceiverCopyMap is available. A maximum of two paper types are possible (for the entire document or for the 1st page and the rest).
Prerequisite for this property is an assignment of paper types to printer trays via PaperTypeMap.

The set paper types are applied either per copy (according to PageSelection) or to the entire document.

Syntax:
<PaperTypes> ::= <Papertype> | <Papertype> „;” <Papertype>

<Papertype> ::= <Text>

Example:

PaperTypes=Letterhead;Letter

 

Set

PrintBracketMode

(ab CIB pdftoolbox 1.4.106)

Char*

Several print documents can be stapled in one print job. This prevents print pages from different people from being mixed and then having to be sorted apart by hand. These documents can be RTFs or PDFs (also mixed).

Possible values:

Open PrintBracket is empty:
Opening a new print bracket with creating a handle that is saved in PrintBracket. The document is added to the bracket.
PrintBracket s occupied:
The document is added to the print bracket. In both cases, the transfer of a document (InputFilename or InputMemoryAddress) is mandatory, otherwise an error message will be displayed.

Close PrintBracket is empty:
The individual document is printed. Transfer of a document (InputFilename or InputMemoryAddress) is therefore absolutely necessary, otherwise an error message will be displayed.
PrintBracket is occupied:
The document (if available) is added to the print bracket. The print bracket is closed, the handle is released. The spooler accepts the print job.

Cancel PrintBracket is empty:
Output of an error message, because there is no print bracket that can be aborted.
PrintBracket is occupiedt:
The print bracket is discarded, i.e. the handle is released without a print job.

Set

PrintBracket

(since CIB pdftoolbox 1.4.106)

Long

When starting a new bracket (PrintBracketMode=Open) the CIB pdf toolbox (or the CIB format) creates a new bracket handle. This handle is stored in the PrintBracket property.

This handle points to the print order instance where management information (printed pages, printed documents, etc.) is stored and additionally stored in

Windows: the spooler handle

Linux: a list of file paths

Set/
Get

PrintMode

(since CIB pdftoolbox 1.13.0)

Char*

Works only under Windows

With RenderingEngine=CIBRenderer the CIBRenderer is used for the rendering process of the print (OutputFormat=FormatPrinter) and creates temporary files as an intermediate step which are then passed to the printer.

Possible values:

Auto (or empty): Postscript is used if the printer driver is postscript capable, otherwise GDI.

Postscript: Postscript is used if the printer driver is postscript capable.(Otherwise error 304).

GDI: Print with GDI.

PCL:  Is not supported yet (error 304).

The properties PrintBrackets, PageSelection, PrintCopies2, DuplexPrint2, SortedPrint2, PaperBins, InsertEmptyPageBetweenBookmarks, and PaperBinReset can be used.

If RenderingEngine is different from CIBRenderer only GDI is supported.

That means if PrintMode is empty or Auto or GDI, GDI is used. Otherwise there is error 304.

Set

ParentHwnd2

Char*

The window handle is passed to the application with respect to which the print dialog is to be centered.

(default: window handle of the desktop)

Set

PrintCopies2

Char*

The number of copies of the original that will be printed.

Specify the number of additional copies, default is 0.

 Set/
Get

SortedPrint2

(ab CIB pdf toolbox 1.6.117)

Char*

Output sorted or unsorted copies to the printer. This property is only useful if PrintCopies2 > 0. This property is supported for both simplex printing and duplex printing.

Possible values:

„1“: The pages of the Pdf document are printed sorted (default).

„0“: The pages of the Pdf document are printed unsorted. In this case the property RequestedPages is not supported.

In addition:
 If FastPages=1 or PaperTypeMap is not empty or ReceiverCopyMap is not empty or PaperBin contains a semicolon (for 2 trays), a warning is written out and the value of SortedPrint2 is changed to "1".

Example:

for PageSelection="3;6;8", PrintCopies2=1 and Duplex-Print, the output for SortedPrint2=1 is: "3,6,8,blank,3,6,8,blank".

For SortedPrint2=0 is output:

"3,6,3,6,8,blank,8,blank". The whole in simplex print results in "3,6,8,3,6,8" (for SortedPrint2=1) and "3,3,6,6,8,8" (SortedPrint2=0).

Set

PrinterChanged2

Char*

„1“: Printer has been changed.

„0“: The printer has not been changed.

Get

PrinterLocalisation

Char*

Definition of the printer types to be fetched with PrinterAvailable.

„PrinterDefault“:
Returns the default printer.

„PrinterLocal“:
Returns the local printer.

„PrinterNetwork“:
“PrinterRemote“:
“PrinterShared“:
Returns the printers connected via the network.

„PrinterCUPS“:
Returns the printers connected via the Common Unix Printing System
.

Set

PrintedPageCount2

Char*

Returns the number of pages printed.

Get

PrinterName

Char*

Windows:
Under Windows, the desired printer name is requested. The specification can be made with domain or server name.

Set

PrintToFile2

Char*

„0“: the printout goes to the desired printer.

„1“: the print is redirected to a file.

This file is either determined in the user dialog or can be set in advance using the OutputFilename property.

Set

PrintDialogDisableToFile2

Char*

„1“: The checkbox "Redirect output to file" is not displayed in the print dialog.

„0“: The checkbox is displayed (default).

 

Set

PrintDialogDisableSelection2

Char*

„1“: The options for selecting individual pages in the print dialog are grayed out and cannot be used.

„0“: The options for selecting individual pages are available (default).

Set

PrintDlgHwnd2

Char*

Window handle of the used print dialog.

Get

PrinterPortName

Char*

Print on this port (Get only).

Get

DefaultPrinter

Char*

Return of the default printer.

Get

PaperBinAvailable

Char*

Return the available printer bays of the printer from Property PrinterName or the default printer if PrinterName is empty.

Get

DeviceCapability.DuplexAvailable

Char*

Returns whether the printer from Property PrinterName (or the default printer if PrinterName is blank) is capable of duplex or two-sided printing.

Possible values:
0        It cannot print duplexes.
1        It can print duplexes.

Get

PrintCommentList

(since CIB pdf toolbox 1.9.2)

Char*

Specifies whether the visible comments should be listed when printing (corresponds to "Summarize comments" in Adobe Professional).

Possible values:

„0“: No comment list is printed. (default)

„1“: All visible comments in the PDF document receive a consecutive number and are listed in additional pages.

Set

PrintCommentListTypes

(since CIB pdf toolbox 1.9.2)

Char*

The property specifies which special comment types should be listed.

It is only effective if PrintCommentList="1".

 

Possible values:

„“: (empty string - default) All visible comments are listed.

Non-empty-string: A semicolon-separated list of comment types to be listed.

For example, "Circle;Freetext;Text".

Set

PrintCommentListEmpty

(since CIB pdf toolbox 1.9.2)

Char*

Specifies whether only the comments with non-empty text are listed.

Possible values:

„1“: All matching comments are listed, whether they contain text or not. (Default)

„0“: Only those comments are listed that really contain text.

Set



Printing via CUPS

The CIB pdf toolbox supports under Linux the print control via CUPS (Common Unix Printing System).

CUPS consists of a client-server architecture, i.e. the program is divided into a print client, which sends the print jobs, and a print server, which does the printing on the computer to which the printer is connected.

The standard format for CUPS is Postscript (PS), therefore the CIB modules under Linux always generate PS which is passed to the CUPS interface. Usually CUPS will pass the PS to the connected printer. However, depending on the configuration and the printer's capabilities, CUPS may also perform a conversion (e.g. to PCL).

Requirements for the control of a CUPS print under Linux:

  • Existence of a CUPS version greater than 1.2
  • Installation of PDFTOPS 3.0 from poppler-utils package 0.5.4
  • gtk 2.10 (fort he PrintDialog)


Practical examples of direct printing requirements

Direct printing can be done via the CIB Runshell or the direct dll functionality.

Simple runshell call for printing a PDF file:

cibrsh.exe –fp Test.pdf 

To print via the Dll, the following steps are required as a basis:

Using the method SetProperty(), assign the value "InputFilename" to the document to be printed.

Using the method SetProperty(), set the value "OutputFormat" to "FormatPrinter.

Execute the CibPdfJoin() method.

These calls print the specified input file to the default printer. You can make more detailed print specifications using further properties.

The following are examples of common duplex printing applications.
A printer with duplex capability is required. In the examples, the printer has a manual ("BinManual") and an upper tray ("BinUpper").


Printing simple document

A simple document is printed in which there are no bookmarks.

Usecase

Properties

Result

Complete printing of the document

None required

The complete document is printed out once.

Complete print with copies

PrintCopies2=1

The complete document is printed out twice.

Printing parts of the document

PageSelection=1-3;7

InsertEmptyPageBetweenRtfBookmarks=“1“

Only pages 1, 2, 3 and 7 are printed.

Setting the property "InsertEmptyPageBetweenRtf-Bookmarks" prevents page 7 from being printed on the back of page 3.

Printing parts of the document with copies

PageSelection=1,1;5,2

InsertEmptyPageBetweenRtfBookmarks=“1“

Only page 1 is printed twice and page 5 three times.

Print on different trays

PaperBin=“BinManual;BinUpper“

The first page of the document is printed on the manual tray and the rest on the top tray.

Printing with copies and different trays

Option 1

PrintCopies2=1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Bookmarks

The first page of each copy of the form is printed on manual tray, the rest on top tray.

 

Option 2

 

PrintCopies2=1

PaperBin=“BinManual;BinUpper“

PaperBinReset=None

The first page of the print job is printed on the manual tray, the rest on the top tray.


Printing a document with copies

The document contains the bookmarks COPY1, COPY2 and COPY3. Each of these bookmarks stands for a text area in the document. For example, under the identifier COPY1, a certain part of the document (= copy 1) can be directly addressed and printed.

The InsertEmptyPageBetweenRtfBookmarks="1" property must be set so that when printing and odd number of pages each copy starts on a new sheet.

Usecase

Properties

Result

Complete printing of the document

No further properties required

The complete document is printed out once. Blank pages are inserted so that each copy starts on a new sheet.

Printing parts of the document

PageSelection=COPY2

Only COPY2 is printed.

Printing parts of the document with and without copies

PageSelection=COPY1,1;COPY3

Copy 1 shall be printed twice and copy 3 once.

Printing on different trays

Option 1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Bookmarks

The first page of each copy contained in the document is printed on manual tray, the rest on top tray.

 

Option  2

PaperBin=“BinManual;BinUpper“

PaperBinReset=None

The first page of the document is printed on manual tray, the rest on top tray

Printing to different trays with copies

PrintCopies2=1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Copies

The complete document is printed twice. The first page of each copy goes to the manual tray and the remaining pages to the top tray.


Printing of form bundles (concatenation of simple documents)

Concatenation: CIB pdf/join is used to concatenate simple PDF documents (i.e. they do not contain bookmarks) into a single large PDF document. One also speaks of a form bundle.

By setting the property JoinHistory="1", a marker is set at the transitions between the individual documents so that duplex printing on a new sheet starts at this point.

Printing: Setting the property InsertEmptyPageInDuplex="1" causes empty pages to be inserted between the individual documents (see JoinHistory) so that each document part starts on a new sheet.

Usecase

Properties

Result

Complete printing of the form bundle

No further properties required

The complete form bundle is printed out once. Blank pages are inserted so that each individual document begins on a new sheet.

Printing individual pages of the form bundle without and with copies

PageSelection=1;10,2

InsertEmptyPageBetweenRtfBookmarks=“1“

Page 1 of the form bundle is printed once and page 10 three times.

Setting the "InsertEmptyPageBetweenRtf-Bookmarks" property prevents page 10 from being printed on the back of page 1.

Printing on different trays

Option 1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Bookmarks

The first page of each partial document is printed on manual tray, the rest on top tray.

 

Option 2

PaperBin=“BinManual;BinUpper“

PaperBinReset=None

The first page of the form bundle is printed on manual tray, the rest on top tray.

Printing to different trays with copies

PrintCopies2=1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Copies

The complete form bundle is printed twice. The first page of each copy goes to the manual tray and the remaining pages to the top tray.


Printing of form bundles with copies

The individual documents contain the bookmarks COPY1, COPY2 and COPY3. These bookmarks mark text areas for printouts in the individual documents. The name of a particular bookmark can also appear in several individual documents. In this case, all text areas named in this way are selected when this copy is printed.

Concatenation: With the CIB pdf/join the individual PDF documents are concatenated to form a single large PDF document (= form bundle).
By setting the property JoinHistory="1", a marker is set at the transitions between the individual documents so that duplex printing on a new sheet starts at this point.

Printing: Setting the property InsertEmptyPageInDuplex="1" causes empty pages to be inserted between the individual documents (see JoinHistory) so that each document part starts on a new sheet.
By setting the InsertEmptyPageBetweenRtfBookmarks="1" property, each copy also starts on a new sheet.

 

Usecase

Properties

Result

Complete printing of the form bundle

No further properties required

The complete form bundle is printed out once. Blank pages are inserted so that each document part and each copy starts on a new sheet.

Printing parts of the form bundle without and with copies

PageSelection=COPY1;COPY2,1

All copies1 from the form bundle are printed once and the copies2 twice.

Printing on different trays

Option 1

PaperBin=“BinManual;BinUpper“

PaperBinReset=Bookmarks

The first page of each part document and each copy is printed on manual tray, the rest on top tray.

 

Option 2

PaperBin=“BinManual;BinUpper“

PaperBinReset=PartialDocument

The first page of each partial document is printed on manual tray, the rest on top tray.