メインコンテンツへスキップ

テキストを画像に置き換える n8n

テキストを画像に置き換える は n8n ノードによる PDF4me テキストプレースホルダーを正確な位置で見つける PDF そして、それを同じ寸法のロゴ、署名、または製品画像と置き換えます。テンプレートのブランディング、署名の挿入、または手動で編集することなく自動的なビジュアルのパーソナライズに使用します。 PDF。

このノードの機能

PDF4me: テキストを画像に置き換える スキャン PDF 正確なテキスト文字列に対して、対象ページ上の一致する箇所すべてを、指定した高さと幅に拡大縮小した画像に置き換えます。ソースコードとテキスト文字列の両方を受け入れます。 PDF バイナリデータによる置換イメージ、 Base64 文字列、または URL独立して。テンプレートにロゴ、署名、スタンプ、または製品写真を挿入するのに最適です。 PDFs。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me ノード n8n 有効な 接続するための認証情報. 作成または選択して、 PDF4me API ワークフローが交換リクエストを安全に認証できるようにするためのキー。

見逃してはならない重要な事実​

置換するテキストは完全に一致する必要があります
PDF4me スペース、句読点、大文字小文字を含む正確なテキストマッチングを実行します。 [ここにロゴを挿入] 完全に一致する文字列のみに一致し、部分一致や大文字小文字の違いのあるバージョンには一致しません。
PDF 画像入力は独立している
PDF 入力データタイプと画像入力データタイプは別々に設定され、一方はバイナリデータから、もう一方は URLテンプレートが PDF そして、ロゴは異なるシステムで存在している。
これは PDF アクション、Word バリアントではない
Word 文書内のテキストを画像に置き換える別のノードは、Word 固有のプレースホルダーを含む .docx ファイルを処理します。このノードは、ソース ドキュメントが既に PDF。
n8nノードは、アクション「テキストを画像に置き換える」、PDF入力データタイプ「バイナリデータ」、PDFバイナリフィールドデータ、画像入力データタイプ「バイナリデータ」、画像バイナリフィールドデータ、置換するテキスト、ページシーケンス「すべて」、画像の高さ50、画像の幅で構成されています。

PDF4me 「テキストを画像に置き換える」ノードパラメータパネルで n8n

テキストを画像に置き換えるには、どのようなパラメータが必要ですか?​

必須: PDF 入力データタイプ、画像入力データタイプ、置換するテキスト、画像の高さ、画像の幅、および出力ファイル名。条件付きフィールドは、親の入力データタイプが選択されている場合にのみ表示されます。ページシーケンス、 Async、およびバイナリデータ出力名はオプションであり、デフォルト値が使用されています。

パラメータ必須その機能例
PDF Input Data TypeRequiredChoose how to provide the PDF file. Options: Binary Data, Base64 String, URL. Default is `Binary Data`.Binary Data
PDF Binary FieldConditionalName of the binary property that contains the PDF file. Shown when PDF Input Data Type is Binary Data. Default is `data`.data
PDF Base64 ContentConditionalBase64 encoded PDF content. Shown when PDF Input Data Type is Base64 String.JVBERi0xLjQK...
PDF URLConditionalURL to the PDF file. Shown when PDF Input Data Type is URL.https://example.com/sample.pdf
Image Input Data TypeRequiredChoose how to provide the replacement image. Options: Binary Data, Base64 String, URL. Default is `Binary Data`.Binary Data
Image Binary FieldConditionalName of the binary property that contains the image file. Shown when Image Input Data Type is Binary Data. Default is `data`.data
Image Base64 ContentConditionalBase64 encoded image content. Shown when Image Input Data Type is Base64 String./9j/4AAQSkZJRgAB...
Image URLConditionalURL to the image file. Shown when Image Input Data Type is URL.https://example.com/logo.png
Text to ReplaceRequiredText in the PDF to be replaced with the image.[LOGO_HERE]
Page SequenceOptionalPages to apply the replacement (e.g., "all", "1", "1,3,5", "2-5"). Default is `all`.all
Image HeightOptionalHeight of the replacement image (integer). Default is `50`.50
Image WidthOptionalWidth of the replacement image (integer). Default is `100`.100
Output File NameOptionalName for the output PDF file. Default is `replace_text_with_image.pdf`.replace_text_with_image.pdf
AsyncOptionalNot used: the node always sends the request to PDF4me as asynchronous (IsAsync true), whatever this is set to. Default is `Yes`.Yes
Binary Data Output NameOptionalCustom name for the binary data in n8n output. Default is `data`.data

出力フィールド​

成功したランは1 n8n 持ち運んでいるアイテム JSON メタデータと更新されたバイナリ PDF。

出力​

ノードが返すフィールド。

分野タイプ内容物
successBooleanTrue when the operation succeeded.
messageStringStatus message, `Text replaced with image successfully`.
fileNameStringFile name of the resulting file.
mimeTypeStringAlways `application/pdf`.
fileSizeNumberSize of the resulting file in bytes.
dataBinaryThe PDF with the text replaced by the image.

テキストを画像に置き換える設定方法 n8n?​

  1. 追加 PDF4me あなたの n8n ワークフローを選択し、 テキストを画像に置き換える アクション。
  2. で 接続するための認証情報選択してください PDF4me 認証情報またはクリック 新しい認証情報を作成する そしてあなたの API 鍵。
  3. セット PDF 入力データタイプ そして供給源を提供する PDF 経由 PDF バイナリフィールド、 Base64 PDF コンテンツ、 または PDF URL。
  4. セット 画像入力データタイプ そして、以下の方法で代替イメージを提供します。 画像バイナリフィールド、 Base64 画像コンテンツ、 または 画像 URL。
  5. 入力 置き換えるテキスト まさに表示されているとおりに PDF、そして設定する ページシーケンス 特定のページを対象とする必要がある場合。
  6. セット 画像の高さ そして 画像の幅 置換画像のサイズを変更し、 出力ファイル名。
  7. 有効にする Async 大型 PDFs 必要に応じて、ノードを実行し、更新されたデータをルーティングします。 PDF 次のステップへ。

典型的な構成​

ワークフローの例Common n8n workflow patterns using Replace Text With Image.
提案書テンプレートへのクライアントロゴの挿入
  1. CRMのWebhookは、顧客向けに新しい提案書が作成された際に起動します。
  2. PDF4me 「テキストを画像に置き換える」は、「置き換えるテキスト」を「 [クライアントロゴ] 画像入力データ型 URL クライアントのロゴを指差しながら。
  3. ブランドロゴ入りの提案書は、最終確認のため営業担当者にメールで送信されます。
作成された契約書への署名スタンプ
  1. 契約は以下によって生成されます PDF4me ドキュメントを生成する [サイン] プレースホルダー。
  2. PDF4me 「テキストを画像に置き換える」機能は、署名者の署名画像と、最終ページのみを対象としたページシーケンスを使用して実行されます。
  3. 署名済みの契約書はアーカイブされています SharePoint。
カタログ内の商品画像の差し替え PDF
  1. 「アイテムのループ」ノードは、在庫データベースから製品レコードを反復処理します。
  2. PDF4me テキストを画像に置き換える処理はアイテムごとに実行され、 [商品画像] クラウドストレージから取得した各製品の写真を含むプレースホルダー。
  3. 各パーソナライズされたカタログページは、下流で単一の配布可能なデータに結合されます。 PDF。
承認印のグラフィック(署名後)
  1. 承認ウェブフックは、管理者が社内ツールで文書を承認済みとしてマークした時点で起動します。
  2. PDF4me テキストを画像に置き換える [承認印] プレースホルダーが承認グラフィックに置き換えられました。
  3. 最終決定 PDF ファイル名に承認日を含めてアーカイブされます。

実践的なヒント​

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.

チートシート​

分野価値
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

よくある質問​

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.

関連アクション​

他のプラットフォームでの同じタスク​

ヘルプが必要な場合​