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.
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.

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:
promisematchesPromise,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
Requiredmust be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| File Content Required | Binary | Source 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 Optional | String | Filename of the source PDF. Used for output identification. Include the .pdf extension. | abc.pdf |
| Body/textHighlightList Required | Array | One 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 Required | String | Word or phrase to search for. Case-insensitive. Every occurrence across every page is highlighted. | promise |
| Body/textHighlightList[].Highlightcolor-N Required | String | Six-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.

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.

#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.

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:
- Table
- JSON
| Field | Type | Description |
|---|---|---|
| File Content | Binary | Annotated PDF with every matched keyword highlighted in its assigned color. Map directly into a Create file or email-with-attachment step. |
| File Name | String | Filename echoed from the input, used as a convenience for downstream naming. |
{
"document": "JVBERi0xLjcKJcOkw7zDtsO...",
"fileName": "abc.pdf"
}
document is Base64-encoded PDF bytes. Power Automate decodes it transparently when you map the output into a Create file or Send an email action.
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.