Lewati ke konten utama

Ganti Teks dengan Gambar di n8n

Ganti Teks dengan Gambar adalah sebuah n8n simpul oleh PDF4me yang menemukan placeholder teks yang tepat di dalam sebuah PDF dan menggantinya dengan logo, tanda tangan, atau gambar produk dengan dimensi yang sesuai. Gunakan untuk branding template, penyisipan tanda tangan, atau personalisasi visual otomatis tanpa perlu mengedit secara manual. PDF.

Fungsi node ini

PDF4me: Ganti Teks dengan Gambar memindai PDF Fungsi ini menerima string teks yang tepat dan mengganti setiap kemunculan yang cocok dengan gambar, yang diskalakan sesuai tinggi dan lebar yang Anda pilih, pada halaman yang Anda targetkan. Menerima teks sumber dan teks yang sesuai. PDF dan gambar pengganti melalui Data Biner, Base64 Tali, atau URL, secara independen. Ideal untuk menyisipkan logo, tanda tangan, stempel, atau foto produk ke dalam templat. PDFs.

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 penggantian secara aman.

Fakta Penting yang Tidak Boleh Anda Lewatkan

Teks yang akan diganti harus sama persis.
PDF4me Melakukan pencocokan teks yang tepat, termasuk spasi, tanda baca, dan kapitalisasi. Sebuah placeholder seperti [LOGO_DI_SINI] Hanya mencocokkan string persis tersebut, bukan sebagian atau versi yang berbeda huruf besar/kecil.
PDF dan input gambar bersifat independen.
PDF Tipe Data Masukan dan Tipe Data Masukan Gambar diatur secara terpisah, yang satu dapat berasal dari Data Biner sedangkan yang lainnya berasal dari... URL, berguna saat templat PDF dan logo tersebut ada di sistem yang berbeda.
Ini adalah PDF tindakan, bukan varian kata
Node "Ganti Teks dengan Gambar" terpisah dalam Dokumen Word menangani file .docx dengan placeholder khusus Word. Gunakan node ini hanya jika dokumen sumber sudah berupa file .docx. PDF.
Node n8n Ganti Teks dengan Gambar dikonfigurasi dengan Aksi Ganti Teks dengan Gambar, Tipe Data Masukan PDF Data Biner, Bidang Biner PDF data, Tipe Data Masukan Gambar Data Biner, Bidang Biner Gambar data, Teks yang Akan Diganti, Urutan Halaman semua, Tinggi Gambar 50, Lebar Gambar

PDF4me Panel parameter node Ganti Teks dengan Gambar di n8n

Parameter apa saja yang dibutuhkan oleh fungsi Ganti Teks dengan Gambar?

Diperlukan: PDF Tipe Data Masukan, Tipe Data Masukan Gambar, Teks yang Akan Diganti, Tinggi Gambar, Lebar Gambar, dan Nama File Keluaran. Kolom bersyarat hanya muncul ketika Tipe Data Masukan induknya dipilih. Urutan Halaman, Async, dan Nama Output Data Biner bersifat opsional dengan nilai default yang sudah ada.

ParameterDiperlukanApa fungsinya?Contoh
PDF Input Data TypeRequiredFormat of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
PDF Binary FieldConditionalName of the binary property on the incoming n8n item that holds the source PDF. Required when PDF Input Data Type is Binary Data.data
Base64 PDF ContentConditionalBase64-encoded source PDF content. Required when PDF Input Data Type is Base64 String.JVBERi0xLjQK...
PDF URLConditionalPublicly reachable HTTPS URL to the source PDF. Required when PDF Input Data Type is URL.https://example.com/sample.pdf
Image Input Data TypeRequiredFormat of the replacement image input. Choose Binary Data, Base64 String, or URL, independent of the PDF input type.Binary Data
Image Binary FieldConditionalName of the binary property on the incoming n8n item that holds the replacement image. Required when Image Input Data Type is Binary Data.data
Base64 Image ContentConditionalBase64-encoded replacement image content. Required when Image Input Data Type is Base64 String./9j/4AAQSkZJRgAB...
Image URLConditionalPublicly reachable HTTPS URL to the replacement image. Required when Image Input Data Type is URL.https://example.com/logo.png
Text to ReplaceRequiredThe exact text string to find and replace with the image, matched precisely including case and punctuation.[LOGO_HERE]
Page SequenceOptionalPages to search for the placeholder. Use all, specific pages (1,3,5), or a range (1-5). Default all.all
Image HeightRequiredHeight in pixels to scale the replacement image to, maintaining aspect ratio.50
Image WidthRequiredWidth in pixels to scale the replacement image to, maintaining aspect ratio.100
Output File NameRequiredFilename for the resulting PDF, must include the .pdf extension.replace_text_with_image.pdf
AsyncOptionalEnables background processing for large PDFs. Default false.false
Binary Data Output NameOptionalName of the binary property the output item exposes. Default is data.data

Bidang Keluaran

Satu kali lari yang sukses akan menghasilkan satu n8n barang yang dibawa JSON metadata dan biner yang diperbarui PDF.

BidangJenisIsi di dalamnya
successBooleanTrue when the replacement succeeded. Use to route error-handling branches.
messageStringHuman-readable status message for the replacement result.
fileNameStringGenerated filename, matching Output File Name.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the resulting PDF in bytes.
pagesProcessedNumberNumber of pages searched for the placeholder text.
Binary (data)BinaryThe updated PDF under Binary Data Output Name (default data). Pass into Write Binary File, Email, or any cloud-storage upload.

Bagaimana Cara Mengatur Penggantian Teks dengan Gambar di n8n?

  1. Menambahkan PDF4me untuk Anda n8n alur kerja dan pilih Ganti Teks dengan Gambar 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 PDF Tipe Data Masukan dan menyediakan sumbernya PDF melalui PDF Bidang Biner, Base64 PDF Isi, atau PDF URL.
  4. Mengatur Tipe Data Input Gambar dan menyediakan gambar pengganti melalui Bidang Biner Gambar, Base64 Konten Gambar, atau Gambar URL.
  5. Memasuki Teks yang Akan Diganti persis seperti yang terlihat di PDF, dan menetapkan Urutan Halaman Jika Anda perlu menargetkan halaman tertentu.
  6. Mengatur Tinggi Gambar Dan Lebar Gambar untuk mengubah skala gambar pengganti, dan mengatur Nama File Output.
  7. Memungkinkan Async untuk ukuran besar PDFs Jika diperlukan, jalankan node dan arahkan pembaruan tersebut. PDF ke langkah selanjutnya.

Pengaturan Umum

Contoh Alur KerjaCommon n8n workflow patterns using Replace Text With Image.
Penyisipan logo klien dalam templat proposal.
  1. Webhook CRM akan aktif ketika proposal baru dibuat untuk klien.
  2. PDF4me Fungsi Ganti Teks dengan Gambar dijalankan dengan Teks yang Akan Diganti diatur ke [LOGO_KLIEN] dan Tipe Data Input Gambar URL menunjuk ke logo klien.
  3. Proposal yang telah diberi merek dikirim melalui email kepada perwakilan penjualan untuk tinjauan akhir.
Cap tanda tangan pada kontrak yang telah dibuat
  1. Kontrak dibuat melalui PDF4me Buat Dokumen dengan [TANDA TANGAN] placeholder.
  2. PDF4me Fungsi Ganti Teks dengan Gambar berjalan dengan gambar tanda tangan penandatangan dan Urutan Halaman hanya menargetkan halaman terakhir.
  3. Kontrak yang tampak sudah ditandatangani tersebut diarsipkan ke SharePoint.
Penggantian gambar produk dalam katalog PDF
  1. Node Loop Over Items mengiterasi catatan produk dari basis data inventaris.
  2. PDF4me Fitur Ganti Teks dengan Gambar berjalan per item, mengganti satu teks dengan gambar. [GAMBAR PRODUK] Placeholder dengan foto setiap produk dari penyimpanan cloud.
  3. Setiap halaman katalog yang dipersonalisasi digabungkan di tahap selanjutnya menjadi satu halaman yang dapat didistribusikan. PDF.
Grafik stempel persetujuan setelah penandatanganan.
  1. Webhook persetujuan akan aktif setelah seorang manajer menandai dokumen sebagai disetujui dalam alat internal.
  2. PDF4me Fitur Ganti Teks dengan Gambar berjalan dengan [CAP PERSETUJUAN] Placeholder diganti dengan grafik persetujuan.
  3. Yang sudah final PDF diarsipkan dengan tanggal persetujuan dalam nama file.

Tips Praktis

Use a distinctive placeholder string
A unique token like [CLIENT_LOGO] avoids accidentally matching unrelated text elsewhere in the document.
Match Image Height/Width to the source aspect ratio
Mismatched dimensions can stretch or squash the inserted image; check the source image proportions first.
Narrow Page Sequence when possible
Targeting only the pages that contain the placeholder is faster and avoids unintended matches on other pages.
PDF and image sources can differ
Pull the template PDF from Binary Data while sourcing the logo from a URL, or any other combination that fits your workflow.
Enable Async for large PDFs
Large documents benefit from asynchronous processing so the workflow execution does not time out.
Use the Word variant for .docx files
This node processes PDFs; for Word documents use the separate Replace Text With Image in Word Document node.

Lembar Panduan Singkat

BidangNilai
ActionReplace Text With Image
PDF Input Data TypeBinary Data
PDF Binary Fielddata
Image Input Data TypeBinary Data
Image Binary Fielddata
Text to Replace[LOGO_HERE]
Page Sequenceall
Image Height50
Image Width100
Output File Namereplace_text_with_image.pdf
CredentialsPDF4me API credential

Pertanyaan Umum

Does Text to Replace need to match exactly?+
Yes. PDF4me performs precise text matching, so Text to Replace must match the placeholder in the PDF exactly, including spaces, punctuation, and capitalization, similar to the exact-match requirements described in community discussions on replacing content inside a PDF.
Can I replace text on only some pages?+
Yes. Page Sequence accepts all, specific page numbers such as 1,3,5, or ranges such as 1-5, so you can target only the pages that contain the placeholder.
What image formats can replace the text?+
JPG, PNG, GIF, and BMP. Supply the image via Image Binary Field, Base64 Image Content, or Image URL depending on Image Input Data Type.
Does the image keep its aspect ratio?+
PDF4me scales the image to the Image Height and Image Width you specify while maintaining aspect ratio, so choose dimensions that match the source image's proportions, the same general scaling consideration covered in Adobe's guidance on placing graphics onto a PDF page.
Is this the same as the Word variant of this action?+
No. This action operates on PDF documents. A separate Replace Text With Image in Word Document node exists in n8n for .docx files, using Word-specific merge-field style placeholders instead of exact-text matching.

Tindakan Terkait

Tugas yang Sama di Platform Lain

Dapatkan Bantuan