|
|
|
|
iAddAttachment (Function) In french: iAjoutePièceJointe Adds an attachment in a PDF file generated by a PDF print export. It must be exported: - with iDestination (iPDF or iGenericPDF constant).
- from the report viewer (also called "print preview").
- from the print mini-preview.
// PDF destination iDestination(iGenericPDF, "c:\path\pdf.pdf") // Add an attachment iAddAttachment("c:\path\pj.xls", "Example spreadsheet", "application/vnd.ms-excel") // Positions a bookmark and a text at 5 cm from the top of the page iYPos(50) iAddBookmark("page 1 line 1", "First line of the first page", "page1") iPrint("First line of the first page") // End of print iEndPrinting() Syntax
Adding an attachment (as a file) to a PDF file Hide the details
iAddAttachment(<File to add> [, <Description> [, <MIME type>]])
<File to add>: Character string Full or relative path of the file on disk to be added after the PDF file print generation. <Description>: Optional character string Short description of the file to add. <MIME type>: Optional character string or string constant Mime type associated to the added file: - Name of MIME type to use. More than 150 types are defined in the MIME communication standard (available on Internet). The most common values recognized by most browsers are:
- "application/pdf": document in PDF format (*.pdf)
- "text/html": HTML page (*.htm, *.html)
- "text/plain": text file (*.txt)
- "image/gif": image in GIF format (*.gif)
- "image/jpeg": image in JPEG format (*.jpg, *.jpeg)
- "video/mpeg": video in MPEG format (*.mpg, *.mpeg)
- MIME type corresponding to one of the following constants:
| | typeMimeXMLApplication | XML content. | typeMimeBinary | Binary content (byte stream). | typeMimeDOC | Content such as Word file (*.doc) | typeMimeDOCX | Content such as Word file (*.docx) | typeMimeGIF | Content such as Image in GIF format (*.gif) | typeMimeHTML | Content such as HTML page (*.htm, *.html) | typeMimeJPEG | Content such as image in JPEG format (*.jpg, *.jpeg) | typeMimeJSON | JSON content. | typeMimePDF | Content such as PDF document (*.pdf) | typeMimePNG | Content such as image in JPEG format (*.png) | typeMimeSOAP | SOAP content in XML format. | typeMimeText | Content in text format (*.txt) | typeMimeXMLText | Text content in XML format | typeMimeXLS | Content in Excel format (*.xls) | typeMimeXLSX | Content in Excel format (*.xlsx) | typeMimeZIP | Content in ZIP format (*.zip) |
Adding an attachment (as a buffer) to a PDF file Hide the details
iAddAttachment(<Buffer to add> , <Attachment name> [, <Description> [, <MIME type> [, <Date created> [, <Modification date>]]]])
<Buffer to add>: Buffer Content to be added after the PDF file print generation. <Attachment name>: Character string Name of the attachment that will be displayed in the PDF file. Caution: the extension of the attachment must be specified. <Description>: Optional character string Short description of the content to add. <MIME type>: Optional character string or string constant Mime type associated with the added content: - Name of MIME type to use. More than 150 types are defined in the MIME communication standard (available on Internet). The most common values recognized by most browsers are:
- "application/pdf": document in PDF format (*.pdf)
- "text/html": HTML page (*.htm, *.html)
- "text/plain": text file (*.txt)
- "image/gif": image in GIF format (*.gif)
- "image/jpeg": image in JPEG format (*.jpg, *.jpeg)
- "video/mpeg": video in MPEG format (*.mpg, *.mpeg)
- MIME type corresponding to one of the following constants:
| | typeMimeXMLApplication | XML content. | typeMimeBinary | Binary content (byte stream). | typeMimeDOC | Content such as Word file (*.doc) | typeMimeDOCX | Content such as Word file (*.docx) | typeMimeGIF | Content such as Image in GIF format (*.gif) | typeMimeHTML | Content such as HTML page (*.htm, *.html) | typeMimeJPEG | Content such as image in JPEG format (*.jpg, *.jpeg) | typeMimeJSON | JSON content. | typeMimePDF | Content such as PDF document (*.pdf) | typeMimePNG | Content such as image in JPEG format (*.png) | typeMimeSOAP | SOAP content in XML format. | typeMimeText | Content in text format (*.txt) | typeMimeXMLText | Text content in XML format | typeMimeXLS | Content in Excel format (*.xls) | typeMimeXLSX | Content in Excel format (*.xlsx) | typeMimeZIP | Content in ZIP format (*.zip) |
<Date created>: Optional DateTime Attachment UTC creation date. <Modification date>: Optional DateTime Attachment UTC modification date. Remarks Format of the PDF file iAddAttachment only allows adding files to PDF and PDF/A-3b files. Reminder: The format in which the PDF will be generated can be chosen via iParameterPDF. Caution: The PDF/A-1b format does not allow adding attachments: iAddAttachment generates a fatal error in that case. Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|