page-count
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

PAGE COUNTER

Count pages from pdf, docx, pptx, odt files

Main example
    import { readFileSync } from "fs";
    import countPages from "page-count";

    const docxBuffer = readFileSync("test/files/test-10.docx");
    const pages = await countPages(docxBuffer, "docx");
Main example
    import { readFileSync } from "fs";
    import { DocxCounter, OdtCounter, PdfCounter, PptxCounter } from "page-count";

    const docxBuffer = readFileSync("test/files/test-10.docx");
    const pdfBuffer = readFileSync("test/files/test-10.pdf");
    const pptxBuffer = readFileSync("test/files/test-10.pptx");
    const odtBuffer = readFileSync("test/files/test-10.odt");
    
    const pagesDocx = await DocxCounter.count(docxBuffer);
    const pagesPdf = await PdfCounter.count(pdfBuffer);
    const pagesPptx = await PptxCounter.count(pptxBuffer);
    const pagesOdt = await OdtCounter.count(odtBuffer);

Fell free to open issues and make pull requests.

Package Sidebar

Install

npm i page-count

Weekly Downloads

1,400

Version

0.0.4

License

MIT

Unpacked Size

39.5 kB

Total Files

35

Last publish

Collaborators

  • gorguexo