PDF Settings

Start page  Previous page  Next page

 

There are a whole range of settings for the PDF format itself in addition to those for the PDF file's content (general elements). n2pdf supports a number of these settings such as the security functions, PDF file descriptions and font embedding.

 

All the settings are made using the function N2PDFSetOption and must be done before the command N2PDFProcess. Below you will find a list of all possible settings that can be used in the parameter <OptionID> with N2PDFSetOption. The respective setting values are made using the parameter <OptionStr>. The last parameter is unused and therefore always set as "".

 

Example:

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_PDF_INFO_TITLE, "PDF Title" , "" )

 

112

Whether or not all the options below are supported depends on the reader being used. Some may only work if the reader accepts these settings. The term "reader" used in the descriptions below generally means the "Acrobat Reader", which is the one these settings pertain to. Settings may vary for other types of readers.

 

 

N2PDFOPTION_PDF_PAGE_MODE

This parameter is used to determine in what mode the PDF reader is opened.

 

N2PDFVALUE_PAGEMODE_NONE

The last reader settings are used.

N2PDFVALUE_PAGEMODE_FULLSCREEN

Reader is launched in full screen mode.

N2PDFVALUE_PAGEMODE_THUMBNAILS

Reader is launched with opened thumbnails.

N2PDFVALUE_PAGEMODE_OUTLINE

Reader is launched with opened bookmarks.

 

 

N2PDFOPTION_PDF_ZOOM_MODE

This parameter specifies the zoom range at which the PDF reader is opened.

 

N2PDFVALUE_ZOOMMODE_NONE

The last reader settings are used.

N2PDFVALUE_ZOOMMODE_FITHORIZONTAL

The page is visible horizontally in its entirety.

N2PDFVALUE_ZOOMMODE_FITVERTICAL

The page is visible vertically in its entirety.

N2PDFVALUE_ZOOMMODE_FITPAGE

The page is visible in its entirety.

 

 

N2PDFOPTION_PDF_FONT_MODE

This parameter is used to determine in what form the font types (TrueType) are integrated in the PDF file.

 

N2PDFVALUE_FONT_USE_TRUETYPE

Use TrueType fonts, but do not embed the font types' data.

N2PDFVALUE_FONT_USE_14BASE_TYPE1

Use no TrueType fonts. When this mode is activated you can only use the following fonts: Arial, Courier New and Times New Roman.

N2PDFVALUE_FONT_EMBED_TRUETYPE

Embed the data of all TrueType fonts to be used.

N2PDFVALUE_FONT_EMBED_TRUETYPE_SYMBOL

Embed only the symbol TrueType fonts (WingDings etc.)

N2PDFVALUE_FONT_EMBED_TRUETYPE_USED

Embeds the data of the TrueType fonts used and only those characters that are also used in the PDF file

N2PDFVALUE_FONT_EMBED_TRUETYPE_CSET

Embeds the data of the TrueType fonts used, namely all those needed according to the current codepage. Keep in mind that the embedding is based on the code page on which the PDF file is created

N2PDFVALUE_FONT_EMBED_TYPE3

Includes the fonts in the TYPE 3 format.

 

 

N2PDFOPTION_PDF_COMPRESSION_MODE

You can select the compression method for the PDF file using this parameter.

 

N2PDFVALUE_COMPRESSION_NONE

No compression.

N2PDFVALUE_COMPRESSION_DEFLATE

Use "deflate" method for compression (best compression)

N2PDFVALUE_COMPRESSION_RUNLENGTH

Use the "run length" method for compression (compatible with older PDF file versions)

 

 

N2PDFOPTION_PDF_JPEG_LEVEL

With this parameter you can set the ratio of JPEG quality and level of compression.

 

N2PDFVALUE_JPEG_NONE        

No compression of JPEG files.

 

Data is compressed using only the method selected under N2PDFOPTION_PDF_COMPRESSION_MODE.        

 

N2PDFVALUE_JPEG_LOWEST

Best compression, poorest image quality

N2PDFVALUE_JPEG_LOW

….

N2PDFVALUE_JPEG_MEDIUM

….

N2PDFVALUE_JPEG_HIGH

….

N2PDFVALUE_JPEG_HIGHEST

Poorest compression, best image quality

 

 

N2PDFOPTION_PDF_CONVERT_HYPERLINKS

This parameter is used to turn the function of clickable hyperlinks in the PDF on or off.

 

N2PDFVALUE_TRUE

Hyperlinks clickable in PDF

N2PDFVALUE_FALSE

Hyperlinks not clickable in PDF

 

 

N2PDFOPTION_PDF_CONVERT_JUMPLINKS

This parameter is used to turn the option which creates user defined jump links on or off, making them clickable in the PDF or not.

 

N2PDFVALUE_TRUE

Jump links are clickable in the PDF

N2PDFVALUE_FALSE

Jump links are not clickable in the PDF

 

 

N2PDFOPTION_PDF_CONVERT_FILELINKS

This parameter is used to turn the option which creates file links on or off, making them clickable in the PDF or not.

 

N2PDFVALUE_TRUE

File links are clickable in the PDF

N2PDFVALUE_FALSE

File links are not clickable in the PDF

 

 

N2PDFOPTION_PDF_CONVERT_EMAILLINKS

This parameter is used to turn the option which creates email links on or off, making them clickable in the PDF or not.

 

N2PDFVALUE_TRUE

E-mail links are clickable in the PDF

N2PDFVALUE_FALSE

E-mail links are not clickable in the PDF

 

 

N2PDFOPTION_PDF_CONVERT_HOTSPOTLINKS

Use this parameter to control whether elements that are defined in Notes as "hotspots" are included in the PDF file as clickable links. In Notes, graphics or texts can be defined as link hotspots (Hotspot Resource Links) and given a Notes formula or URL, or a document, view or database link.

 

clip0054

 

If you set the option N2PDFOPTION_PDF_CONVERT_HOTSPOTLINKS to N2PDFVALUE_TRUE, then these elements are also clickable later in the PDF file.

 

N2PDFVALUE_TRUE

Hotspots are clickable

N2PDFVALUE_FALSE

Hotspots are not clickable

 

 

N2PDFOPTION_PDF_CREATE_THUMBNAILS

You can use this parameter to enforce the creation of thumbnails, meaning that you do not have to rely on the reader to create them itself.

 

N2PDFVALUE_TRUE

Create thumbnails

N2PDFVALUE_FALSE

Do not create thumbnails

 

112

This setting should only be used when the PDF file is being created for older versions of Acrobat Reader (earlier than version 5). Acrobat Reader versions 5 and later create the thumbnails themselves, which are of better quality.

 

N2PDFOPTION_PDF_ENCRYPTION_MODE

Encryption settings for the PDF file are made using these parameters.

 

N2PDFVALUE_ENCRYPTION_NONE

Do not use encryption

N2PDFVALUE_ENCRYPTION_40BIT

Use 40 bit encryption

N2PDFVALUE_ENCRYPTION_128BIT

Use 128 bit encryption

 

112

A random password is generated if you activate an encryption mode and do not set an "owner" password. If this happens you will be unable to edit the file later, since you will not know what the password is. To ensure that the file can be edited later you must also use the function N2PDFOPTION_PDF_PASSWORD_OWNER.

 

 

N2PDFOPTION_PDF_PASSWORD_OWNER

This parameter is used to set the password ("owner password") that protects access to the PDF file for editing and enables the file to be encrypted (see N2PDFOPTION_PDF_ENCRYPTION_MODE). Use your own password as the value.

 

 

N2PDFOPTION_PDF_PASSWORD_USER

This parameter is used to set the password ("user password") that must be entered for reader access to the PDF file. Use the password as the value.

 

 

You can use the following parameters to restrict the operations that can be performed with the PDF file.

 

clip0053

 

N2PDFOPTION_PDF_SECURITY_PRINT

Allow or prohibit printing of the PDF file

N2PDFOPTION_PDF_SECURITY_CHANGE

Allow or prohibit making changes to the PDF file

N2PDFOPTION_PDF_SECURITY_COPY

Allow or prohibit the copying or extraction of content from the PDF file

N2PDFOPTION_PDF_SECURITY_FORM

Allow or prohibit the editing of form fields and comments

N2PDFOPTION_PDF_SECURITY_DOC_ASSEMBLY

Compilation of content

N2PDFOPTION_PDF_SECURITY_FORM_FILL_IN

Filling in and signing of form fields

N2PDFOPTION_PDF_SECURITY_ACCESSIBILITY

Output help for the content

 

Set the value as N2PDFVALUE_TRUE when you want to allow an operation and N2PDFVALUE_FALSE if the operation is to be prohibited.

 

112

These settings are only effective when encryption is activated at the same time (see N2PDFOPTION_PDF_ENCRYPTION_MODE).

 

 

112

A few settings are dependent on other security settings, and can only be used together. You can find the interaction of the individual security options in the Acrobat SDK. In Version 8 of the SDK, the description is in the document "pdf_reference.pdf" in Chapter "3.5.2 - Standard Security Handler". "TABLE 3.20 User access permission" should especially be noted.

 

 

You can fill the info area of the PDF file using the following options. Use the content that is to be displayed there as the value.

 

N2PDFOPTION_PDF_INFO_TITLE

Title of PDF file

N2PDFOPTION_PDF_INFO_SUBJECT

Subject of PDF file

N2PDFOPTION_PDF_INFO_AUTHOR

PDF file author

N2PDFOPTION_PDF_INFO_KEYWORDS

PDF file keywords

N2PDFOPTION_PDF_INFO_PRODUCER

PDF file producer

 

 

N2PDFOPTION_PDF_CREATE_OUTLINE

You can activate the bookmark creation function using this parameter. When this option is activated, the entries in the PDF file's table of contents are simultaneously converted into (clickable) bookmarks.

 

N2PDFVALUE_TRUE

Create bookmarks

N2PDFVALUE_FALSE

Do not create bookmarks

 

 

N2PDFOPTION_PDF_WATERMARK_IMAGE_RESOURCE

Using this parameter you can specify a Notes image resource that is found as a watermark in the background of the PDF file. You can also specify the position on the page where you want the watermark to appear. You set the position of the watermark using the first value (<OptionStr>) in N2PDFSetOption. The following positions may be chosen:

 

N2PDFVALUE_WATERMARK_POS_TOP_LEFT

Top left corner

N2PDFVALUE_WATERMARK_POS_TOP_CENTER

Centered on top edge

N2PDFVALUE_WATERMARK_POS_TOP_RIGHT

Top right corner

N2PDFVALUE_WATERMARK_POS_LEFT_CENTER

Centered on left edge

N2PDFVALUE_WATERMARK_POS_RIGHT_CENTER

Centered on right edge

N2PDFVALUE_WATERMARK_POS_BOTTOM_LEFT

Bottom left corner

N2PDFVALUE_WATERMARK_POS_BOTTOM_CENTER

Centered on bottom edge

N2PDFVALUE_WATERMARK_POS_BOTTOM_RIGHT

Bottom right corner

N2PDFVALUE_WATERMARK_POS_CENTER

In the center of the page

 

With the second value (<SubOptionStr>) in N2PDFSetOption you set all the information about the image that is to be used as a watermark in the PDF. You assign all the information needed to separate the image from the database. To do this you will need the image's server, database and file names.

The value is written as follows: "<server>;<database>;<filename>"

 

Example (Position the file "n2pdf.jpg" as a watermark in the middle of the page):

Dim ImageRes As String

ImageRes = db.Server+";" + db.FilePath+";n2pdf.jpg"

Call N2PDFSetOption ( JobID, N2PDFOPTION_PDF_WATERMARK_IMAGE_RESOURCE,_

N2PDFVALUE_WATERMARK_POS_CENTER, ImageRes )

 

112

Only graphics in JPEG format are supported for use as watermarks at the present time!

 

 

N2PDFOPTION_PDF_LANGUAGE_CODE

This parameter is used to define the language in which the PDF file was created. The value transferred is the language code defined in ISO standard 639-1. This language code is required when creating PDF/A-compliant documents.

 

 

112

Further information:

http://de.wikipedia.org/wiki/ISO_639#ISO_639-1

http://www.loc.gov/standards/iso639-2/php/code_list.php

 

N2PDFOPTION_PDF_CID_FONT_MODE

You can use these parameters to enable the creation of CID fonts or to use CMaps for the layout of the PDF file.

 

CID format is a PostScript format specifically developed by Adobe for extensive character sets, e.g. Chinese, Japanese or Korean. The CID format enables PDF files to be created with embedded character sets.

 

CID stands for "Character Identifier", which in turn refers to the "Character Identifier Numbers" which are used to index and find individual characters in the font. A CID font consists of a large file with outline descriptions of characters and a small "CMap" file containing the character list, coding and "Character Identifier".

 

n2pdf uses CID fonts, e.g. for creating PDF files in complex character sets (Japanese, Chinese and Korean) (http://www.adobe.com/products/postscript/pdfs/cid.pdf). If contents based on corresponding Character Sets are created, the CID font mode for the character set of these languages is automatically enabled internally.

 

The complex character sets always use the 'Standard CMaps' (see PDF SDK 1.7 "Predefined CMaps") of the PDF format, i.e. viewing requires the relevant language packages and the same character sets are always used.

 

The following predefined CMaps are used for the complex character sets:

 

Language

Predefined CMap used

Chinese (simplified)

GBK-EUC-H

Japanese

90ms-RKSJ-H

Korean

KSCmsp-UHC-H

 

112

With complex scripts it is not possible at this time to use just any choice of character set. Instead, for these scripts, the CMaps defined above are always used.

 

 

n2pdf is also capable of using CID fonts for non-complex languages (e.g. Russian or Greek). Although CID fonts are not intended primarily for these languages, this mode nonetheless delivers good results. Especially when compared to the embedding of character sets, this mode offers substantial advantages because it often gives rise to smaller PDF files.

 

112

The use of CID fonts should always be checked for their corresponding character sets, e.g. to establish whether display errors are present. It is not always possible to achieve an optimum result in CID font mode, e.g. if the character sets are not complete.

 

You can use CID fonts (and therefore also to create CMaps) using the following commands.

Call N2PDFSetOption ( JobID, N2PDFOPTION_PDF_CID_FONT_MODE,_

N2PDFVALUE_CID_FONT_MODE_UNICODE, "" )

 

Set the value to N2PDFVALUE_CID_FONT_MODE_NONE and the setting is disabled.

 

These character sets, based on Unicode values for characters, are then used to create CMaps. You should if possible only use character sets which contain appropriate Unicode encoding. With some character sets, this can otherwise give rise to an incomplete CMap.

 

PDF files created on the basis of CMaps can be displayed on a system which does not have the font and/or that font in the corresponding Character Set.

 

112

Please note that, when enabling this option, the size of the PDF file will grow because components of the character sets will become embedded.

 

N2PDFOPTION_PDF_CHARSET

This parameter can be used to alter the Character Set (Charset). This is necessary to create a PDF file whose content is not based on the current character set on the computer, i.e. should you wish to create a PDF file with Japanese content (128) on a computer with German language setting (ANSI).

 

You will find further information in the Unicode section.

 

Sets the Charset "SHIFTJIS" (128) for Japanese language support in the PDF file:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PDF_CHARSET,  "128", "" )        

 

Permitted values for the "Charset" (left column):

 

1

ANSI (DEFAULT)

128

SHIFTJIS

129

HANGEUL

130

JOHAB

134

GB2312

136

CHINESEBIG5

161

GREEK

162

TURKISH

163

VIETNAMESE

177

HEBREW*

178

ARABIC*

186

BALTIC

204

RUSSIAN

222

THAI

238

EASTEUROPE

 

* = at present not supported due to "right to left" alignment

 

N2PDFOPTION_PDF_CREATE_DESTINATIONS

Use this option to activate the creation of named destinations in the PDF. Named destinations are bookmarks within the PDF file which allow you to jump directly to these destinations, for example, when the file is opened.

 

N2PDFVALUE_TRUE

Enable conversion of the destinations

N2PDFVALUE_FALSE

Disable conversion of the destinations

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_PDF_CREATE_DESTINATIONS, N2PDFVALUE_TRUE, "" )

 

112

The named destinations can be used when a PDF file is opened with Acrobat Reader. Further information about this can be found in the document "http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf" under the parameter "namedest".

 

 

 

N2PDFOPTION_PDF_CONVERT_PDFFIELDS

Use this option to activate the conversion of the PDF fields in n2pdf. A template such as this always consists of the command word (see the definition below) with a colon at the end followed by the field name and the preset of the field. The field name and the default value are separated by a "|” (pipe). The entire template is framed by squared brackets, which thus form the beginning and end definition of the template.

 

Definition:

[PDFEDIT:NAME|VORGABE|HINT]

[PDFCHECKBOX:NAME2|TRUE]

[PDFCHECKBOX:NAME3|FALSE]

 

N2PDFVALUE_TRUE

Enable the conversion of the PDF field templates

N2PDFVALUE_FALSE

Disable the conversion of the PDF field templates

 

Example:

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_PDF_CONVERT_PDFFIELDS, N2PDFVALUE_TRUE, "" )