ZIP Compression

Start page  Previous page  Next page

 

n2pdf provides an option to compress a PDF file as a ZIP archive after creation. This option allows you to e.g. add a created PDF file to an existing ZIP archive or if you are creating a serial letter, whereby there is one PDF per document. This option allows you to collect all documents in a single ZIP file.

 

The following options allow the creation of a ZIP file, respectively are options when creating such an archive:

 

N2PDFOPTION_COMPRESS_OUTPUT_FILE

This option activates the creation of a ZIP archive and the PDF file created by n2pdf is saved as a ZIP archive.

 

112

The PDF file is moved to the ZIP archive, meaning the PDF file no longer exists on the file system after N2PDFProcess is called. You should bear that in mind while programming.

 

 

N2PDFVALUE_TRUE

The PDF file is packed in a ZIP archive.

N2PDFVALUE_FALSE

The PDF file is not packed in a ZIP archive.

 

Example:

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_COMPRESS_Output_FILE, N2PDFVALUE_True,"" )

 

 

N2PDFOPTION_COMPRESS_TARGET_FILENAME

Use this option to define the file name which is used to name the ZIP archive. If a file with this name does not exist a ZIP file is created and the PDF written to it. If an archive with that name exists, then n2pdf will attempt to save the PDF to that archive.

 

Example:

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_COMPRESS_TARGET_FILENAME, "C:\Temp\Daten.zip,"" )

 

 

N2PDFOPTION_COMPRESS_PASSWORD

This option allows you to set a password with which the PDF file is encrypted in the ZIP archive.

 

Example:

Call N2PDFSetOption ( JobID,_

N2PDFOPTION_COMPRESS_PASSWORD, "1234","" )