|
|
|
|
|
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:
| | mimeTypeXMLApplication | XML content. | mimeTypeBinary | Binary content (byte stream). | mimeTypeDOC | Word file (*.doc) | mimeTypeDOCX | Word file (*.docx) | mimeTypeGIF | GIF image (*.gif) | mimeTypeHTML | HTML page (*.htm, *.html) | mimeTypeJPEG | JPEG image (*.jpg, *.jpeg) | mimeTypeJSON | JSON content. | mimeTypePDF | PDF document (*.pdf) | mimeTypePNG | JPEG image (*.png) | mimeTypeSOAP | SOAP content in XML format. | mimeTypeText | Text (*.txt) | mimeTypeXMLText | XML text | mimeTypeXLS | Excel file (*.xls) | mimeTypeXLSX | Excel file (*.xlsx) | mimeTypeZIP | ZIP file (*.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:
| | mimeTypeXMLApplication | XML content. | mimeTypeBinary | Binary content (byte stream). | mimeTypeDOC | Word file (*.doc) | mimeTypeDOCX | Word file (*.docx) | mimeTypeGIF | GIF image (*.gif) | mimeTypeHTML | HTML page (*.htm, *.html) | mimeTypeJPEG | JPEG image (*.jpg, *.jpeg) | mimeTypeJSON | JSON content. | mimeTypePDF | PDF document (*.pdf) | mimeTypePNG | JPEG image (*.png) | mimeTypeSOAP | SOAP content in XML format. | mimeTypeText | Text (*.txt) | mimeTypeXMLText | XML text | mimeTypeXLS | Excel file (*.xls) | mimeTypeXLSX | Excel file (*.xlsx) | mimeTypeZIP | ZIP file (*.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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|