Lewati ke konten utama

Tambahkan Lampiran ke PDF di dalam n8n

Tambahkan Lampiran ke PDF adalah sebuah PDF4me tindakan node di n8n yang menyematkan satu atau lebih file di dalam sebuah PDF, jadi spreadsheet, gambar, arsip, atau yang kedua PDF Lampirkan dokumen tersebut bersama dokumen utama, bukan di sampingnya. Gunakan untuk menggabungkan bukti pendukung dengan kontrak, mengirim data mentah bersama laporan, atau mengemas sertifikat dengan pengajuan kepatuhan.

Fungsi node ini

PDF4meTambahkan Lampiran ke PDF mengambil tuan rumah PDF dari Data Biner, sebuah Base64 String, atau sebuah URLlalu menyematkan setiap file yang Anda cantumkan di bawahnya Lampiran di dalamnya sebagai objek terpisah. Tidak seperti penggabungan, file terlampir mempertahankan format dan nama filenya sendiri dan dapat dibuka atau disimpan secara individual oleh penerima. Setiap lampiran dapat berasal dari sumber yang berbeda, sehingga file biner dari node sebelumnya dan file yang diambil dari node lain dapat sama. URL dapat disematkan dalam proses yang sama.

Postingan Blog Terkait
Belum ada postingan blog untuk fitur ini — akan segera hadir.
Sementara itu, jelajahi blog PDF4me untuk menemukan tutorial dan alur kerja di berbagai platform.
Kunjungi blog ini

Memverifikasi Identitas Anda API Meminta

Setiap PDF4me simpul di n8n memerlukan validitas Kredensial untuk terhubung denganBuat atau pilih salah satu yang sesuai dengan kebutuhan Anda. PDF4me API kunci agar alur kerja dapat mengautentikasi permintaan lampiran dengan aman.

Fakta Penting yang Tidak Boleh Anda Lewatkan

Menempelkan bukan menggabungkan
Berkas terlampir tetap menjadi objek terpisah yang dapat disimpan kembali oleh pembaca. Penggabungan meratakan konten halaman menjadi satu dokumen yang berkelanjutan.
Lampiran adalah koleksi yang dapat diulang.
Klik Tambahkan Lampiran sekali per berkas. Setiap entri membawa tipe konten, nama, dan sumbernya sendiri, sehingga Anda dapat mencampur biner, base64, dan URL sumber dalam satu kali proses.
Ekstensi file itu penting.
Nama Lampiran adalah informasi yang memberi tahu aplikasi pembaca cara membuka file yang diekstrak, jadi selalu sertakan ekstensi yang benar seperti .xlsx atau .zip.
Node PDF4me di n8n diatur ke Aksi Tambah Lampiran ke PDF, Tipe Data Input Data Biner, Bidang Input Biner data, Nama File Output document_with_attachments.pdf, Nama Dokumen document.pdf, dan koleksi Lampiran kosong dengan tombol Tambah Lampiran.

PDF4me Tambahkan Lampiran Ke PDF panel parameter di n8n, dengan koleksi Lampiran kosong sebelum entri pertama ditambahkan.

Menempelkan vs Menggabungkan vs Mengikat

Tiga cara untuk mengirimkan beberapa file sebagai satu kesatuan, dengan konsekuensi yang berbeda bagi penerima.

MendekatiApa yang diterima penerimaPaling cocok
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

Parameter apa yang ditambahkan untuk melampirkan sesuatu? PDF Membutuhkan?

Diperlukan: Aksi, Tipe Data Masukan, kolom yang sesuai dengan tipe masukan tersebut, Nama File Keluaran, Nama Dokumen, dan setidaknya satu entri di bawah Lampiran. Nama Keluaran Data Biner dan Profil Kustom memiliki nilai default yang berlaku.

ParameterDiperlukanApa fungsinya?Contoh
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 }

Kolom di Dalam Setiap Entri Lampiran

Setiap entri yang Anda buat dengan Tambahkan Lampiran memperlihatkan serangkaian bidangnya sendiri.

ParameterDiperlukanApa fungsinya?Contoh
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

Bidang Keluaran

Satu kali lari yang sukses akan menghasilkan satu n8n barang yang membawa PDF dengan file-file yang tertanam di dalamnya.

BidangJenisIsi di dalamnya
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.

Bagaimana Cara Mengatur Tambah Lampiran ke PDF di dalam n8n?

  1. Menambahkan PDF4me untuk Anda n8n alur kerja dan pilih Tambahkan Lampiran Ke PDF tindakan.
  2. Di dalam Kredensial untuk terhubung dengan, pilih milikmu PDF4me kredensial atau klik Buat Kredensial Baru dan tempelkan milik Anda API kunci.
  3. Mengatur Tipe Data Masukan ke Data Biner (bawaan), Base64 String, atau URL dan menyediakan host yang sesuai. PDF bidang.
  4. Di bawah Lampiran, klik Tambahkan Lampiran sekali untuk setiap file, lalu atur Jenis Konten Lampiran, Nama Lampiran, dan bidang sumber yang cocok.
  5. Mengatur Nama File Output (harus diakhiri dengan) .pdf) Dan Nama Dokumen untuk file sumber.
  6. Eksekusi node dan arahkan nilai yang dikembalikan. PDF selanjutnya, memeriksa attachmentCount dibandingkan dengan jumlah file yang Anda harapkan.

Pengaturan Umum

Contoh Alur KerjaCommon n8n workflow patterns using Add Attachment to PDF.
Faktur beserta bukti pembayaran
  1. Faktur PDF dihasilkan dari data penagihan.
  2. Tambahkan Lampiran ke PDF menyertakan tanda terima yang sesuai dan catatan persetujuan.
  3. Satu berkas dikirim ke bagian hutang usaha beserta seluruh jejak bukti di dalamnya.
Laporan beserta data sumbernya
  1. Laporan analitik terjadwal ditampilkan kepada PDF.
  2. Tambahkan Lampiran ke PDF menyematkan hal yang mendasarinya CSV Ekspor sebagai lampiran bernama.
  3. Pembaca mendapatkan narasi dan dapat mengambil angka mentah ketika mereka ingin memverifikasinya.
Kontrak beserta lampirannya
  1. Kontrak dibuat berdasarkan templat setelah diminta tanda tangan.
  2. Tambahkan Lampiran ke PDF menyematkan sertifikat dan jadwal yang diambil dari URLs.
  3. Pihak lawan menerima satu dokumen lengkap untuk ditandatangani.
Paket kepatuhan untuk audit
  1. Node Loop Over Items mengumpulkan berkas bukti untuk periode pengarsipan tertentu.
  2. Tambahkan Lampiran ke PDF menyematkan masing-masing ke dalam dokumen pengarsipan sampul.
  3. Bundel tersebut telah diarsipkan, dan Ekstrak Lampiran Dari PDF Dapat dibuka nanti jika diminta.

Tips Praktis

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.

Lembar Panduan Singkat

BidangNilai
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

Pertanyaan Umum

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.

Tindakan Terkait

Tugas yang Sama di Platform Lain

Dapatkan Bantuan