{"id":15837239,"url":"https://github.com/dulajkavinda/pdf-lecture","last_synced_at":"2026-05-04T11:36:12.620Z","repository":{"id":57321379,"uuid":"262962243","full_name":"dulajkavinda/pdf-lecture","owner":"dulajkavinda","description":"📄Convert PDFs into vanilla text.","archived":false,"fork":false,"pushed_at":"2020-05-11T06:51:37.000Z","size":3067,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T06:52:44.680Z","etag":null,"topics":["nodejs","npm","npm-package","open-source","pdf-converter","pdf-lecture","pdf2json","pdfs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pdf-lecture","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dulajkavinda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-11T06:51:02.000Z","updated_at":"2021-02-09T11:17:20.000Z","dependencies_parsed_at":"2022-08-25T22:41:32.632Z","dependency_job_id":null,"html_url":"https://github.com/dulajkavinda/pdf-lecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dulajkavinda/pdf-lecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dulajkavinda%2Fpdf-lecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dulajkavinda%2Fpdf-lecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dulajkavinda%2Fpdf-lecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dulajkavinda%2Fpdf-lecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dulajkavinda","download_url":"https://codeload.github.com/dulajkavinda/pdf-lecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dulajkavinda%2Fpdf-lecture/sbom","scorecard":{"id":359479,"data":{"date":"2025-08-11","repo":{"name":"github.com/dulajkavinda/pdf-lecture","commit":"5ae9220c3b48c116bf215a913e0f15ecace8ce10"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}}]},"last_synced_at":"2025-08-18T10:25:54.142Z","repository_id":57321379,"created_at":"2025-08-18T10:25:54.142Z","updated_at":"2025-08-18T10:25:54.142Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278663356,"owners_count":26024389,"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-10-06T02:00:05.630Z","response_time":65,"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":["nodejs","npm","npm-package","open-source","pdf-converter","pdf-lecture","pdf2json","pdfs"],"created_at":"2024-10-05T15:21:30.952Z","updated_at":"2025-10-06T19:02:06.748Z","avatar_url":"https://github.com/dulajkavinda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pdf-lecture\n\n**Javascript cross-platform module to extract texts from PDFs.**\n\n[![version](https://img.shields.io/npm/v/pdf-lecture.svg)](https://www.npmjs.org/package/pdf-lecture)\n[![downloads](https://img.shields.io/npm/dt/pdf-lecture.svg)](https://www.npmjs.org/package/pdf-lecture)\n\n## Similar Packages\n* [pdf2json](https://www.npmjs.com/package/pdf2json) buggy, no support anymore, memory leak, throws non-catchable fatal errors\n* [j-pdfjson](https://www.npmjs.com/package/j-pdfjson) fork of pdf2json\n* [pdf-parser](https://github.com/dunso/pdf-parse) buggy, no tests\n* [pdfreader](https://www.npmjs.com/package/pdfreader) using pdf2json\n* [pdf-extract](https://www.npmjs.com/package/pdf-extract) not cross-platform using xpdf\n\n## Installation\n`npm install pdf-lecture`\n \n## Basic Usage - Local Files\n\n```js\nvar path = require(\"path\");\nvar fs = require(\"fs\");\nvar filePath = path.join(__dirname, \"..your path\");\nvar PDF = require(\"pdf-lecture\");\n\nPDF(filePath).then((data) =\u003e {\n   console.log(data.numpages)\n   console.log(data.text)\n   console.log(data.pageTextArray)\n});\n```\n\n## Exception Handling\n\n```js\nconst fs = require('fs');\n\nvar filePath = path.join(__dirname, \"..your path\");\nvar PDF = require(\"pdf-lecture\");\n\nPDF(filePath).then(function(data) {\n\t// use data\n})\n.catch(function(error){\n\t// handle exceptions\n})\n```\n\n```js\n// default render callback\nfunction render_page(pageData) {\n  let render_options = {\n    normalizeWhitespace: false,\n    disableCombineTextItems: false,\n  };\n\n  return pageData.getTextContent(render_options).then(function (textContent) {\n    let lastY,\n      text = \"\";\n    for (let item of textContent.items) {\n      if (lastY == item.transform[5] || !lastY) {\n        text += item.str;\n      } else {\n        text += \"\\n\" + item.str;\n      }\n      lastY = item.transform[5];\n    }\n    return text;\n  });\n}\n\nlet options = {\n    pagerender: render_page\n}\n\nlet dataBuffer = fs.readFileSync('path to PDF file...');\n\npdf(dataBuffer,options).then(function(data) {\n\t//use new format\n});\n```\n\n## Options\n\n```js\nconst DEFAULT_OPTIONS = {\n\t// internal page parser callback\n\t// you can set this option, if you need another format except raw text\n\tpagerender: render_page,\n\t\n\t// max page number to parse\n\tmax: 0,\n\t\n\t//check https://mozilla.github.io/pdf.js/getting_started/\n\tversion: 'v1.10.100'\n}\n```\n### *pagerender* (callback)\nIf you need another format except raw text.  \n\n### *max* (number)\nMax number of page to parse. If the value is less than or equal to 0, parser renders all pages.  \n\n### *version* (string, pdf.js version)\ncheck [pdf.js](https://mozilla.github.io/pdf.js/getting_started/)\n\n* `'default'`\n* `'v1.9.426'`\n* `'v1.10.100'`\n* `'v1.10.88'`\n* `'v2.0.550'`\n\n\u003e*default* version is *v1.10.100*   \n\u003e[mozilla.github.io/pdf.js](https://mozilla.github.io/pdf.js/getting_started/#download)\n\n\n### Submitting an Issue\nIf you find a bug or a mistake, you can help by submitting an issue to [Github Repository](https://github.com/dulajkavinda/pdf-lecture/issues)\n\n## License\n[MIT licensed]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdulajkavinda%2Fpdf-lecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdulajkavinda%2Fpdf-lecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdulajkavinda%2Fpdf-lecture/lists"}