Socket
Socket
Sign inDemoInstall

pdf-to-png-converter

Package Overview
Dependencies
Maintainers
1
Versions
27
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.


Version published
Weekly downloads
12K
decreased by-2.67%
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 Jan 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