PDF.co API icon

PDF.co API

Generate PDF, extract data from PDF, split PDF, merge PDF, convert PDF. Fill PDF forms, add text and images to pdf and much more with pdf.co!

Search & Replace Text or Delete

AI-generated

Overview

This node allows users to perform text search and manipulation operations on PDF files accessed via a URL. It supports searching and deleting specific text, searching and replacing text with new text, or searching and replacing text with an image. This is useful for automating PDF content updates, such as removing sensitive information, updating company names, or inserting images in place of text.

Use Case Examples

  1. Automatically remove confidential terms from a PDF document before sharing.
  2. Replace outdated company names with new ones across multiple PDF files.
  3. Insert a company logo image in place of a placeholder text within a PDF.

Properties

Name Meaning
Authentication Select the authentication method to access the PDF processing service (API Key or OAuth2).
PDF URL The URL of the PDF file to process.
Operation Type Choose the type of text operation to perform on the PDF: delete text, replace text, or replace text with an image.
Search and Delete Text Collection of text strings to search for and delete from the PDF (used when operation type is delete).
Search and Replace Text Collection of text strings to search for and their replacement text (used when operation type is replace).
Search Text Text to search for in the PDF (used when operation type is replaceWithImage).
Replacement Image URL URL of the image to replace the found text with (used when operation type is replaceWithImage).
Pages Specify pages or page ranges to apply the operation on, supporting ranges and negative indexing.
Advanced Options Additional settings such as replacement limits, regex usage, case sensitivity, output file naming, callback URL, link expiration, PDF password, HTTP credentials for source URL, and custom processing profiles.

Output

JSON

  • outputFileUrl - URL to the processed PDF file with the applied text operations.
  • status - Status of the operation (e.g., success or failure).
  • message - Additional information or error messages related to the operation.

Dependencies

  • An API key or OAuth2 credentials for authenticating with the PDF processing service.

Troubleshooting

  • Ensure the PDF URL is accessible and correct; inaccessible URLs will cause failures.
  • Verify authentication credentials are valid and have necessary permissions.
  • Check that the search text exists in the PDF; otherwise, no changes will be made.
  • If using regular expressions, ensure the patterns are valid to avoid errors.
  • For password-protected PDFs, provide the correct password to allow processing.

Links

Discussion