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 files. 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 documents without manually editing the file.

Common scenarios include:

  • Updating outdated URLs embedded as hyperlinks in PDFs.
  • Changing the visible text of hyperlinks while keeping the destination URL intact.
  • Replacing both the displayed text and the target URL of hyperlinks in bulk.

For example, if a company rebrands and changes its website URL, this node can automatically update all hyperlinks pointing to the old URL to the new one across multiple PDF documents.

Properties

Name Meaning
Input Data Type How the PDF input is provided:
- Binary Data: Use PDF file from previous node
- Base64 String: Provide PDF content as base64 encoded string
- URL: Provide URL to PDF file
Binary Property Name Name of the binary property containing the PDF (used only if Input Data Type is Binary Data). Default is "data".
Base64 Content Base64-encoded PDF content (used only if Input Data Type is Base64 String).
PDF URL URL to the PDF file to update hyperlinks annotation (used only if Input Data Type is URL).
Output File Name Name for the output PDF file after updating hyperlinks. Default is "hyperlinks_updated_PDF_output.pdf".
Search On Criteria to search for hyperlinks: either by "Text" (the visible hyperlink text) or by "URL" (the hyperlink destination).
Search Value The text or URL value to search for in the PDF's hyperlinks. Default is "http://www.google.com".
Is Expression Whether to use expression matching (likely regex or similar) when searching for the hyperlink text or URL. Default is true.
Text Current Value The current hyperlinked text to replace (used when searching on Text). Default is "http://www.google.com".
Text New Value The new display text for the hyperlink to replace with. Default is "https://pdf4me.com".
URL Current Value The current URL destination to replace (used when searching on URL). Default is "http://www.google.com".
URL New Value The new URL destination to replace with. Default is "https://pdf4me.com".
Binary Data Output Name Custom name for the binary data in n8n output. Default is "data".

Output

The node outputs the updated PDF file as binary data under the specified binary data output name (default "data"). The JSON output contains metadata about the operation and the updated PDF content in binary form, which can be used downstream in workflows for saving, sending, or further processing.

If the input was a PDF file, the output will be the same PDF but with updated hyperlink annotations according to the specified parameters.

Dependencies

  • Requires an API key credential for the PDF processing service that performs the hyperlink update operation.
  • The node depends on external PDF manipulation services accessible via API.
  • Proper network access to fetch PDF files if using URL input type.
  • No additional environment variables are explicitly required beyond the API authentication setup.

Troubleshooting

  • Common issues:

    • Invalid or inaccessible PDF URL when using URL input type.
    • Incorrect binary property name leading to missing PDF input.
    • Malformed base64 string causing decoding errors.
    • Search criteria not matching any hyperlinks, resulting in no changes.
    • Using expression matching incorrectly may cause unexpected results.
  • Error messages:

    • Errors related to fetching the PDF file usually indicate network or URL issues.
    • Authentication errors suggest invalid or missing API credentials.
    • Parsing errors may occur if the input PDF is corrupted or unsupported.
  • Resolutions:

    • Verify the PDF URL is reachable and publicly accessible or properly authenticated.
    • Confirm the binary property name matches the actual binary data field.
    • Validate base64 strings before input.
    • Test search values and expressions carefully to ensure they match expected hyperlink content.
    • Ensure API credentials are correctly configured in n8n.

Links and References

Discussion