[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJKSSNSSQP3EFXWH7Z5PB2":3,"skill-same:01M6KJKSSNSSQP3EFXWH7Z5PB2":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":13,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M6KJKSSNSSQP3EFXWH7Z5PB2","pdftotext-fallback",null,"Recover PDF text extraction when read_file returns binary data by using pdftotext via shell","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdftotext-fallback\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36],"fallback","pdftotext","pdftotext fallback","PDF","extraction","file","data","shell","text","returns","read","binary","via","pdf text extraction","2026-11-10 10:12:30",false,"---\nname: pdftotext-fallback\ndescription: Recover PDF text extraction when read_file returns binary data by using pdftotext via shell\n---\n\n# pdftotext Fallback for PDF Text Extraction\n\n## When to Use\n\nApply this pattern when:\n- `read_file` on a PDF returns binary\u002Fimage data instead of readable text\n- Python-based PDF extraction (PyMuPDF, pdfplumber, etc.) in `execute_code_sandbox` fails or returns garbled content\n- You need reliable text extraction from PDF files as a recovery strategy\n\n## Why This Works\n\nThe `pdftotext` utility (from poppler-utils) is a mature, command-line tool that handles many PDF edge cases that confuse Python libraries or the `read_file` tool. It's pre-installed on most Linux systems and provides consistent, reliable text extraction.\n\n## Steps\n\n### Step 1: Detect the Failure\n\nRecognize extraction failure when:\n- `read_file` returns binary content, image data, or garbled text\n- Error messages indicate encoding issues or unsupported formats\n- Python PDF libraries in sandbox fail with import errors or extraction failures\n\n### Step 2: Use pdftotext via run_shell\n\n**Extract to stdout** (recommended for quick extraction):\n\n```bash\npdftotext \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\nThe `-` argument outputs directly to stdout for easy capture in your tool response.\n\n**Example:**\n```bash\nrun_shell(\"pdftotext document.pdf -\")\n```\n\n### Step 3: Handle Complex PDFs\n\n**Preserve layout** (maintains original formatting):\n```bash\npdftotext -layout \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\n**Extract to a file** (for large PDFs):\n```bash\npdftotext \u002Fpath\u002Fto\u002Ffile.pdf \u002Fpath\u002Fto\u002Foutput.txt\n```\nThen read the output file with `read_file`.\n\n**Handle encoded text:**\n```bash\npdftotext -enc UTF-8 \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\n### Step 4: Verify and Continue\n\n- Check the extracted text for completeness\n- If text is still garbled, the PDF may be image-based (scanned) - consider OCR tools\n- Proceed with your task using the extracted text\n\n## Code Examples\n\n**Basic extraction:**\n```bash\n# Simple text extraction\ntext = run_shell(\"pdftotext document.pdf -\")\n```\n\n**With error handling:**\n```bash\n# Try extraction, check for success\nresult = run_shell(\"pdftotext document.pdf - && echo 'SUCCESS' || echo 'FAILED'\")\n```\n\n**Multi-page PDF with layout:**\n```bash\n# Preserve tables and formatting\ntext = run_shell(\"pdftotext -layout document.pdf -\")\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| `pdftotext: command not found` | Install poppler-utils: `apt-get install poppler-utils` |\n| Garbled\u002Fspecial characters | Try `-enc UTF-8` or `-enc ASCII7` |\n| Missing formatting | Use `-layout` flag |\n| Scanned PDF (no text) | Requires OCR (e.g., tesseract), not text extraction |\n| Large PDF timeout | Extract to file instead of stdout |\n\n## Limitations\n\n- Does not work on image-only (scanned) PDFs without embedded text\n- May lose complex formatting, tables, or embedded objects\n- Requires poppler-utils to be installed (common on Linux, may need installation on other systems)\n\n## Related Tools\n\n- `pdfinfo`: Get PDF metadata (pages, size, etc.)\n- `pdftoppm`: Convert PDF pages to images\n- `tesseract`: OCR for scanned PDFs","# pdftotext Fallback for PDF Text Extraction\n\n## When to Use\n\nApply this pattern when:\n- `read_file` on a PDF returns binary\u002Fimage data instead of readable text\n- Python-based PDF extraction (PyMuPDF, pdfplumber, etc.) in `execute_code_sandbox` fails or returns garbled content\n- You need reliable text extraction from PDF files as a recovery strategy\n\n## Why This Works\n\nThe `pdftotext` utility (from poppler-utils) is a mature, command-line tool that handles many PDF edge cases that confuse Python libraries or the `read_file` tool. It's pre-installed on most Linux systems and provides consistent, reliable text extraction.\n\n## Steps\n\n### Step 1: Detect the Failure\n\nRecognize extraction failure when:\n- `read_file` returns binary content, image data, or garbled text\n- Error messages indicate encoding issues or unsupported formats\n- Python PDF libraries in sandbox fail with import errors or extraction failures\n\n### Step 2: Use pdftotext via run_shell\n\n**Extract to stdout** (recommended for quick extraction):\n\n```bash\npdftotext \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\nThe `-` argument outputs directly to stdout for easy capture in your tool response.\n\n**Example:**\n```bash\nrun_shell(\"pdftotext document.pdf -\")\n```\n\n### Step 3: Handle Complex PDFs\n\n**Preserve layout** (maintains original formatting):\n```bash\npdftotext -layout \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\n**Extract to a file** (for large PDFs):\n```bash\npdftotext \u002Fpath\u002Fto\u002Ffile.pdf \u002Fpath\u002Fto\u002Foutput.txt\n```\nThen read the output file with `read_file`.\n\n**Handle encoded text:**\n```bash\npdftotext -enc UTF-8 \u002Fpath\u002Fto\u002Ffile.pdf -\n```\n\n### Step 4: Verify and Continue\n\n- Check the extracted text for completeness\n- If text is still garbled, the PDF may be image-based (scanned) - consider OCR tools\n- Proceed with your task using the extracted text\n\n## Code Examples\n\n**Basic extraction:**\n```bash\n# Simple text extraction\ntext = run_shell(\"pdftotext document.pdf -\")\n```\n\n**With error handling:**\n```bash\n# Try extraction, check for success\nresult = run_shell(\"pdftotext document.pdf - && echo 'SUCCESS' || echo 'FAILED'\")\n```\n\n**Multi-page PDF with layout:**\n```bash\n# Preserve tables and formatting\ntext = run_shell(\"pdftotext -layout document.pdf -\")\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| `pdftotext: command not found` | Install poppler-utils: `apt-get install poppler-utils` |\n| Garbled\u002Fspecial characters | Try `-enc UTF-8` or `-enc ASCII7` |\n| Missing formatting | Use `-layout` flag |\n| Scanned PDF (no text) | Requires OCR (e.g., tesseract), not text extraction |\n| Large PDF timeout | Extract to file instead of stdout |\n\n## Limitations\n\n- Does not work on image-only (scanned) PDFs without embedded text\n- May lose complex formatting, tables, or embedded objects\n- Requires poppler-utils to be installed (common on Linux, may need installation on other systems)\n\n## Related Tools\n\n- `pdfinfo`: Get PDF metadata (pages, size, etc.)\n- `pdftoppm`: Convert PDF pages to images\n- `tesseract`: OCR for scanned PDFs",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fpdftotext-fallback","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add AG064\u002FOpenSpace --skill pdftotext-fallback",{"tool":55,"command":56},"bunx","bunx skills add AG064\u002FOpenSpace --skill pdftotext-fallback",{"tool":58,"command":59},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill pdftotext-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdftotext-fallback\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},".skill_id","OTHER","其他",32,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdftotext-fallback\u002F.skill_id",[70,93,108,116,145,161],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":37},"01M6KKMPWA0B5SCCH766F8M5EA","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,85,86,87,88,89,90,28,91,92],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","python","typescript",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":37},"01M6KKMJXVBNVEY3TRK055F4A7","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[100,101,79,90,102,33,28,91,103,104,35,105,106,83,85,107],"readback","write special chars readback","cleanup","scripts","verification","post","helper","with",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":37},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[79,115,91,83,35,90,30,28,85],"write special chars heredoc",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":127,"publishedAt":37},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[122],{"categoryNo":123,"categoryName":124,"taxonomyType":125,"taxonomyTypeDesc":126},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[128,129,130,131,92,132,133,134,135,136,83,137,138,139,140,141,142,143,29,144],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","scheduler",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":37},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[152,153,154,155,83,156,107,157,158,159,160],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":37},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[168,169,170,171,172,173,28,174,175,176],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]