npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

selectpdf

v1.4.0

Published

SelectPdf Online REST API is a professional solution for managing PDF documents online.

Downloads

55

Readme

SelectPdf Online REST API - Node.js Client

HTML To PDF API - Node.js Client

SelectPdf HTML To PDF Online REST API is a professional solution that lets you create PDF from web pages and raw HTML code in your applications. The API is easy to use and the integration takes only a few lines of code.

Features

  • Create PDF from any web page or html string.
  • Full html5/css3/javascript support.
  • Set PDF options such as page size and orientation, margins, security, web page settings.
  • Set PDF viewer options and PDF document information.
  • Create custom headers and footers for the pdf document.
  • Hide web page elements during the conversion.
  • Automatically generate bookmarks during the html to pdf conversion.
  • Support for partial page conversion.
  • Works in all programming languages.

Sign up for for free to get instant API access to SelectPdf HTML to PDF API.

Sample Code

var selectpdf = require('selectpdf');

console.log("This is SelectPdf-%s.", selectpdf.CLIENT_VERSION);

try {
    var url = 'https://selectpdf.com';
    var localFile = 'Test.pdf'
    var apiKey = 'Your API key here';

    var client = new selectpdf.HtmlToPdfClient(apiKey);

    client
        .setPageSize('A4')
        .setMargins(0)  
        .setShowPageNumbers(false)
        .setPageBreaksEnhancedAlgorithm(true)
    ;

    client.convertUrlToFile(url, localFile, 
        function(err, fileName) {
            if (err) return console.log("An error occurred: " + err);
            console.log("Finished successfully. Result is in file '" + fileName + "'. Number of pages: " + client.getNumberOfPages());
        }
    );

}
catch (ex) {
    console.log("An error occurred: " + ex);
}

Pdf Merge API

SelectPdf Pdf Merge REST API is an online solution that lets you merge local or remote PDFs into a final PDF document.

Features

  • Merge local PDF document.
  • Merge remote PDF from public url.
  • Set PDF viewer options and PDF document information.
  • Secure generated PDF with a password.
  • Works in all programming languages.

See PDF Merge API page for full list of parameters.

Sample Code

var selectpdf = require('selectpdf');

console.log("This is SelectPdf-%s.", selectpdf.CLIENT_VERSION);

try {
    var testUrl = 'https://selectpdf.com/demo/files/selectpdf.pdf';
    var testPdf = 'Input.pdf';
    var localFile = 'Result.pdf';
    var apiKey = 'Your API key here';

    var client = new selectpdf.PdfMergeClient(apiKey);

    // set parameters - see full list at https://selectpdf.com/pdf-merge-api/
    client
        // specify the pdf files that will be merged (order will be preserved in the final pdf)
        
        .addFile(testPdf) // add PDF from local file
        .addUrlFile(testUrl) // add PDF From public url
        //.addFile(testPdf, "pdf_password") // add PDF (that requires a password) from local file
        //.addUrlFile(testUrl, "pdf_password") // add PDF (that requires a password) from public url
    ;

    console.log('Starting pdf merge ...');

    // merge pdfs to local file
    client.saveToFile(localFile, 
        function(err, fileName) {
            if (err) return console.error("An error occurred: " + err);
            console.log("Finished! Result is in file '" + fileName + "'. Number of pages: " + client.getNumberOfPages());
        }
    );
}
catch (ex) {
    console.log("An error occurred: " + ex);
}

Pdf To Text API

SelectPdf Pdf To Text REST API is an online solution that lets you extract text from your PDF documents or search your PDF document for certain words.

Features

  • Extract text from PDF.
  • Search PDF.
  • Specify start and end page for partial file processing.
  • Specify output format (plain text or html).
  • Use a PDF from an online location (url) or upload a local PDF document.

See Pdf To Text API page for full list of parameters.

Sample Code

var selectpdf = require('selectpdf');

console.log("This is SelectPdf-%s.", selectpdf.CLIENT_VERSION);

try {
    var testUrl = 'https://selectpdf.com/demo/files/selectpdf.pdf';
    var testPdf = 'Input.pdf';
    var localFile = 'Result.txt';
    var apiKey = 'Your API key here';

    var client = new selectpdf.PdfToTextClient(apiKey);

    // set parameters - see full list at https://selectpdf.com/pdf-to-text-api/
    client
        .setStartPage(1) // start page (processing starts from here)
        .setEndPage(0) // end page (set 0 to process file til the end)
        .setOutputFormat(0) // set output format (0-Text or 1-HTML)
    ;

    console.log('Starting pdf to text ...');

    // convert local pdf to local text file
    client.getTextFromFileToFile(testPdf, localFile, 
        function(err, fileName) {
            if (err) return console.error("An error occurred: " + err);
            console.log("Finished! Result is in file '" + fileName + "'. Number of pages processed: " + client.getNumberOfPages());
        }
    );
}
catch (ex) {
    console.log("An error occurred: " + ex);
}