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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@raymondcamden/pdfservice_sdk_foxit

v1.0.0

Published

A SDK wrapper for Foxit's PDF Services and Document Generation APIs.

Downloads

32

Readme

Foxit PDF Services SDK

This SDK lets developers more easily use the Foxit APIs, including PDF Services and Document Generation. You will need a free set of credentials in order to call the APIs.

Usage

Copy your credentials to the environment and then instantiate the SDK. Here's a sample:

import { PDFServiceSDK } from "./PDFServiceSDK.mjs";

const clientId = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET;

const pdfService = new PDFServiceSDK(clientId, clientSecret);

await pdfService.wordToPDF('assets/input/input.docx', 'assets/output/output_from_nodesdk.pdf');
console.log("PDF conversion completed successfully.");

// v2 change that uses new conversion method
await pdfService.conversion('assets/input/input.docx', 'assets/output/output_from_nodesdk_v2.pdf');
console.log("PDF conversion (second version)completed successfully.");

You can optionally pass credentials for the 4th and 5th parameter to the constructor:

const clientId = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET;

const dgClientId = process.env.DG_CLIENT_ID;
const dgClientSecret = process.env.DG_CLIENT_SECRET;

const host = process.env.HOST;

const pdfService = new PDFServiceSDK(clientId, clientSecret, host, dgClientId, dgClientSecret);

If you don't know the host, it is https://na1.fusion.foxit.com.

Methods Supported

  • conversion(inputPath, outputPath) - general conversion method
  • excelToPDF, htmlToPDF, imageToPDF, pdfToExcel, pdfToHTML, pdfToImage, pdfToPowerpoint, pdfToText, pdfToWord, powerpointToWord, textToPDF, wordToPDF - all take an inputPath and outputPath argument
  • url_to_pdf(url, outputPath) - convert a URL to pdf
  • extractPDF(inputPath, outputPath, type (one of TEXT, IMAGE, PAGE), page_range) - extracts either text, images (zip), or pages (new pdf)
  • download(docId, outputPath) - given a document id and path, will stream the data down
  • upload(path) - upload a document and return a path
  • compress(inputPath,outputPath,compressionLevel) - compresses a PDF, default level is LOW
  • linearize(inputPath,outputPath) - linearizes a PDF
  • flatten(inputPath,outputPath) - flattens a PDF
  • combine(inputPaths[], outputPath, options) - combines a set of PDFs
  • removePassword(inputPath,outputPath,password) - removes password
  • protectPDF(input_path, output_path, config) - modifies permissions for a PDF - see API ref for details on the config param
  • splitPDF(inputPath,outputPath,pageCount) - splits a PDF into pageCount new PDFs. Returns a zip of the PDFs.
  • manipulatePDF(inputPath, outputPath, operations) - performs multiple operations for a PDF - see API ref for details on the operations param
  • docgen(inputPath,outputPath,data) - document generation using data

To Do:

  • Make output path optional and just return the doc id
  • Make checking a task public and a utility pollTask to handle repeating (this and the previous two methods would let devs chain calls)

History

| Date | Change | |------|-----------| | 8/11/2025 | Added splitPDF, manipulatePDF, compare, docgen. | | 8/7/2025 | Added remove password. Corrected wrong method names above. Removed unused var in Linearize. Added protectPDF | | ??? | Initial release |