Passa al contenuto principale

Aggiungi allegato a PDF In n8n

Aggiungi allegato a PDF è un PDF4me azione del nodo in n8n che incorpora uno o più file all'interno di un PDF, quindi un foglio di calcolo, un'immagine, un archivio o un secondo PDF Viaggia insieme al documento anziché allegarlo. Utilizzalo per allegare prove a supporto a un contratto, inviare dati grezzi insieme a un report o includere certificati in un fascicolo di conformità.

Cosa fa questo nodo

PDF4me: Aggiungi allegato a PDF prende un ospite PDF da Binary Data, un Base64 String, o un URL, quindi incorpora ogni file che elenchi sotto Allegati al suo interno come oggetto separato. A differenza della fusione, i file allegati mantengono il proprio formato e nome file e possono essere aperti o salvati singolarmente dal destinatario. Ogni allegato può provenire da una fonte diversa, quindi un file binario da un nodo precedente e un file recuperato da un URL possono essere incorporati nella stessa esecuzione.

Articoli correlati del blog
Non ci sono ancora post sul blog dedicati a questa funzionalità — in arrivo a breve.
Nel frattempo, dai un'occhiata al blog di PDF4me per trovare tutorial e procedure operative su tutte le piattaforme.
Visita il blog

Autenticazione del tuo API Richiesta

Ogni PDF4me nodo in n8n richiede un valido Credenziali per connettersi con. Crea o selezionane uno che contenga il tuo PDF4me API chiave affinché il flusso di lavoro possa autenticare in modo sicuro le richieste di allegati.

Informazioni importanti da non perdere

L'allegato non è un'unione
Un file allegato rimane un oggetto separato che il lettore può salvare. L'unione, invece, appiattisce il contenuto della pagina in un unico documento continuo.
Gli allegati sono una raccolta ripetibile
Fare clic Aggiungi allegato una volta per file. Ogni voce ha il proprio tipo di contenuto, nome e sorgente, quindi puoi mescolare binario, base64 e URL fonti in un'unica esecuzione.
L'estensione del file è importante
Il nome dell'allegato indica all'applicazione di lettura come aprire il file estratto, quindi è fondamentale includere sempre l'estensione corretta, come .xlsx o .zip.
Il nodo PDF4me in n8n è impostato su Azione Aggiungi allegato al PDF, Tipo di dati di input Dati binari, Campo binario di input dati, Nome file di output document_with_attachments.pdf, Nome documento document.pdf e una raccolta Allegati vuota con un pulsante Aggiungi allegato

PDF4me Aggiungi allegato a PDF pannello dei parametri in n8n, con la raccolta Allegati vuota prima che venga aggiunta la prima voce

Collegamento vs Unione vs Compressione

Tre modi per inviare più file come un unico documento, con conseguenze diverse per il destinatario.

ApproccioCiò che riceve il destinatarioMigliore vestibilità
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

Quali parametri aggiunge l'allegato? PDF Bisogno?

Necessario: Azione, Tipo di dati di input, il campo corrispondente a quel tipo di input, Nome del file di output, Nome del documento e almeno una voce in Allegati. Nome output dati binari e Profili personalizzati hanno valori predefiniti funzionanti.

ParametroNecessarioCosa faEsempio
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 }

Campi all'interno di ciascuna voce di allegato

Ogni voce che crei con Aggiungi allegato espone il proprio insieme di campi.

ParametroNecessarioCosa faEsempio
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

Campi di output

Una corsa di successo restituisce uno n8n oggetto che trasporta il PDF con i relativi file incorporati.

CampoTipoCosa 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.

Come si imposta Aggiungi allegato a PDF In n8n?

  1. Aggiungere PDF4me al tuo n8n flusso di lavoro e scegliere il Aggiungi allegato a PDF azione.
  2. In Credenziali per connettersi con, seleziona il tuo PDF4me credenziali o clicca Crea nuove credenziali e incolla il tuo API chiave.
  3. Impostato Tipo di dati di input A Dati binari (predefinito), Base64 String, O URL e fornire l'host corrispondente PDF campo.
  4. Sotto Allegati, clicca Aggiungi allegato una volta per ogni file, quindi imposta il suo Tipo di contenuto dell'allegato, Nome dell'allegatoe corrispondente campo sorgente.
  5. Impostato Nome del file di output (deve terminare in .pdf) E Nome reale per il file sorgente.
  6. Esegui il nodo e instrada il risultato PDF avanti, controllando attachmentCount rispetto al numero di file che ti aspettavi.

Configurazioni tipiche

Esempi di flusso di lavoroCommon n8n workflow patterns using Add Attachment to PDF.
Fattura con ricevute giustificative
  1. Una fattura PDF viene generato dai dati di fatturazione.
  2. Aggiungi allegato a PDF incorpora le ricevute corrispondenti e il registro di approvazione.
  3. Un fascicolo viene inviato all'ufficio contabilità fornitori con tutta la documentazione probatoria al suo interno.
Rapporto con i relativi dati di origine
  1. Viene generato un report analitico programmato PDF.
  2. Aggiungi allegato a PDF incorpora il sottostante CSV Esporta come allegato denominato.
  3. I lettori comprendono la narrazione e possono estrarre i dati grezzi quando desiderano verificarli.
Contratto con allegati
  1. Il contratto viene generato a partire da un modello su richiesta di firma.
  2. Aggiungi allegato a PDF incorpora certificati e programmi estratti da URLs.
  3. La controparte riceve un unico documento autonomo da firmare.
Pacchetto di conformità per audit
  1. Un nodo Loop Over Items raccoglie i file di prova relativi a un periodo di archiviazione.
  2. Aggiungi allegato a PDF incorpora ciascuno di essi nel documento di presentazione della copertina.
  3. Il pacchetto è archiviato ed estrai l'allegato da PDF Possiamo disimballarlo in seguito su richiesta.

Consigli pratici

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.

Foglio riassuntivo

CampoValore
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

Domande frequenti

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.

Azioni correlate

Stessa attività su altre piattaforme

Richiedi assistenza