Settings

Top  Previous  Next

 

The following settings influence the way attachments are handled. All options are set via the function N2PDFSetOption. The function supports the following 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.

 

Note: 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

 

 

The following settings allow you to control the use of the "StarOffice Server PDF Converter" (SOC) from within n2pdf. All options are set via the function N2PDFSetOption. The function supports the following parameters:

 

N2PDFOPTION_SOC_...

The following parameters defines the access to the "StarOffice Server PDF Converter". As the converter is a WebService there are a number of necessary settings for the access to the WebService. If these settings are not set, then n2pdf assumes the "StarOffice Server PDF Converter" is installed and running on the same machine ("localhost" or "127.0.0.1") accessible via Port 8080. If this is not the case, then the following information is required.

 

N2PDFOPTION_SOC_ADDRESS

URL of the machine the WebService is installed on (without "http://")

N2PDFOPTION_SOC_PORT

Port for the access to the WebService

N2PDFOPTION_SOC_PROXY

URL in case the access to the WebService takes place via a Proxy

N2PDFOPTION_SOC_USER

User name for access to the WebService via a Proxy

N2PDFOPTION_SOC_PASSWORD

Password for access to the WebService via a Proxy

 

Example: WebService is on IP address "192.168.1.10" and "Port 80"

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_SOC_ADDRESS, "192.168.1.10", ""  )

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_SOC_PORT,"80",""  )