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" , "" )
N2PDFOPTION_PDF_PAGE_MODEThis parameter is used to determine in what mode the PDF reader is opened.
N2PDFOPTION_PDF_ZOOM_MODEThis parameter specifies the zoom range at which the PDF reader is opened.
N2PDFOPTION_PDF_FONT_MODEThis parameter is used to determine in what form the font types (TrueType) are integrated in the PDF file.
N2PDFOPTION_PDF_COMPRESSION_MODEYou can select the compression method for the PDF file using this parameter.
N2PDFOPTION_PDF_JPEG_LEVELWith 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.
N2PDFOPTION_PDF_CONVERT_HYPERLINKSThis parameter is used to turn the function of clickable hyperlinks in the PDF on or off.
N2PDFOPTION_PDF_CONVERT_JUMPLINKSThis parameter is used to turn the option which creates user defined jump links on or off, making them clickable in the PDF or not.
N2PDFOPTION_PDF_CONVERT_FILELINKSThis parameter is used to turn the option which creates file links on or off, making them clickable in the PDF or not.
N2PDFOPTION_PDF_CONVERT_EMAILLINKSThis parameter is used to turn the option which creates email links on or off, making them clickable in the PDF or not.
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.
If you set the option N2PDFOPTION_PDF_CONVERT_HOTSPOTLINKS to N2PDFVALUE_TRUE, then these elements are also clickable later in the PDF file.
N2PDFOPTION_PDF_CREATE_THUMBNAILSYou 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.
N2PDFOPTION_PDF_ENCRYPTION_MODEEncryption settings for the PDF file are made using these parameters.
N2PDFOPTION_PDF_PASSWORD_OWNERThis 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_USERThis 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.
Set the value as N2PDFVALUE_TRUE when you want to allow an operation and N2PDFVALUE_FALSE if the operation is to be prohibited.
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_CREATE_OUTLINEYou 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.
N2PDFOPTION_PDF_WATERMARK_IMAGE_RESOURCEUsing 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:
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 )
N2PDFOPTION_PDF_LANGUAGE_CODEThis 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.
N2PDFOPTION_PDF_CID_FONT_MODEYou 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:
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.
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.
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):
* = 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.
Example: Call N2PDFSetOption ( JobID, N2PDFOPTION_PDF_CREATE_DESTINATIONS, N2PDFVALUE_TRUE, "" )
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]
Example: Call N2PDFSetOption ( JobID,_ N2PDFOPTION_PDF_CONVERT_PDFFIELDS, N2PDFVALUE_TRUE, "" )
|