├── .github └── workflows │ └── test.yml ├── .gitignore ├── .npmrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin └── cli.mjs ├── eslint.config.js ├── package.json ├── src ├── canvasFactory.ts ├── index.ts └── parseInput.ts ├── tests ├── 7pages.pdf ├── __image_snapshots__ │ ├── cli-test-ts-cli-works-when-specific-pages-are-specified-1-snap.png │ ├── cli-test-ts-cli-works-when-specific-pages-are-specified-2-snap.png │ ├── cli-test-ts-cli-works-when-specific-pages-are-specified-3-snap.png │ ├── jsdom-test-ts-background-colour-can-generate-pngs-with-a-custom-background-colour-1-snap.png │ ├── jsdom-test-ts-background-colour-can-generate-transparent-images-1-snap.png │ ├── jsdom-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png │ ├── jsdom-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png │ ├── jsdom-test-ts-document-init-params-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-in-the-doc-init-params-1-snap.png │ ├── jsdom-test-ts-encrypted-pdf-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-1-snap.png │ ├── jsdom-test-ts-example-pdf-correctly-generates-a-single-png-for-the-one-page-1-snap.png │ ├── jsdom-test-ts-multipage-pdf-can-read-a-specific-page-number-1-snap.png │ ├── jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-1-snap.png │ ├── jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-2-snap.png │ ├── jsdom-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png │ ├── jsdom-test-ts-test-pattern-pdf-correctly-handles-pd-fs-with-no-margin-1-snap.png │ ├── jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-1-snap.png │ ├── jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-2-snap.png │ ├── jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-3-snap.png │ ├── jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-4-snap.png │ ├── jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-5-snap.png │ ├── node-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png │ ├── node-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png │ ├── node-test-ts-example-pdf-in-node-correctly-generates-a-single-png-for-the-one-page-in-nodejs-environment-1-snap.png │ └── node-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png ├── cli.test.ts ├── encrypted.pdf ├── example.pdf ├── jsdom.test.ts ├── multipage.pdf ├── node.test.ts ├── setupTests.ts ├── test-pattern.pdf └── weird-fonts.pdf ├── tsconfig.json └── vitest.config.ts /.github/workflows/test.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/.github/workflows/test.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/.gitignore -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/README.md -------------------------------------------------------------------------------- /bin/cli.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/bin/cli.mjs -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/eslint.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/package.json -------------------------------------------------------------------------------- /src/canvasFactory.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/src/canvasFactory.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/parseInput.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/src/parseInput.ts -------------------------------------------------------------------------------- /tests/7pages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/7pages.pdf -------------------------------------------------------------------------------- /tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-2-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-2-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-3-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/cli-test-ts-cli-works-when-specific-pages-are-specified-3-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-background-colour-can-generate-pngs-with-a-custom-background-colour-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-background-colour-can-generate-pngs-with-a-custom-background-colour-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-background-colour-can-generate-transparent-images-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-background-colour-can-generate-transparent-images-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-document-init-params-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-in-the-doc-init-params-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-document-init-params-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-in-the-doc-init-params-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-encrypted-pdf-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-encrypted-pdf-correctly-handles-encrypted-pd-fs-if-a-password-is-supplied-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-example-pdf-correctly-generates-a-single-png-for-the-one-page-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-example-pdf-correctly-generates-a-single-png-for-the-one-page-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-can-read-a-specific-page-number-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-can-read-a-specific-page-number-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-2-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-multipage-pdf-works-for-multipage-pd-fs-2-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-test-pattern-pdf-correctly-handles-pd-fs-with-no-margin-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-test-pattern-pdf-correctly-handles-pd-fs-with-no-margin-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-2-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-2-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-3-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-3-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-4-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-4-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-5-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/jsdom-test-ts-weird-fonts-correctly-resolves-fonts-to-pdfjs-5-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/node-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/node-test-ts-buffer-can-load-a-document-from-a-buffer-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/node-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/node-test-ts-data-url-can-load-a-document-from-a-data-url-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/node-test-ts-example-pdf-in-node-correctly-generates-a-single-png-for-the-one-page-in-nodejs-environment-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/node-test-ts-example-pdf-in-node-correctly-generates-a-single-png-for-the-one-page-in-nodejs-environment-1-snap.png -------------------------------------------------------------------------------- /tests/__image_snapshots__/node-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/__image_snapshots__/node-test-ts-readable-stream-can-load-a-document-from-a-readable-stream-1-snap.png -------------------------------------------------------------------------------- /tests/cli.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/cli.test.ts -------------------------------------------------------------------------------- /tests/encrypted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/encrypted.pdf -------------------------------------------------------------------------------- /tests/example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/example.pdf -------------------------------------------------------------------------------- /tests/jsdom.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/jsdom.test.ts -------------------------------------------------------------------------------- /tests/multipage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/multipage.pdf -------------------------------------------------------------------------------- /tests/node.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/node.test.ts -------------------------------------------------------------------------------- /tests/setupTests.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/setupTests.ts -------------------------------------------------------------------------------- /tests/test-pattern.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/test-pattern.pdf -------------------------------------------------------------------------------- /tests/weird-fonts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tests/weird-fonts.pdf -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/tsconfig.json -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-yle/pdf-to-img/HEAD/vitest.config.ts --------------------------------------------------------------------------------