{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-vector-text-fixer-ae7aa20c3e18","title":"Vector Text Fixer","summary":"Fix garbled text in PDF\/SVG vector graphics caused by font encoding issues, making files editable in AI tools. Supports batch processing and JSON export for manual correction.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-vector-text-fixer-ae7aa20c3e18","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-vector-text-fixer-ae7aa20c3e18","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-vector-text-fixer-ae7aa20c3e18.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-vector-text-fixer-ae7aa20c3e18\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure the input is a valid PDF or SVG file path, not a text string. For batch processing, use the `--batch` parameter with a folder path. If the file is encrypted, unlock it with a password before processing. The repair level defaults to `standard`, and encoding is auto-detected unless specified.","instructions":"---\nname: vector-text-fixer\ndescription: Fix garbled text in PDF\/SVG vector graphics caused by font encoding issues, making files editable in AI tools. Supports batch processing and JSON export for manual correction.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Vector Text Fixer\n\nFixes garbled text in PDF\/SVG vector graphics caused by font embedding problems, encoding errors, or missing font substitution. Outputs repaired files or editable JSON for AI tool import.\n\n## Quick Check\n\n```bash\npython -m py_compile scripts\/main.py\n```\n\n## Audit-Ready Commands\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\npython scripts\/main.py --input document.pdf --output fixed.pdf\npython scripts\/main.py --input diagram.svg --output fixed.svg\n```\n\n## When to Use\n\n- Fix garbled\/box characters in PDF files caused by font embedding issues\n- Repair SVG text encoding errors before editing in Illustrator or Inkscape\n- Batch-process a folder of PDF\/SVG files with garbled text\n- Export a text map JSON for manual correction in AI editors\n\n## Workflow\n\n1. Confirm input file path (PDF or SVG) or batch folder, and desired output path.\n2. Validate that the request involves PDF\/SVG garbled text repair; stop early if not.\n3. Run `scripts\/main.py --input <file> --output <file>` or `--batch <folder>`.\n4. Return a structured result separating repaired blocks, skipped blocks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the Fallback Template below.\n\n## Fallback Template\n\nIf `scripts\/main.py` fails or required fields are missing, respond with:\n\n```\nFALLBACK REPORT\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nObjective        : <repair goal>\nInputs Available : <file path or batch folder provided>\nMissing Inputs   : <list exactly what is missing>\n  Note: --input requires a valid PDF or SVG file path, not a text string.\n        For batch mode use --batch <folder_path> instead.\nPartial Result   : <any blocks repaired safely>\nBlocked Steps    : <what could not be completed and why>\nNext Steps       : <minimum info needed to complete>\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n```\n\n## Stress-Case Output Checklist\n\nFor complex multi-constraint requests, always include these sections explicitly:\n\n- **Assumptions**: repair level default (standard), encoding auto-detected\n- **Constraints**: encrypted PDFs require password unlock first; scanned PDFs need OCR first\n- **Risks**: severely damaged files may not be fully repairable; rare fonts may not map correctly\n- **Unresolved Items**: blocks with confidence < 0.3 flagged for manual review\n\n## Supported Scenarios\n\n**PDF Garbled Text:**\n- Box\/question mark issues from font embedding problems\n- Garbled text from encoding conversion errors\n- Missing font substitution characters\n- Multi-language mixed encoding issues\n\n**SVG Garbled Text:**\n- Text entity encoding errors\n- Special character escaping issues\n- Invalid font reference display abnormalities\n- XML encoding declaration errors\n\n## CLI Usage\n\n```bash\n# Fix single PDF\npython scripts\/main.py --input document.pdf --output fixed.pdf\n\n# Fix single SVG\npython scripts\/main.py --input diagram.svg --output fixed.svg\n\n# Batch process folder\npython scripts\/main.py --batch .\/input_folder --output .\/output_folder\n\n# Interactive repair\npython scripts\/main.py --input doc.pdf --interactive\n\n# Export editable JSON\npython scripts\/main.py --input doc.pdf --export-json editable.json\n\n# Specify repair level\npython scripts\/main.py --input doc.pdf --output fixed.pdf --repair-level aggressive\n```\n\n## Parameters\n\n| Parameter | Required | Description | Default |\n|---|---|---|---|\n| `--input` | Yes* | Input PDF or SVG file path | \u2014 |\n| `--batch` | Yes* | Batch input folder path | \u2014 |\n| `--output` | Yes | Output file or folder path | \u2014 |\n| `--repair-level` | No | `minimal` \/ `standard` \/ `aggressive` | `standard` |\n| `--interactive` | No | Enable interactive repair mode | False |\n| `--export-json` | No | Export editable JSON format | \u2014 |\n| `--encoding` | No | Source file encoding (default: auto-detect) | auto |\n\n*At least one of `--input` or `--batch` is required.\n\n## Repair Levels\n\n- **Minimal**: Only obvious errors (replacement characters, null bytes); maximum original integrity\n- **Standard**: Common encoding issues + smart font replacement; balanced repair rate and accuracy\n- **Aggressive**: Full text re-encoding + OCR-assisted recognition; for severely garbled documents\n\n## Output Format (JSON Export)\n\n```json\n{\n  \"file_type\": \"pdf\",\n  \"pages\": [{\n    \"page_num\": 1,\n    \"text_blocks\": [{\n      \"id\": \"tb_001\",\n      \"bbox\": [100, 200, 300, 220],\n      \"original_text\": \"?????\",\n      \"detected_encoding\": \"UTF-8\",\n      \"confidence\": 0.3,\n      \"suggested_fix\": \"Sample Text\"\n    }]\n  }],\n  \"repair_summary\": {\n    \"total_blocks\": 15,\n    \"fixed_blocks\": 12,\n    \"skipped_blocks\": 3\n  }\n}\n```\n\n## Input Validation\n\nThis skill accepts: PDF (.pdf) or SVG (.svg) file paths, or a folder path for batch processing, where the files contain garbled or unreadable text caused by font\/encoding issues.\n\nIf the request does not involve PDF\/SVG garbled text repair \u2014 for example, asking to convert file formats, edit PDF content directly, perform OCR on scanned images, or process non-vector files \u2014 do not proceed. Instead respond:\n\n> \"`vector-text-fixer` is designed to fix garbled text in PDF\/SVG vector graphics caused by font encoding issues. Your request appears to be outside this scope. Please provide a valid PDF or SVG file path, or use a more appropriate tool.\"\n\n## Error Handling\n\n- If `--input` receives a text string instead of a file path, report the error and request a valid file path.\n- If the file is encrypted, report that password unlock is required before processing.\n- If the task goes outside documented scope, stop instead of guessing.\n- If `scripts\/main.py` fails, use the Fallback Template above.\n- Do not fabricate repaired text content or execution outcomes.\n\n## Output Requirements\n\nEvery final response must include:\n\n1. **Objective** \u2014 file(s) repaired and repair level used\n2. **Inputs Received** \u2014 file path, repair level, encoding settings\n3. **Assumptions** \u2014 defaults applied (repair level, encoding detection)\n4. **Result** \u2014 output file path, blocks fixed vs skipped\n5. **Risks and Limits** \u2014 confidence thresholds, manual review blocks\n6. **Next Checks** \u2014 review low-confidence blocks manually before use\n\n## Limitations\n\n- Encrypted PDFs require password unlock before processing\n- Severely damaged vector files may not be fully repairable\n- Some rare fonts may not map correctly\n- Scanned PDFs require OCR recognition first\n\n## Dependencies\n\n```\npdfplumber >= 0.10.0\nPyMuPDF >= 1.23.0\ncairosvg >= 2.7.0\nbeautifulsoup4 >= 4.12.0\nfonttools >= 4.40.0\nchardet >= 5.0.0\nPillow >= 10.0.0\n```\n","use_cases":["Fix garbled\/box characters in PDF files caused by font embedding issues","Repair SVG text encoding errors before editing in Illustrator or Inkscape","Batch-process a folder of PDF\/SVG files with garbled text","Export a text map JSON for manual correction in AI editors"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Other\/vector-text-fixer\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T16:21:00.000000Z","updated_at":"2026-11-26T09:25:03.000000Z","seo_title":"Fix Garbled Text in PDF\/SVG Files","seo_description":"Fix garbled text in PDF\/SVG files caused by font encoding issues. Supports batch processing and JSON export for manual correction.","seo_keywords":["fix garbled text in PDF","repair SVG encoding errors","batch process PDF\/SVG files","export editable JSON for AI tools"]}}