{"id":14036066,"url":"https://github.com/opengovsg/pdf2md","last_synced_at":"2025-07-27T03:31:17.801Z","repository":{"id":34980641,"uuid":"190119581","full_name":"opengovsg/pdf2md","owner":"opengovsg","description":"A PDF to Markdown converter","archived":false,"fork":true,"pushed_at":"2025-01-19T23:52:55.000Z","size":1975,"stargazers_count":390,"open_issues_count":14,"forks_count":64,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-24T02:46:14.422Z","etag":null,"topics":["markdown","pdf-converter"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@opendocsg/pdf2md","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jzillmann/pdf-to-markdown","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opengovsg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-06-04T03:05:28.000Z","updated_at":"2025-07-23T13:37:19.000Z","dependencies_parsed_at":"2023-07-26T08:51:55.962Z","dependency_job_id":null,"html_url":"https://github.com/opengovsg/pdf2md","commit_stats":null,"previous_names":["opendocsg/pdf2md"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/opengovsg/pdf2md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2Fpdf2md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2Fpdf2md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2Fpdf2md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2Fpdf2md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opengovsg","download_url":"https://codeload.github.com/opengovsg/pdf2md/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2Fpdf2md/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267294180,"owners_count":24065343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","pdf-converter"],"created_at":"2024-08-12T03:01:49.413Z","updated_at":"2025-07-27T03:31:17.793Z","avatar_url":"https://github.com/opengovsg.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# pdf2md\n\nJavaScript npm library to parse PDF files and convert them into Markdown\n\n## Major Changes\n\nSee [Releases](https://github.com/opendocsg/pdf2md/releases)\n\n## Usage\n\n### Library\n\n```js\nconst path = require('path');\nconst fs = require('fs')\nconst pdf2md = require('@opendocsg/pdf2md')\n\nconst pdfBuffer = fs.readFileSync(filePath)\npdf2md(pdfBuffer, callbacks)\n  .then(text =\u003e {\n    let outputFile = allOutputPaths[i] + '.md'\n    console.log(`Writing to ${outputFile}...`)\n    fs.writeFileSync(path.resolve(outputFile), text)\n    console.log('Done.')\n  })\n  .catch(err =\u003e {\n    console.error(err)\n  })\n```\n\n### CLI tool\n\n```\n$ cd [project_folder]\n$ npx @opendocsg/pdf2md --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive\n```\n\nIf you are converting recursively on a large number of files you might encounter the error \"Allocation failed - JavaScript heap out of memory”. Instead, run the command\n\n```\n$ node lib/pdf2md-cli.js --max-old-space-size=4096 --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive\n```\n\nOptions:\n1. Input folder path (should exist)\n2. Output folder path (should exist)\n3. Recursive - convert all PDFs for folders within folders. Specify the tag if you require recursive, and omit if you don't\n\n## Credits\n\n[pdf-to-markdown](https://github.com/jzillmann/pdf-to-markdown) - original project by Johannes Zillmann  \n[pdf.js](https://mozilla.github.io/pdf.js/) - Mozilla's PDF parsing \u0026 rendering platform which is used as a raw parser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengovsg%2Fpdf2md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopengovsg%2Fpdf2md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengovsg%2Fpdf2md/lists"}