Settings

Start page  Previous page  Next page

 

The following settings influence the way attachments are handled. All options are set via the function N2PDFSetOption. You can choose from the following function parameters:

 

N2PDFOPTION_ATTACHMENT_MODE

This option defines how attachments are handled (also see "general attachment handling" and the description of the function "N2PDFAddAttachment"). <OptionStr> offers the following settings.

 

N2PDFVALUE_ATTACHMENT_IMPORT_MODE

The content of an attachment is directly imported into the PDF file and processed.

N2PDFVALUE_ATTACHMENT_CONVERT_MODE

Convert the attachment into a standalone PDF file and attach it to the new PDF file.

N2PDFVALUE_ATTACHMENT_LINK_MODE

The attachment is saved to the file system and a link to the file is added to the PDF.

N2PDFVALUE_ATTACHMENT_EMBED_MODE

Embed an attachment in the PDF.

 

Example: Embed attachments in the PDF

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_MODE,_

N2PDFVALUE_ATTACHMENT_EMBED_MODE, ""  )

 

Example: Import attachments to the PDF

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_MODE,_

N2PDFVALUE_ATTACHMENT_IMPORT_MODE, "" )

 

Example: Attachments are saved externally and a link is to be created in the PDF

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_MODE,_

N2PDFVALUE_ATTACHMENT_LINK_MODE, "" )

 

 

N2PDFOPTION_ATTACHMENT_IMAGE_SIZE

This option is true only for image attachments and influences the display size when images are imported to a PDF as content.

 

The value <OptionStr> allows the following options when calling the function:

 

N2PDFVALUE_ATTACHMENT_ORIGINAL

The file's original size is maintained.

N2PDFVALUE_ATTACHMENT_FIT

The image is reduced to the page size.

N2PDFVALUE_ATTACHMENT_FIT_ASPECT_RATIO

The image is made to fit the page but within the original aspect ration the image has.

 

Example: Image is imported in the original size

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_IMAGE_SIZE,_

N2PDFVALUE_ATTACHMENT_ORIGINAL, "" )

 

Example: Image is made to fit the page

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_IMAGE_SIZE,_

N2PDFVALUE_ATTACHMENT_FIT, "" )

 

Example: Image is made to fit the page, but the aspect ratio is maintained

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_IMAGE_SIZE,_

N2PDFVALUE_ATTACHMENT_FIT_ASPECT_RATIO, "" )

 

 

N2PDFOPTION_ATTACHMENT_COUNT_PDF_PAGES

With these parameters, you can set whether the function N2PDFAddAttachment should return the number of pages for all added PDF files (return value >0). If during a function call you transfer several PDF files, the pages of the PDF files transferred are added together.

 

112

The number of pages can only be established for PDF files.

 

N2PDFOPTION_ATTACHMENT_IGNORE_UNKNOWN

With these parameters, you can set whether the function N2PDFAddAttachment should return an error code for an unknown file attachment.

 

 

N2PDFVALUE_TRUE

No return of an error code

N2PDFVALUE_FALSE

Return of an error code

 

 

N2PDFOPTION_ATTACHMENT_ADD_PASSWORD

This option allows the transfer of passwords needed for opening password protected files. The option works with three different types of passwords: Archive formats, office formats and the PDF format.

 

The value <OptionStr> allows the following password types to be used:

 

N2PDFVALUE_ATTACHMENT_PASSWORD_ARCHIVE

Password list for archive formats

N2PDFVALUE_ATTACHMENT_PASSWORD_PDF

Password list for PDF files

N2PDFVALUE_ATTACHMENT_PASSWORD_OFFICE

Password for office formats

 

Example: Transfer of the password “ABC” for PDF documents

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_PASSWORD,_

"ABC", N2PDFVALUE_ATTACHMENT_PASSWORD_PDF)

 

112

With the PDF and archive password types, as many passwords as desired can be set. With the passwords for the office formats, only the password that was set last is valid.

 

 

112

If you transfer (“ “) as the password, then this password will be set for all three passwords (password lists).

 

 

N2PDFOPTION_ATTACHMENT_CLEAR_PASSWORD

You can use this option to delete specific passwords or password lists which were set in the option N2PDFOPTION_ATTACHMENT_ADD_PASSWORD .

 

The value <OptionStr> allows the following password types to be used:

 

N2PDFVALUE_ATTACHMENT_PASSWORD_ARCHIVE

Deletes the password list for archive formats

N2PDFVALUE_ATTACHMENT_PASSWORD_PDF

Deletes the password list for PDF files

N2PDFVALUE_ATTACHMENT_PASSWORD_OFFICE

Deletes the password for office formats

 

Example: Deleting the password list for PDF documents

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_CLEAR_PASSWORD,_

N2PDFVALUE_ATTACHMENT_PASSWORD_PDF, "")

 

 

N2PDFOPTION_ATTACHMENT_EXTENDED_INFO

This option allows the addition of a user-defined, supplementary content element to the name of the file attachment. For example, the storage of information in this way makes it possible for an archive system to make a categorization within the archive in dependence on the values found.

 

The value <OptionStr> allows the following parameters to be used:

 

N2PDFVALUE_ATTACHMENT_INFO_FILENAME

Name of the file attachment

N2PDFVALUE_ATTACHMENT_INFO_FILEPATH

Directory of the file attachment

 

Example: Enhance the file information with a uniform structure

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EXTENDED_INFO,_

"<tag>reference number\" & N2PDFVALUE_ATTACHMENT_INFO_FILENAME & "</tag>", "")

 

 

N2PDFOPTION_ATTACHMENT_EXPORT_OLE

This option allows OLE objects saved in Notes documents to be converted to file attachments. The OLE objects are extracted and the files contained in OLE objects are saved as normal attachments in the PDF document. All options enabled for the further processing of attachments can be applied. The way OLE objects are handled then corresponds to that used for file attachments.

 

N2PDFVALUE_TRUE

No processing of OLE objects

N2PDFVALUE_FALSE

Enable OLE object processing

 

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

 

 

N2PDFOPTION_ATTACHMENT_ADD_OUTLINE_ENTRY

This option allows a separate entry for added file attachments to be made in the outline of the PDF document. The added PDF document is then linked with this entry. If the integrated PDF document is to contain an outline, then all of the entries are inserted below the new entry.

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_OUTLINE_ENTRY, "Attachment1", "")

Call N2PDFAddAttachment ( ... )

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_OUTLINE_ENTRY, "Attachment2", "")

Call N2PDFAddFile ( ... )

 

 

N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE

This option allows creation of a list of file attachments which are to be ignored during conversion.

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE, ".exe", "")

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE, ".dll", "")

 

 

N2PDFOPTION_ATTACHMENT_CLEAR_CONV_IGNORE

This option deletes the list created under N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE.  

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE, "", "")

 

 

N2PDFOPTION_ATTACHMENT_ADD_ARC_IGNORE

This option allows creation of a list of file attachments (archive formats) which are to be unpacked.

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE, ".jar", "")

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_ADD_CONV_IGNORE, ".zip", "")

 

 

N2PDFOPTION_ATTACHMENT_CLEAR_ARC_IGNORE

This option deletes the list created under N2PDFOPTION_ATTACHMENT_ADD_ARC_IGNORE.  

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_CLEAR_CONV_IGNORE, "", "")

 

 

 

112

This option only works for PDF documents. Consequently, attachments must be processed via N2PDFOPTION_ATTACHMENT_MODE with the mode N2PDFVALUE_ATTACHMENT_IMPORT_MODE or N2PDFVALUE_ATTACHMENT_CONVERT_MODE.