Socket
Socket
Sign inDemoInstall

pdf-transform

Package Overview
Dependencies
69
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pdf-transform

Transforms PDF to png or html files


Version published
Maintainers
1
Install size
187 MB
Created

Readme

Source

pdf-transform

Installation

  • npm install pdf-transform --save

Purpose

Can convert PDF files to:

  • PNG images
  • HTML files

Usage

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

  • png-outputs
  • 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
});
  • 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

Keywords

FAQs

Last updated on 12 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc