page-count
v0.0.4
Published
Module to count pages of docx, pptx, doc, ppt and pdf documents.
Downloads
2,928
Readme
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.