replace_text_with_image_in_word
Find specific placeholder text in a Word document and replace it with an image. Provide the Word file, image, search text, and page numbers to update the document in place.
Instructions
Replace placeholder text in a Word document with an image using the PDF4me ReplaceTextWithImageInWord API (POST /api/v2/ReplaceTextWithImageInWord). Provide paths to the .docx/.doc file and image, SearchText to find, PageNumbers (e.g. 1 or 1,2), and optional first-page skip. Uses isAsync with 202 Location polling. Saves the modified Word file to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_dir | No | ||
| search_text | Yes | Placeholder text in the document to replace (e.g. SIGN_HERE). | |
| page_numbers | No | Pages to process, as accepted by the API (e.g. "1", "1,2"). | 1 |
| word_file_path | Yes | Local path to the Word document (.docx or .doc). | |
| image_file_path | Yes | Local path to the replacement image. | |
| output_file_name | No | ||
| is_first_page_skip | No | Maps to IsFirstPageSkip. |