|
|
|
|
|
iAddAttachment (Function) 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()
Sintaxis
Adding an attachment (as a file) to a PDF file Ocultar los detalles
iAddAttachment(<File to add> [, <Description> [, <MIME type> [, <Possible relationship>]]])
<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 the MIME type to be used. More than 150 types are defined in the MIME communication standard (available on Internet). The most common values recognized by the majority of browsers are:
- "application/pdf": PDF file (*.pdf)
- "text/html": HTML page (*.htm, *.html)
- "text/plain": text file (*.txt)
- "image/gif": GIF image (*.gif)
- "image/jpeg": JPEG image (*.jpg, *.jpeg)
- "video/mpeg": MPEG video (*.mpg, *.mpeg)
- MIME type corresponding to one of the following constants:
| | mimeTypeXMLApplication | Contenido XML. | mimeTypeBinary | Contenido binario (flujo de bytes). | mimeTypeDOC | Archivo Word (*.doc) | mimeTypeDOCX | Archivo Word (*.docx) | mimeTypeGIF | Imagen GIF (*.gif) | mimeTypeHTML | Página HTML (*.htm, *.html) | mimeTypeJPEG | Imagen JPEG (*.jpg, *.jpeg) | mimeTypeJSON | Contenido JSON. | mimeTypePDF | Documento PDF (*.pdf) | mimeTypePNG | Imagen JPEG (*.png) | mimeTypeSOAP | Contenido SOAP en formato XML. | mimeTypeText | Texto (*.txt) | mimeTypeXMLText | Texto XML | mimeTypeXLS | Archivo Excel (*.xls) | mimeTypeXLSX | Archivo Excel (*.xlsx) | mimeTypeZIP | Archivo ZIP (*.zip) |
<Possible relationship>: Optional Integer constant Novedad versión 2025Possible relationship corresponding to the value of "AFRelationship" (required to use Factur-X): | | relationshipAlternative (Default value) | File specification corresponding to an alternative content representation. Example: Audio file. | relationshipData | File specification corresponding to information used to derive a visual presentation. Example: Table or graph. | relationshipSource | File specification corresponding to the original source material for the associated content. | relationshipSupplement | File specification corresponding to an additional representation of the original source or data. | relationshipUnspecified | The relationship is unknown or cannot be described using one of the other constants. |
Adding an attachment (as a buffer) to a PDF file Ocultar los detalles
iAddAttachment(<Buffer to add> , <Attachment name> [, <Description> [, <MIME type> [, <Date created> [, <Date modified> [, <Possible relationship>]]]]])
<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. Note: You must specify the extension of the attachment. <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 the MIME type to be used. More than 150 types are defined in the MIME communication standard (available on Internet). The most common values recognized by the majority of browsers are:
- "application/pdf": PDF file (*.pdf)
- "text/html": HTML page (*.htm, *.html)
- "text/plain": text file (*.txt)
- "image/gif": GIF image (*.gif)
- "image/jpeg": JPEG image (*.jpg, *.jpeg)
- "video/mpeg": MPEG video (*.mpg, *.mpeg)
- MIME type corresponding to one of the following constants:
| | mimeTypeXMLApplication | Contenido XML. | mimeTypeBinary | Contenido binario (flujo de bytes). | mimeTypeDOC | Archivo Word (*.doc) | mimeTypeDOCX | Archivo Word (*.docx) | mimeTypeGIF | Imagen GIF (*.gif) | mimeTypeHTML | Página HTML (*.htm, *.html) | mimeTypeJPEG | Imagen JPEG (*.jpg, *.jpeg) | mimeTypeJSON | Contenido JSON. | mimeTypePDF | Documento PDF (*.pdf) | mimeTypePNG | Imagen JPEG (*.png) | mimeTypeSOAP | Contenido SOAP en formato XML. | mimeTypeText | Texto (*.txt) | mimeTypeXMLText | Texto XML | mimeTypeXLS | Archivo Excel (*.xls) | mimeTypeXLSX | Archivo Excel (*.xlsx) | mimeTypeZIP | Archivo ZIP (*.zip) |
<Date created>: Optional DateTime Attachment UTC creation date. <Date modified>: Optional DateTime Attachment UTC modification date. <Possible relationship>: Optional Integer constant Novedad versión 2025Possible relationship corresponding to the value of "AFRelationship" (required to use Factur-X): | | relationshipAlternative (Default value) | File specification corresponding to an alternative content representation. Example: Audio file. | relationshipData | File specification corresponding to information used to derive a visual presentation. Example: Table or graph. | relationshipSource | File specification corresponding to the original source material for the associated content. | relationshipSupplement | File specification corresponding to an additional representation of the original source or data. | relationshipUnspecified | The relationship is unknown or cannot be described using one of the other constants. |
Observaciones Format of the PDF file iAddAttachment only allows adding files to PDF and PDF/A-3b files. Reminder: You can set the PDF file generation format with iParameterPDF. Caution: PDF/A-1b does not allow you to add attachments. iAddAttachment generates a fatal error in this case. Clasificación Lógica de negocio / UI: Código neutro
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|