Linking file attachments

Start page  Previous page  Next page

 

112

The following options only take effect if N2PDFOPTION_ATTACHMENT_MODE has been set to N2PDFVALUE_ATTACHMENT_LINK_MODE.

 

If the option N2PDFVALUE_ATTACHMENT_LINK_MODE is set for the command N2PDFSetOption, then a link is added to the PDF for every attachment. The clickability and presentation of this link can be adjusted by further settings.

 

Example: Save the attachment to the file system and insert a link to the file in the PDF

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_MODE,_

N2PDFVALUE_ATTACHMENT_LINK_MODE,_

 

Call N2PDFAddAttachment ( JobID,_

0,_

N2PDFVALUE_CRLF_BEFORE,_

db.Server,_

db.FilePath,_

doc.UniversalID,_

"File",_

"" )        

 

 

N2PDFOPTION_ATTACHMENT_TARGET_PATH

Path in which file attachments are saved

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_TARGET_PATH,_

"C:\TEMP", "" )

 

 

N2PDFOPTION_ATTACHMENT_LINK_WITH_PATH

This option defines if the link to the attachment is created including the path or not. If the path is not included, then the attachment and the PDF have to be stored in the same directory. Default: N2PDFVALUE_TRUE

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_LINK_With_PATH,_

N2PDFVALUE_True , "" )

 

 

N2PDFOPTION_ATTACHMENT_LINK_UNC_PATH

When a path description for the link is used, this parameter defines whether the path is defined in UNC encoding (\\<computer name>\<clearance>) or not.

 

Example:

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_LINK_UNC_PATH,_

N2PDFVALUE_True , "" )

 

 

N2PDFOPTION_ATTACHMENT_LINK_ICON

This option defines the form in which the clickable link should appear in the PDF document. This may be the file format's own symbol (as it is registered in Windows) or a simple text link containing the file name.

 

N2PDFVALUE_ATTACHMENT_LINK_EXT

Symbol of the file format

N2PDFVALUE_ATTACHMENT_LINK_TEXT

Text link

 

Example: Represent link with symbol of the file format

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_LINK_ICON,_

N2PDFVALUE_ATTACHMENT_LINK_EXT, "" )

 

 

N2PDFOPTION_ATTACHMENT_LINK_SHOW_NAME

This option defines whether the file name should be displayed below the link symbol or not. This option will only take effect if N2PDFOPTION_ATTACHMENT_LINK_ICON is using the setting N2PDFVALUE_ATTACHMENT_LINK_EXT.

 

N2PDFVALUE_TRUE

Display file name

N2PDFVALUE_FALSE

Do not display file name

 

Example: Display the file name below the attachment symbol

Call N2PDFSetOption ( JobID, N2PDFVALUE_ATTACHMENT_LINK_EXT,_

N2PDFVALUE_True, "" )

 

N2PDFOPTION_ATTACHMENT_LINK_AT_POS

This option is used to define whether the link should be displayed at the end of the document or placed in the same place in which the attachment is in the original document.

 

N2PDFVALUE_TRUE

Embed file in original position

N2PDFVALUE_FALSE

Embed file at the end of the document

 

Example: Embed the file at the original position

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_LINK_AT_POS,_

N2PDFVALUE_True, "" )

 

112

For packed attachments that contain more than one file, only the first file can be linked to the original position if the attachments are unpacked (see N2PDFOPTION_ATTACHMENT_EXTRACT_ARCHIVE).