Socket
Socket
Sign inDemoInstall

convert-pdf-png

Package Overview
Dependencies
98
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    convert-pdf-png

Convert Pdf file into png file, targeting the conversion of file in file out concept.


Version published
Weekly downloads
56
decreased by-17.65%
Maintainers
1
Install size
42.2 MB
Created
Weekly downloads
 

Readme

Source

convert-pdf-png · Github license npm version Downloads

A Very Easy library for you to convert any pdf files no matter how many pages they are. Convert them into png files.

  • File In & Files Out: simply pass the pdf file from <input type='file' /> into the function, it converts every page of your pdf into png files and returns the Array.
  • Easy Configuration: The functions only contains two parameters, Pdf and Config, no need to set complex codes.

Installation

With npm: npm install --save convert-pdf-png

Other dependencies you need to install:

  • pdfjs-dist npm install --save pdfjs-dist
  • file-saver npm install --save file-saver
  • jszip npm install --save jszip

Usage

import { convertPdfToPng } from 'convert-pdf-png';
...
const convertAndDownload = e => {
    const pdf = e.target.files[0];

    convertPdfToPng(pdf, {
        outputType: 'download',
    });
}

// ** or **

const convertAndDoSomething = e => {
    const pdf = e.target.files[0];

    convertPdfToPng(pdf, {
        outputType: 'callback',
        callback: callback
    });

    const callback = images => {
        // the function returns an array
        // every img is a normal file object
        images.forEach(img => {
            console.log(img.filename);
        });
    }
}
...

Keywords

FAQs

Last updated on 19 Feb 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