AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de impresión
  • Format of the PDF file
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
Ejemplo
// 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 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": 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:
    mimeTypeXMLApplicationContenido XML.
    mimeTypeBinaryContenido binario (flujo de bytes).
    mimeTypeDOCArchivo Word (*.doc)
    mimeTypeDOCXArchivo Word (*.docx)
    mimeTypeGIFImagen GIF (*.gif)
    mimeTypeHTMLPágina HTML (*.htm, *.html)
    mimeTypeJPEGImagen JPEG (*.jpg, *.jpeg)
    mimeTypeJSONContenido JSON.
    mimeTypePDFDocumento PDF (*.pdf)
    mimeTypePNGImagen JPEG (*.png)
    mimeTypeSOAPContenido SOAP en formato XML.
    mimeTypeTextTexto (*.txt)
    mimeTypeXMLTextTexto XML
    mimeTypeXLSArchivo Excel (*.xls)
    mimeTypeXLSXArchivo Excel (*.xlsx)
    mimeTypeZIPArchivo ZIP (*.zip)
<Possible relationship>: Optional Integer constant
Novedad versión 2025
Possible 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.
relationshipDataFile specification corresponding to information used to derive a visual presentation. Example: Table or graph.
relationshipSourceFile specification corresponding to the original source material for the associated content.
relationshipSupplementFile specification corresponding to an additional representation of the original source or data.
relationshipUnspecifiedThe relationship is unknown or cannot be described using one of the other constants.

Android Attention This setting is only available for Android applications from version 2025 Update 1.

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 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": 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:
    mimeTypeXMLApplicationContenido XML.
    mimeTypeBinaryContenido binario (flujo de bytes).
    mimeTypeDOCArchivo Word (*.doc)
    mimeTypeDOCXArchivo Word (*.docx)
    mimeTypeGIFImagen GIF (*.gif)
    mimeTypeHTMLPágina HTML (*.htm, *.html)
    mimeTypeJPEGImagen JPEG (*.jpg, *.jpeg)
    mimeTypeJSONContenido JSON.
    mimeTypePDFDocumento PDF (*.pdf)
    mimeTypePNGImagen JPEG (*.png)
    mimeTypeSOAPContenido SOAP en formato XML.
    mimeTypeTextTexto (*.txt)
    mimeTypeXMLTextTexto XML
    mimeTypeXLSArchivo Excel (*.xls)
    mimeTypeXLSXArchivo Excel (*.xlsx)
    mimeTypeZIPArchivo 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 2025
Possible 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.
relationshipDataFile specification corresponding to information used to derive a visual presentation. Example: Table or graph.
relationshipSourceFile specification corresponding to the original source material for the associated content.
relationshipSupplementFile specification corresponding to an additional representation of the original source or data.
relationshipUnspecifiedThe relationship is unknown or cannot be described using one of the other constants.

Android Attention This setting is only available for Android applications from version 2025 Update 1.
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
Componente: wd300prn.dll
Versión mínima requerida
  • Versión 24
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 01/02/2025

Señalar un error o enviar una sugerencia | Ayuda local