Skip to main content

Highlight Text in PDF with Power Automate

PDF4me Highlight Text action in Power Automate finds every occurrence of one or more words inside a PDF and highlights them with a color you choose per term. Pass a list of Text + Highlightcolor pairs (six-digit hex, for example #FF2C00 for red) and the action annotates every match across every page — no manual clicking, no per-page loops. Ideal for contract review, invoice batches, compliance scans, and any high-volume flow where a human would otherwise open each PDF and highlight by hand.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication between your Power Automate flows and PDF4me's highlight service.

Flow overview

Four steps: manual trigger, Dropbox download, PDF4me Highlight Text, Dropbox upload. Swap Dropbox for SharePoint or OneDrive without changing the PDF4me step.

Power Automate flow with four steps: Manually trigger a flow, Dropbox Get file content using path, PDF4me PDF - Highlight Text, and Dropbox Create file
End-to-end flow: trigger → download source PDF → highlight → save annotated PDF back to storage.

Key Features

  • Keyword-based Highlighting: Match one or many search terms across the entire document
  • Per-term Color: Assign a distinct hex color to every keyword in the same run
  • Case-insensitive Matching: promise matches Promise, PROMISE, and mixed case
  • Multi-page Coverage: Every occurrence on every page is annotated
  • Storage-agnostic: Works with Dropbox, SharePoint, OneDrive, or any binary source

Parameters

Complete list of parameters for the Highlight Text action.

Important: Parameters marked with Required must be provided for the action to function correctly.

ParameterTypeDescriptionExample
File Content RequiredBinarySource PDF content. Map from a prior step such as Dropbox / SharePoint / OneDrive Get file content, or an email attachment.Get file content using path output
File Name OptionalStringFilename of the source PDF. Used for output identification. Include the .pdf extension.abc.pdf
Body/textHighlightList RequiredArrayOne item per keyword. Each item has Text-N (the phrase to find) and Highlightcolor-N (hex color). Click Add new item to add more keywords.See example below
Body/textHighlightList[].Text-N RequiredStringWord or phrase to search for. Case-insensitive. Every occurrence across every page is highlighted.promise
Body/textHighlightList[].Highlightcolor-N RequiredStringSix-character hex color prefixed with #. Applied to every match of the paired Text field.#FF2C00

Step 1 — Load the source PDF

Add a Dropbox - Get file content using path step and point it at your source PDF. Set Infer Content Type to Yes so the binary bytes flow through untouched — Power Automate will otherwise try to guess a MIME type and can strip the PDF header.

Dropbox Get file content using path action with File Path /pdf4metest/sample/drylab.pdf and Infer Content Type set to Yes
Point File Path at the PDF to annotate. Infer Content Type must be Yes for binary integrity.

Step 2 — Configure Highlight Text

Add PDF4me PDF - Highlight Text. Map File Content from the previous step, set File Name, then build Body/textHighlightList: for each keyword, add a Text-N and a Highlightcolor-N. Click Add new item to add more.

PDF4me Highlight Text action with File Content mapped from Get file content, File Name abc.pdf, and Body textHighlightList containing two items: Text-1 promise and Highlightcolor-1 #FF2C00, Text-2 especially and Highlightcolor-2 #FF2C00
Two keywords (promise, especially) both highlighted red (#FF2C00). Swap either color to #FFFF00 for the classic yellow highlighter look.

Step 3 — Save the annotated PDF

Add Dropbox - Create file (or SharePoint / OneDrive equivalent). Set Folder Path to your output folder, build File Name with guid() plus the source filename to guarantee uniqueness, and map File Content from the Highlight Text output.

Dropbox Create file action with Folder Path /pdf4meoutput, File Name built from guid() concatenated with the PDF Highlight Text filename output, and File Content mapped from PDF Highlight Text
guid() prefix keeps concurrent runs from overwriting each other in the destination folder.

Output

The PDF4me Highlight Text action returns the annotated PDF for downstream use:

FieldTypeDescription
File ContentBinaryAnnotated PDF with every matched keyword highlighted in its assigned color. Map directly into a Create file or email-with-attachment step.
File NameStringFilename echoed from the input, used as a convenience for downstream naming.

Common questions

How do I highlight multiple words with different colors in the same run?

Click Add new item under Body/textHighlightList for each keyword. Set Text-1 + Highlightcolor-1, Text-2 + Highlightcolor-2, and so on. Every term uses its own color independently. Practical use: red for red-flag phrases, yellow for reviewer notes, green for approved terms — all in a single API call.

What hex color formats does Highlightcolor accept?

Six-character hex codes prefixed with #. Common values: #FFFF00 (yellow — the classic PDF highlight), #FF2C00 (red), #00FF00 (green), #00FFFF (cyan), #FFA500 (orange). Alpha / RGBA formats are not accepted — supply full opaque hex only.

Does Highlight Text work on scanned PDFs?

Only when the scan has an underlying text layer (OCR already applied). The action searches the extracted text stream, so an image-only scan returns the original file with no highlights added. Chain PDF4me OCR before Highlight Text when your source is a raw scan.

Is the search case-sensitive?

No. Matching is case-insensitive by default. Text = promise will highlight Promise, PROMISE, and promise. This lets you feed keyword lists straight from a spreadsheet or database without normalizing case.

Can I use this with SharePoint or OneDrive instead of Dropbox?

Yes. Replace Dropbox - Get file content using path with SharePoint Get file content (or OneDrive Get file content), and swap Dropbox - Create file for the matching Create file action. The PDF4me Highlight Text step in the middle is unchanged.

Get Help