PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides functionality to update hyperlinks annotations within PDF documents. It allows users to search for specific hyperlink text or URLs in a PDF and replace them with new display text or new URL destinations. This is useful when you need to correct, update, or standardize hyperlinks in existing PDF files without manually editing the document.

Common scenarios include:

  • Updating outdated URLs embedded as hyperlinks in PDFs.
  • Changing the visible text of hyperlinks to improve clarity or branding.
  • Correcting hyperlink targets after website restructuring.
  • Batch processing multiple PDFs to update links automatically.

For example, if a company rebrands and changes its website URL, this node can be used to find all hyperlinks pointing to the old URL and update both the displayed text and the actual link destination to the new URL.

Properties

Name Meaning
Input Data Type How the PDF input is provided:
- Binary Data (from previous node)
- Base64 String
- URL to PDF file
Binary Property Name Name of the binary property containing the PDF (used if Input Data Type is Binary Data)
Base64 Content Base64-encoded PDF content (used if Input Data Type is Base64 String)
PDF URL URL to the PDF file to update hyperlinks annotation (used if Input Data Type is URL)
Output File Name Name for the output PDF file after updating hyperlinks
Search On Criteria to search for hyperlinks:
- Text
- URL
Search Value The text or URL value to search for in the hyperlinks
Is Expression Whether to use expression matching for the search value (true/false)
Text Current Value Current hyperlinked text to replace
Text New Value New display text for the hyperlink
URL Current Value Current URL destination to replace
URL New Value New URL destination
Binary Data Output Name Custom name for the binary data in n8n output

Output

The node outputs the updated PDF file with modified hyperlinks as binary data. The binary data contains the full PDF content with the hyperlinks updated according to the specified parameters. The output binary property name can be customized via the "Binary Data Output Name" property.

The JSON output field typically includes metadata about the operation and references to the binary data containing the updated PDF.

Dependencies

  • Requires access to the PDF file either as binary data from a previous node, a base64 encoded string, or a publicly accessible URL.
  • Requires an API key credential or authentication token configured in n8n to interact with the external PDF processing service that performs the hyperlink updates.
  • No other external dependencies are indicated.

Troubleshooting

  • Common issues:

    • Providing an invalid or inaccessible PDF URL will cause failures in fetching the PDF.
    • Incorrect binary property names may result in missing input data.
    • Mismatched search criteria (e.g., searching for text when the hyperlink is defined by URL) may lead to no changes.
    • Using expressions incorrectly in the search value might cause unexpected results.
  • Error messages:

    • Errors related to file retrieval usually indicate network or permission issues.
    • Validation errors may occur if required properties like PDF URL or base64 content are missing.
    • If no hyperlinks match the search criteria, the output PDF will remain unchanged but no explicit error is thrown.
  • Resolutions:

    • Verify the PDF input source and ensure it is accessible.
    • Double-check property values for correctness and completeness.
    • Test search criteria independently to confirm matches exist in the PDF.

Links and References

Discussion