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

browser-pdf-to-images

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-pdf-to-images

convert pdf pages to images

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

browser pdf to images

convert pdf pages to images

import { file2images } from 'browser-pdf-to-images'

file2images(input.files[0]).then(images=>console.log(images))

// ['data:image/png;base64,/9j/4AAQSkZJRg...','data:image/png;base64,/9j/4AAQSkZJRg...']

options

file2images(file,options={})

options.type and options.quality

if you want to change output image type and quality

same as https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL

file2images(file,{
  type: 'image/jpeg', // jpg format
  quality: 1 // full quality
})

options.scale

scale if you want

file2images(file,{
  scale: 1.5 // all pages scale up to 1.5 size
})

options.pdfjsLib

I got problem when use pdfjs-dist in next.js, so I can use CDN version

<script src="some/cdn/pdf.min.js">
file2images(file,{
  pdfjsLib: pdfjsLib // use cdn version
})

FAQs

Package last updated on 30 Jul 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