[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBSGFVFFRDD7AEN1ZBRR6F":3,"skill-same:01M6XBSGFVFFRDD7AEN1ZBRR6F":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"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":6,"updatedAt":47,"install":48,"resources":61},"01M6XBSGFVFFRDD7AEN1ZBRR6F","pdf-read-file-fallback",null,"Extract text from PDFs using pdftotext when read_file returns binary data","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-read-file-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],"PDF","file","read","fallback","pdf read","read file","pdf read file fallback","data","text","returns","extract","binary","pdftotext","when","2026-11-10 10:12:30",false,"---\nname: pdf-read-file-fallback\ndescription: Extract text from PDFs using pdftotext when read_file returns binary data\n---\n\n# PDF Text Extraction Fallback\n\n## When to Use\n\nUse this pattern when `read_file` with `filetype=\"pdf\"` returns binary image data instead of extractable text content. This commonly occurs with PDFs that contain scanned images or complex formatting.\n\n## Steps\n\n### 1. Attempt Primary Extraction\n\nFirst, try using `read_file`:\n\n```python\nresult = read_file(file_path=\"document.pdf\", filetype=\"pdf\")\n```\n\n**Important**: Use `filetype` (not `file_type`) - incorrect parameter naming will cause execution failures.\n\n### 2. Detect Binary\u002FImage Data\n\nCheck if the result contains unusable content:\n\n```python\n# Indicators of binary\u002Fimage data:\n# - Contains null bytes: '\\x00'\n# - Very short or empty\n# - Contains image markers (PNG\u002FJPEG headers)\n# - Unreadable character sequences\n\nif not result or len(result) \u003C 50 or '\\x00' in str(result):\n    # Proceed to fallback\n```\n\n### 3. Use pdftotext via run_shell\n\nExtract text using the `pdftotext` command-line tool:\n\n```python\nshell_result = run_shell(command=\"pdftotext -layout document.pdf -\")\ntext_content = shell_result.stdout\n```\n\nThe `-` flag outputs to stdout for easy capture. The `-layout` flag preserves original formatting.\n\n### 4. Handle pdftotext Unavailable\n\nIf `pdftotext` is not installed, try Python-based extraction:\n\n```python\nresult = execute_code_sandbox(code=\"\"\"\nimport pdfplumber\ntext = ''\nwith pdfplumber.open('document.pdf') as pdf:\n    for page in pdf.pages:\n        extracted = page.extract_text()\n        if extracted:\n            text += extracted + '\\\\n'\nprint(text)\n\"\"\")\n```\n\n## Complete Example\n\n```python\nfile_path = \"report.pdf\"\n\n# Primary attempt\nresult = read_file(file_path=file_path, filetype=\"pdf\")\n\n# Validate and fallback if needed\nif not result or len(str(result)) \u003C 100 or '\\x00' in str(result):\n    # Fallback to pdftotext\n    shell_result = run_shell(command=f\"pdftotext -layout {file_path} -\")\n    text_content = shell_result.stdout\n    \n    # If pdftotext fails, try Python extraction\n    if not text_content or len(text_content) \u003C 50:\n        code_result = execute_code_sandbox(code=f\"\"\"\nimport pdfplumber\ntext = ''\nwith pdfplumber.open('{file_path}') as pdf:\n    for page in pdf.pages:\n        extracted = page.extract_text()\n        if extracted:\n            text += extracted + '\\\\n'\nprint(text)\n\"\"\")\n        text_content = code_result\n```\n\n## Notes\n\n- `pdftotext` is part of the `poppler-utils` package on most Linux systems\n- For scanned\u002Fimage-only PDFs, consider OCR tools (tesseract) instead\n- Always validate parameter names against tool documentation (`filetype` vs `file_type`)","# PDF Text Extraction Fallback\n\n## When to Use\n\nUse this pattern when `read_file` with `filetype=\"pdf\"` returns binary image data instead of extractable text content. This commonly occurs with PDFs that contain scanned images or complex formatting.\n\n## Steps\n\n### 1. Attempt Primary Extraction\n\nFirst, try using `read_file`:\n\n```python\nresult = read_file(file_path=\"document.pdf\", filetype=\"pdf\")\n```\n\n**Important**: Use `filetype` (not `file_type`) - incorrect parameter naming will cause execution failures.\n\n### 2. Detect Binary\u002FImage Data\n\nCheck if the result contains unusable content:\n\n```python\n# Indicators of binary\u002Fimage data:\n# - Contains null bytes: '\\x00'\n# - Very short or empty\n# - Contains image markers (PNG\u002FJPEG headers)\n# - Unreadable character sequences\n\nif not result or len(result) \u003C 50 or '\\x00' in str(result):\n    # Proceed to fallback\n```\n\n### 3. Use pdftotext via run_shell\n\nExtract text using the `pdftotext` command-line tool:\n\n```python\nshell_result = run_shell(command=\"pdftotext -layout document.pdf -\")\ntext_content = shell_result.stdout\n```\n\nThe `-` flag outputs to stdout for easy capture. The `-layout` flag preserves original formatting.\n\n### 4. Handle pdftotext Unavailable\n\nIf `pdftotext` is not installed, try Python-based extraction:\n\n```python\nresult = execute_code_sandbox(code=\"\"\"\nimport pdfplumber\ntext = ''\nwith pdfplumber.open('document.pdf') as pdf:\n    for page in pdf.pages:\n        extracted = page.extract_text()\n        if extracted:\n            text += extracted + '\\\\n'\nprint(text)\n\"\"\")\n```\n\n## Complete Example\n\n```python\nfile_path = \"report.pdf\"\n\n# Primary attempt\nresult = read_file(file_path=file_path, filetype=\"pdf\")\n\n# Validate and fallback if needed\nif not result or len(str(result)) \u003C 100 or '\\x00' in str(result):\n    # Fallback to pdftotext\n    shell_result = run_shell(command=f\"pdftotext -layout {file_path} -\")\n    text_content = shell_result.stdout\n    \n    # If pdftotext fails, try Python extraction\n    if not text_content or len(text_content) \u003C 50:\n        code_result = execute_code_sandbox(code=f\"\"\"\nimport pdfplumber\ntext = ''\nwith pdfplumber.open('{file_path}') as pdf:\n    for page in pdf.pages:\n        extracted = page.extract_text()\n        if extracted:\n            text += extracted + '\\\\n'\nprint(text)\n\"\"\")\n        text_content = code_result\n```\n\n## Notes\n\n- `pdftotext` is part of the `poppler-utils` package on most Linux systems\n- For scanned\u002Fimage-only PDFs, consider OCR tools (tesseract) instead\n- Always validate parameter names against tool documentation (`filetype` vs `file_type`)",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpdf-read-file-fallback","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-read-file-fallback",{"tool":54,"command":55},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-read-file-fallback",{"tool":57,"command":58},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-read-file-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-read-file-fallback\u002FSKILL.md",true,[62],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},".skill_id","OTHER","其他",36,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-read-file-fallback\u002F.skill_id",[69,93,109,118,147,163],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":37},"01M6XCCXD3NCM2YKR3WNGBASPC","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,24,92],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","python",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":37},"01M6XCCT7E3J922Q345PBGSHPN","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[100,101,77,24,102,92,103,104,105,106,25,91,107,108,81,84,86],"readback","write special chars readback","helper","post","via","scripts","cleanup","verification","with",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":37},"01M6XCCMQX1R8B6FECWB3P63T7","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[116,77,81,117,86,104,91,24,92,84],"write special chars heredoc","shell",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":129,"publishedAt":37},"01M6XCCG41M994JJEX6VN52PEP","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[124],{"categoryNo":125,"categoryName":126,"taxonomyType":127,"taxonomyTypeDesc":128},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[130,131,132,133,134,79,135,136,137,138,139,84,140,141,142,143,144,145,146,30],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":37},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[154,155,156,157,84,158,108,159,160,161,162],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":37},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[170,171,172,173,174,175,24,176,177,178],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]