{"_id":"@alimamed/pdf-text","_rev":"1-482ec511f261580bee45664bfa2b7177","name":"@alimamed/pdf-text","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@alimamed/pdf-text","version":"1.0.0","description":"Extract an array of text chunks from a pdf","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/AliMamed/node-pdf-text.git"},"keywords":["pdf","text"],"author":{"name":"Ali Mamed"},"license":"MIT","bugs":{"url":"https://github.com/AliMamed/node-pdf-text/issues"},"devDependencies":{"mocha":"~8.2.1","okay":"~1.0.0"},"dependencies":{"lodash":"~4.17.20","pdf2json":"^1.2.0"},"homepage":"https://github.com/AliMamed/node-pdf-text#readme","directories":{"test":"test"},"gitHead":"0faa64c086c10f437096d7932ed2af37aad4c509","_id":"@alimamed/pdf-text@1.0.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-gF4jLOfRFuw4cJAxdt1ogpo8CjKrKwg9/kZZZwXub7SlkDm56+YHVjkq+/9YqLO9qarPRvjcvdF+t41aT2K2gQ==","shasum":"112714d541798f55e5a8e3fb0a5bdf682d6339b2","tarball":"https://registry.npmjs.org/@alimamed/pdf-text/-/pdf-text-1.0.0.tgz","fileCount":3,"unpackedSize":4027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGRABCRA9TVsSAnZWagAAUAUP/2Hrv2Z8fswIsZqNgYKE\n50E9P2DS8tgU1D5DlUOISQ1Pqr9kwh7AuvZBDKnadZBdneKc0+5StMb3iZod\nWoJYTEgpwT6kBtY3TxsnIRJN5WRHLK5zgrTBKUCC5St4d/0QslZQb202hUdI\n/E1t2Ad8kfxZIAfKrsdoErbcfAZ//s8vgeBmv89P4iUhOFPUT8/J6YOhHVJh\nyk1X3znnmF6EgjD+7Z3bvWMax3uDJQw4STcuto6U7sIGx7WOecJWruMLOm+b\nztBfBjlPXWKWUInvZTXHBSxYS7mqFNUrmqSvahncMnM5z9l9moBJGcr/0QN4\n2GjshlYVImuiPLsX0GsIi0abOm3GTnId+n0R0TEUEkCUzhYIhdSGkiN7KaBg\nxhTeKnabpxzVXv/4r1RoaBiCn4L86jsJoAaxy8CKuJn5yby8XyFWzpK1l659\nr9KgdLOzuc7ysQui1gpb6eFtt+ZvAqKaMGqW1gswArbs+guiKpgt0hNj0L8B\n9ncHNPBSmyr6lAXyNSWDt3uLb1DmpGfQNsTGlgIO5NFCkjZLqDjqVssaRm2p\ncwRBVjoMUrv37m+DnuKHNkroPvfxASlRj9E7lz69eUBvMrgPHcdF45IaIWkX\nROzc7Zf4+bfp2SHXRnl3CfNWvTKjtgNeV5rfA9aXfo23mWbXfz7bafEmXfXP\n2VIY\r\n=HBiX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvJ+F/CPZuMjcl832rlgj5vWS/PCOf+q8gFynRVIZDOQIhAOcQOsobZWiDnsP7xfkiQqKBufSASOFfda70RLrQQvuP"}]},"_npmUser":{"name":"alimamed","email":"av@kalite.ro"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-text_1.0.0_1612255233136_0.5400171889638705"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-02T08:40:33.071Z","1.0.0":"2021-02-02T08:40:33.309Z","modified":"2022-04-04T13:26:05.101Z"},"maintainers":[{"name":"alimamed","email":"av@kalite.ro"}],"description":"Extract an array of text chunks from a pdf","homepage":"https://github.com/AliMamed/node-pdf-text#readme","keywords":["pdf","text"],"repository":{"type":"git","url":"git://github.com/AliMamed/node-pdf-text.git"},"author":{"name":"Ali Mamed"},"bugs":{"url":"https://github.com/AliMamed/node-pdf-text/issues"},"license":"MIT","readme":"# pdf-text\n\nExtract text from a pdf into an array of text 'chunks'.  Useful for doing fuzzy parsing on structured pdf text.\n\nUses Mozilla's [pdf.js](http://mozilla.github.io/pdf.js/) via [pdf2json](https://github.com/modesty/pdf2json).\n\nForked from [brianc/node-pdf-text](https://github.com/brianc/node-pdf-text) to fix audit issues.\n\n## install\n\n```sh\n$ npm install pdf-text\n```\n\n## use\n\n```js\nvar pdfText = require('pdf-text')\n\nvar pathToPdf = __dirname + \"/info.pdf\"\n\npdfText(pathToPdf, function(err, chunks) {\n  //chunks is an array of strings \n  //loosely corresponding to text objects within the pdf\n\n  //for a more concrete example, view the test file in this repo\n})\n\n//or parse a buffer of pdf data\n//this is handy when you already have the pdf in memory\n//and don't want to write it to a temp file\nvar fs = require('fs')\nvar buffer = fs.readFileSync(pathToPdf)\npdfText(buffer, function(err, chunks) {\n\n})\n\n```\n\n## api\n\n#### pdfText(string pathToPdfFile, function callback(error, string[]))\n\nCallback receives `string[]` of all the text objects within the pdf.  The array is ordered similarly to how the text appears on the page, making it possible to extract key pieces by finding them based on how they relate to other 'known' pieces of text in the page.\n\n#### pdfText(Buffer bufferOfPdfContents, function callback(error, string[]))\n\nOptionally pass a buffer of pdf data instead of a path to the file.\n\n## license\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Brian M. Carlson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","readmeFilename":"README.md"}