Fix garbled text in PDF/SVG vector graphics for final editing in AI. Detect, replace and repair garbled text in vector graphic files while maintaining original formatting and layout.
62
51%
Does it follow best practices?
Impact
70%
5.00xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./scientific-skills/Data analysis/vector-text-fixer/SKILL.mdFixes garbled text in PDF/SVG vector graphics to make them editable in AI tools.
# Fix a single PDF file
python scripts/main.py --input document.pdf --output fixed.pdf
# Fix a single SVG file
python scripts/main.py --input diagram.svg --output fixed.svg
# Batch process folder
python scripts/main.py --batch ./input_folder --output ./output_folder
# Interactive repair (manually specify replacement content)
python scripts/main.py --input doc.pdf --interactive
# Export as editable format (JSON)
python scripts/main.py --input doc.pdf --export-json editable.jsonfrom scripts.main import VectorTextFixer
# Create fixer instance
fixer = VectorTextFixer()
# Fix PDF
result = fixer.fix_pdf("input.pdf", "output.pdf")
# Fix SVG
result = fixer.fix_svg("input.svg", "output.svg")
# Batch processing
results = fixer.batch_fix("./input_folder", "./output_folder")
# Get text map (for AI editing)
text_map = fixer.extract_text_map("input.pdf")| Parameter | Type | Required | Description |
|---|---|---|---|
--input | str | Yes* | Input file path (PDF or SVG) |
--batch | str | No | Batch processing input folder |
--output | str | Yes* | Output file/folder path |
--interactive | bool | No | Enable interactive repair mode |
--export-json | str | No | Export editable JSON format |
--encoding | str | No | Specify source file encoding (default: auto-detect) |
--font-substitution | dict | No | Font replacement mapping |
--repair-level | str | No | Repair level: minimal, standard, aggressive (default: standard) |
*At least one of --input and --batch is required
{
"file_type": "pdf",
"pages": [
{
"page_num": 1,
"text_blocks": [
{
"id": "tb_001",
"bbox": [100, 200, 300, 220],
"original_text": "�����",
"detected_encoding": "UTF-8",
"confidence": 0.3,
"suggested_fix": "Sample Text"
}
]
}
],
"fonts_used": ["Arial", "SimSun"],
"repair_summary": {
"total_blocks": 15,
"fixed_blocks": 12,
"skipped_blocks": 3
}
}The tool uses the following rules to detect garbled text:
Input:
python scripts/main.py --input report.pdf --output fixed_report.pdfOutput:
✓ Processing: report.pdf
✓ Detected 5 garbled text blocks
✓ Fixed 4 blocks automatically
⚠ 1 block requires manual review
✓ Output saved: fixed_report.pdf
✓ Report saved: fixed_report_repair_log.jsonInput:
python scripts/main.py --input diagram.svg --export-json editable.jsonOutput JSON Structure:
{
"file_type": "svg",
"svg_info": {
"width": 800,
"height": 600,
"viewBox": "0 0 800 600"
},
"text_elements": [
{
"id": "text_1",
"x": 100,
"y": 200,
"font_family": "Arial",
"font_size": 14,
"original": "�����",
"user_editable": "",
"confidence": 0.25
}
]
}pdfplumber>=0.10.0 # PDF parsing
PyMuPDF>=1.23.0 # PDF processing (fitz)
cairosvg>=2.7.0 # SVG conversion
beautifulsoup4>=4.12.0 # SVG parsing
fonttools>=4.40.0 # Font processing
chardet>=5.0.0 # Encoding detection
Pillow>=10.0.0 # Image processing| Risk Indicator | Assessment | Level |
|---|---|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access | No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
# Python dependencies
pip install -r requirements.txtca9aaa4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.