Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

convert-pdf-png

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-57.89%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 19 Feb 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc