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

pdf-to-png-converter

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-to-png-converter

Node.js utility to convert PDF pages to PNG files with no native dependencies.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-23.2%
Maintainers
1
Weekly downloads
 
Created
Source

pdf-to-png-converter

Node.js utility to compare PNG files without binary and OS dependencies.

Tests on push

Getting started

Installation:

npm install -D pdf-to-png-converter

Example

test(`Convert PDF To PNG`, async () => {
    const pngPages: PngPageOutput[] = await pdfToPng(pdfFilePath, { // The function accepts PDF file path or a Buffer
        disableFontFace: false, // If disabled, fonts will be rendered using a built-in font renderer that constructs the glyphs with primitive path commands.
        useSystemFonts: false, // When `true`, fonts that aren't embedded in the PDF document will fallback to a system font.
        viewportScale: 2.0, // The desired scale of PNG viewport
        outputFilesFolder: 'output/folder', // folder to write output png files,
        pdfFilePassword: 'password', // password for encrypted PDF,
        pages: [1, 3, 11]   // Subset of pages to convert (first page = 1, optional)
    });

   ...
});

Output

{
    name: string; // PNG page name in a format `{pdfFileName}_page_{pdfPageNumber}.png`,
    content: Buffer; // PNG page content
    path: string; // path to stored PNG file (empty string if outputFilesFolder is not provided)
};

Keywords

FAQs

Package last updated on 12 Mar 2022

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