pdf-transform-png

1.0.4 • Public • Published

pdf-transform

Installation

  • npm install pdf-transform-png --save

Purpose

Can convert PDF files to:

  • PNG images
  • HTML files

Usage

Create following directories in your project directory for outputs to be viewed:

  • html-files

How to use:

  • Command line:
$ node index.js "./manual/PDF_Converter_ReadME.pdf"
  • Code Snippet:
const pdfTransform = require("pdf-transform");
 
pdfTransform.convert({
  fileName: "./manual/PDF_Converter_ReadME.pdf", // Specify PDF file path here
  convertTo: "html", // Can be "png" also
  exportPath,//导出路径
});
  • Output:
Finished converting 1 page of PDF file to a PNG image.
Finished converting 2 page of PDF file to a PNG image.
Finished converting 3 page of PDF file to a PNG image.
HTML file created successfully and saved as sample_3.html in html-files folder.
HTML file created successfully and saved as sample_2.html in html-files folder.
HTML file created successfully and saved as sample_1.html in html-files folder.

Uses

Internally uses pdf.js: https://github.com/mozilla/pdf.js

Package Sidebar

Install

npm i pdf-transform-png

Weekly Downloads

230

Version

1.0.4

License

ISC

Unpacked Size

20.5 MB

Total Files

384

Last publish

Collaborators

  • roweir