|
PDF Settings |
Top Previous Next |
|
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" , "" )
Note: 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.
N2PDFOPTION_PDF_ZOOM_MODE This parameter specifies the zoom range at which the PDF reader is opened.
N2PDFOPTION_PDF_FONT_MODE This parameter is used to determine in what form the font types (TrueType) are integrated in the PDF file.
N2PDFOPTION_PDF_COMPRESSION_MODE You can select the compression method for the PDF file using this parameter.
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.
N2PDFOPTION_PDF_CONVERT_HYPERLINKS This parameter is used to turn the function of clickable hyperlinks in the PDF on or off.
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.
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.
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.
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_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.
Note: 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.
Note: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.
Set the value as N2PDFVALUE_TRUE when you want to allow an operation and N2PDFVALUE_FALSE if the operation is to be prohibited.
Note: These settings are only effective when encryption is activated at the same time (see N2PDFOPTION_PDF_ENCRYPTION_MODE).
Note: 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_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.
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:
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 )
Note: 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.
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:
Note: 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.
Note: 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.
Note: 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):
* = at present not supported due to "right to left" alignment
|