Embedding file attachments |
Start page Previous page Next page |
If the option N2PDFVALUE_ATTACHMENT_EMBED_MODE is set with command N2PDFSetOption, the attachment is embedded in the PDF file. The original file is attached to the PDF. How this attachment is displayed may be controlled via additional settings.
Example: Embed an attachment in the PDF
Call N2PDFSetOption ( JobID,_ N2PDFOPTION_ATTACHMENT_MODE,_ N2PDFVALUE_ATTACHMENT_EMBED_MODE ,_ "" )
Call N2PDFAddAttachment ( JobID,_ 0,_ N2PDFVALUE_CRLF_BEFORE,_ db.Server,_ db.FilePath,_ doc.UniversalID,_ "File",_ "" )
N2PDFOPTION_ATTACHMENT_EMBED_ICONThis option defines which symbol is to be used in the PDF to show an embedded file. This may be the file formats own symbol (as it is registered in Windows) or one of the pre-defined symbols of the PDF format.
Example: Create an attachment with a pin Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EMBED_ICON,_ N2PDFVALUE_ATTACHMENT_EMBED_ICON_PIN, "" )
N2PDFOPTION_ATTACHMENT_EMBED_SHOW_NAMEThis option defines if the file name of the embedded file is shown below the embedded file. This option will only show an effect if N2PDFOPTION_ATTACHMENT_EMBED_ICON is using the setting N2PDFVALUE_ATTACHMENT_EMBED_ICON_EXT.
Example: Display the file name below the attachment symbol Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EMBED_SHOW_NAME,_ N2PDFVALUE_True, "" ) N2PDFOPTION_ATTACHMENT_EMBED_AT_POSThis option is used to define if the embedded file is displayed at the end of the document or placed in the same place it is shown in, in the original document.
Example: Embed file in original position Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EMBED_AT_POS,_ N2PDFVALUE_True, "" )
N2PDFOPTION_ATTACHMENT_EMBED_OBJ_AUTHORThis option enables a title (Author Field) to be set for embedded PDF objects in a PDF document. This information is stored in the document as a "Hint Message" and does not appear until the mouse cursor (Tooltip) is positioned over an embedded PDF object in the PDF file.
N2PDFOPTION_ATTACHMENT_EMBED_PDF_CONVERTThis option automatically converts file attachments to PDF format so that the attachments can be embedded in the PDF document. This option can be used for the functions N2PDFAddAttachment and N2PDFAddFile. Storage in the original format is carried out automatically in the event that conversion to the PDF format is not possible. For this option, the same settings apply that were set for the CONVERT mode.
This option must be enabled if you wish to embed file attachments and later convert the PDF document to PDF/A-2 or PDF/A-3.
|