inspect_pdf_fonts
Search PDF for text terms and retrieve font details like name, size, and position to ensure replacements match the document style.
Instructions
Search for specific text terms and report their font properties.
Use this tool to understand the exact font styling of text you want to replace. This ensures replacements will match the surrounding document style as closely as possible.
The tool searches through all pages and returns matches with:
Page number where the term was found
The search term that matched
Surrounding context (first 100 characters)
Font name (e.g., "Helvetica-Bold", "Times-Roman")
Font size in points
Origin coordinates for precise positioning
Args: input_path: Absolute path to the PDF file to inspect. terms: List of text strings to search for (1-50 terms). Each term is searched as a substring. password: Optional password if the PDF is encrypted.
Returns: JSON string with all matches and their font properties. Returns empty matches array if no terms are found.
Example: inspect_pdf_fonts("/path/to/doc.pdf", ["Invoice", "$99.99", "Total"])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_path | Yes | ||
| terms | Yes | ||
| password | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |