Saltar al contenido principal

Agregar archivo adjunto a PDF en n8n

Agregar archivo adjunto a PDF es un PDF4me acción del nodo en n8n que incrusta uno o más archivos dentro de un PDF, por lo que una hoja de cálculo, una imagen, un archivo o un segundo PDF Se transporta junto con el documento, no al lado. Úselo para adjuntar pruebas a un contrato, enviar datos sin procesar junto a un informe o incluir certificados en un documento de cumplimiento.

Lo que hace este nodo

PDF4me: Agregar archivo adjunto a PDF toma un anfitrión PDF a partir de datos binarios, un Base64 String, o un URL, luego incrusta cada archivo que usted enumera en Archivos adjuntos dentro de él como un objeto separado. A diferencia de la fusión, los archivos adjuntos mantienen su propio formato y nombre de archivo y pueden ser abiertos o guardados individualmente por el destinatario. Cada archivo adjunto puede provenir de una fuente diferente, por lo que un archivo binario de un nodo anterior y un archivo obtenido de un URL se pueden integrar en la misma ejecución.

Entradas de blog relacionadas
Aún no hay ninguna entrada de blog sobre esta función; estará disponible próximamente.
Mientras tanto, echa un vistazo al blog de PDF4me para encontrar tutoriales y flujos de trabajo para todas las plataformas.
Visita el blog

Autenticando su API Pedido

Cada PDF4me nodo en n8n requiere un válido Credencial para conectarse con. Crea o selecciona uno que contenga tu PDF4me API clave para que el flujo de trabajo pueda autenticar las solicitudes de archivos adjuntos de forma segura.

Datos importantes que no debes perderte

Adjuntar no es fusionar
Un archivo adjunto permanece como un objeto independiente que el lector puede guardar. En cambio, la fusión unifica el contenido de la página en un único documento continuo.
Los archivos adjuntos son una colección repetible.
Haga clic Agregar archivo adjunto una vez por archivo. Cada entrada tiene su propio tipo de contenido, nombre y origen, por lo que puede mezclar binario, base64 y URL fuentes en una sola ejecución.
La extensión del archivo es importante.
El nombre del archivo adjunto es lo que le indica a una aplicación lectora cómo abrir el archivo extraído, por lo que siempre debe incluir la extensión correcta, como .xlsx o .zip.
El nodo PDF4me en n8n está configurado con la acción Agregar archivo adjunto a PDF, el tipo de datos de entrada Datos binarios, el campo de entrada Datos binarios, el nombre del archivo de salida document_with_attachments.pdf, el nombre del documento document.pdf y una colección de archivos adjuntos vacía con un botón Agregar archivo adjunto.

PDF4me Agregar archivo adjunto a PDF panel de parámetros en n8n, con la colección Attachments vacía antes de que se agregue la primera entrada.

Adjuntar vs. Fusionar vs. Comprimir

Tres maneras de entregar varios archivos como si fueran uno solo, con diferentes consecuencias para el destinatario.

AcercarseLo que recibe el destinatarioMejor ajuste
Add Attachment to PDFOne PDF that opens normally, with the extra files available in the attachments panelSupporting material that must stay in its original format, such as a spreadsheet or an archive
Merge PDFsOne continuous document where all pages read in sequenceContent that genuinely belongs together as a single readable document
Zip the files togetherAn archive that must be unpacked before anything can be readBulk transfer where nothing needs to be readable without extracting first

¿Qué parámetros agrega adjuntos? PDF ¿Necesidad?

Requerido: Acción, tipo de datos de entrada, el campo que coincide con ese tipo de entrada, nombre del archivo de salida, nombre del documento y al menos una entrada en Archivos adjuntos. El nombre de salida de datos binarios y los perfiles personalizados tienen valores predeterminados que funcionan.

ParámetroRequeridoLo que haceEjemplo
ActionRequiredSelects the PDF4me node action to run. Choose Add Attachment To PDF.Add Attachment To PDF
Input Data TypeRequiredFormat of the host PDF input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the host PDF. Required when Input Data Type is Binary Data. Defaults to data.data
Base64 Document ContentConditionalBase64-encoded content of the host PDF. Required when Input Data Type is Base64 String.JVBERi0xLjQK...
File URLConditionalPublicly reachable HTTPS URL to the host PDF. Required when Input Data Type is URL.https://example.com/contract.pdf
Output File NameRequiredFilename for the PDF returned with the files embedded. Include the .pdf extension.document_with_attachments.pdf
Document NameRequiredFilename of the source PDF, used for reference and tracking on the request.document.pdf
AttachmentsRequiredCollection of files to embed. Click Add Attachment once per file, then fill in the per-attachment fields listed below.One entry per embedded file
Binary Data Output NameOptionalName of the binary property the output item exposes. Defaults to data.data
Custom ProfilesOptionalAdvanced Options field for extra processing settings, supplied in a JSON-like format. Leave blank unless you have a specific profile to apply.{ "preserveMetadata": true }

Campos dentro de cada entrada de archivo adjunto

Cada entrada que crees con Agregar archivo adjunto expone su propio conjunto de campos.

ParámetroRequeridoLo que haceEjemplo
Attachment Content TypeRequiredHow this particular attachment is supplied. Choose Binary Data, Base64 Content, or File URL. Each entry can differ.Binary Data
Attachment NameRequiredFilename the embedded file will carry inside the PDF. Include the correct extension so readers can open it after extraction.supporting_data.xlsx
Binary Field NameConditionalName of the binary property holding this attachment. Required when Attachment Content Type is Binary Data.data
Base64 ContentConditionalBase64-encoded content of this attachment. Required when Attachment Content Type is Base64 Content.SGVsbG8gV29ybGQ=
File URLConditionalPublicly reachable HTTPS URL to this attachment. Required when Attachment Content Type is File URL.https://example.com/certificate.pdf

Campos de salida

Una carrera exitosa devuelve uno n8n artículo que lleva el PDF con sus archivos incrustados.

CampoTipoLo que contiene
Binary (data)BinaryThe PDF with all listed files embedded, under Binary Data Output Name (default data).
fileNameStringGenerated filename, matching Output File Name.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the returned PDF in bytes, including the embedded files.
attachmentCountNumberNumber of attachments successfully embedded. Compare it against your expected count to catch a silently skipped file.
successBooleanTrue when the attachment operation completed, false on failure. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

¿Cómo configuro Agregar archivo adjunto? PDF en n8n¿

  1. Agregar PDF4me a tu n8n flujo de trabajo y elegir el Agregar archivo adjunto a PDF acción.
  2. En Credencial para conectarse con, seleccione su PDF4me credenciales o haga clic Crear nueva credencial y pega tu API llave.
  3. Colocar Tipo de datos de entrada a Datos binarios (por defecto), Base64 String, o URL y proporcionar el anfitrión correspondiente PDF campo.
  4. Bajo Archivos adjuntos, haga clic Agregar archivo adjunto una vez por cada archivo, luego establezca su Tipo de contenido adjunto, Nombre del archivo adjuntoy campo de origen coincidente.
  5. Colocar Nombre del archivo de salida (debe terminar en .pdf) y Nombre del documento para el archivo fuente.
  6. Ejecuta el nodo y enruta el resultado. PDF adelante, comprobando attachmentCount en comparación con la cantidad de archivos que esperabas.

Configuraciones típicas

Ejemplos de flujo de trabajoCommon n8n workflow patterns using Add Attachment to PDF.
Factura con recibos justificativos
  1. Una factura PDF Se genera a partir de los datos de facturación.
  2. Agregar archivo adjunto a PDF Incluye los recibos correspondientes y el registro de aprobación.
  3. Un archivo se envía al departamento de cuentas por pagar con todo el rastro de evidencia en su interior.
Informe con sus datos de origen
  1. Se genera un informe analítico programado para PDF.
  2. Agregar archivo adjunto a PDF incrusta el subyacente CSV exportar como archivo adjunto con nombre.
  3. Los lectores comprenden la información y pueden consultar las cifras brutas cuando quieran verificarlas.
Contrato con anexos
  1. Se elabora un contrato a partir de una plantilla previa solicitud de firma.
  2. Agregar archivo adjunto a PDF incrusta certificados y horarios extraídos de URLs.
  3. La contraparte recibe un único documento autónomo para firmar.
Paquete de cumplimiento para auditoría
  1. Un nodo Loop Over Items recopila archivos de evidencia para un período de presentación de documentos.
  2. Agregar archivo adjunto a PDF inserta cada uno en el documento de presentación de la portada.
  3. El paquete está archivado y Extraer archivo adjunto de PDF Podemos desempaquetarlo más tarde si lo solicitas.

Consejos prácticos

Always include the file extension in Attachment Name
The extension is what tells a reader application how to open the extracted file. A name without one leaves the recipient guessing.
Check attachmentCount against what you sent
Comparing the returned count to the number of entries you configured is the quickest way to catch a file that failed to embed.
Mention the attachments in the document body
Not every viewer surfaces the attachments panel, so a line of visible text telling the reader that supporting files are embedded prevents them being missed.
Mix sources freely within one run
Each entry has its own content type, so a binary file from an earlier node and a URL-hosted certificate can be embedded together.
Attach when format must survive, merge when it should not
A spreadsheet stays usable as a spreadsheet only if it is attached. Merging would flatten it into page content.
Watch the total size on outbound email
Embedded files count toward the PDF size, so a bundle of large attachments can push the document past a mail gateway limit.

Hoja de trucos

CampoValor
ActionAdd Attachment To PDF
Input Data TypeBinary Data
Input Binary Fielddata
Output File Namedocument_with_attachments.pdf
Document Namedocument.pdf
AttachmentsOne entry per file, added with Add Attachment
Attachment Content TypeBinary Data
Attachment Namesupporting_data.xlsx
Binary Data Output Namedata
CredentialsPDF4me API credential

Preguntas frecuentes

What is the difference between attaching a file to a PDF and merging PDFs?+
Merging combines page content into one continuous document, so the source files stop existing as separate items. Attaching embeds a file inside the PDF as a discrete object that a reader can open or save back out on its own, keeping the original format intact. Use merge when everything should read as one document, and attach when a spreadsheet, archive, or certificate needs to stay a separate file.
Can I attach more than one file in a single run?+
Yes. Attachments is a collection, so click Add Attachment once per file you want to embed. Each entry gets its own Attachment Content Type, Attachment Name, and source field, which means you can mix a binary file from a previous node with another pulled from a URL in the same request.
What file types can be attached to a PDF?+
Attachments are stored as embedded file objects rather than being converted, a mechanism defined in the ISO 32000 PDF specification, so common document, image, spreadsheet, presentation, archive, and data formats can all be carried. What matters is that Attachment Name includes the correct extension, because that is what tells a reader application how to open the file once extracted.
Will everyone be able to see the attachments?+
Embedded files are exposed through the attachments or bookmarks panel of a full PDF reader. Lightweight in-browser or mobile viewers sometimes do not surface that panel, so if attachments are essential to the recipient, mention in the document body that supporting files are embedded.
How do I get the attachments back out of a PDF later?+
Use the Extract Attachment From PDF action, which is the inverse operation. A common pattern is one n8n workflow that bundles supporting files into an outgoing PDF, and a second that extracts them again when the document comes back.

Acciones relacionadas

La misma tarea en otras plataformas

Obtén ayuda