Skip to main content

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

Project description

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 pdf_service_sdk
import os 

CLIENT_ID = os.getenv("CLIENT_ID")
CLIENT_SECRET = os.getenv("CLIENT_SECRET")

sdk = pdf_service_sdk.PDFServiceSDK( client_id=CLIENT_ID,
                                     client_secret=CLIENT_SECRET)

Generally speaking, moist methods handle upload and download for you, checking the task and so forth so you don't need it. For example:

sdk.word_to_pdf(input_path="../../inputfiles/input.docx",output_path="../../output/output_from_sdk.pdf")
print("Conversion completed successfully. Check the output file at ../../output/output_from_sdk.pdf")

# Handle it simpler
sdk.conversion(input_path="../../inputfiles/input.docx",output_path="../../output/output_from_sdk_v2.pdf")
print("Conversion (second version) completed successfully. Check the output file at ../../output/output_from_sdk_v2.pdf")

Methods Supported

  • conversion(input_path, output_path) - general conversion method
  • excel_to_pdf, html_to_pdf, image_to_pdf, pdf_to_excel, pdf_to_html, pdf_to_image, pdf_to_powerpoint, pdf_to_text, pdf_to_word, powerpoint_to_word, text_to_pdf, word_to_pdf - all take an input_path and output_path argument
  • url_to_pdf(url, output_path) - convert a URL to pdf
  • extract(input_path, output_path, type (one of TEXT, IMAGE, PAGE), page_range) - extracts either text, images (zip), or pages (new pdf)
  • download(doc_id, output_path) - given a document id and path, will stream the data down
  • upload(path) - upload a document and return a path
  • compress(input_path,output_path,compressionLevel) - compresses a PDF, default level is LOW
  • linearize(input_path,output_path) - linearizes a PDF
  • flatten(input_path,output_path) - flattens a PDF
  • combine(input_path[], output_path, config) - combines an array of file paths

To Do:

  • remove-password, protect, manipulate, split, compare
  • 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
7/23/2025 Just updated the doc to reflect combine being added.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdfservices_sdk_foxit-0.0.2.tar.gz (913.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdfservices_sdk_foxit-0.0.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file pdfservices_sdk_foxit-0.0.2.tar.gz.

File metadata

  • Download URL: pdfservices_sdk_foxit-0.0.2.tar.gz
  • Upload date:
  • Size: 913.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for pdfservices_sdk_foxit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9ae76ecfa3296b080e3e314c8b2c20bc14015bb4cf1e473736e797e818820940
MD5 97b4d96f89a38941ca3426e960d7cdd7
BLAKE2b-256 7fa803aa9e246715f97b281956c8b9f72d30c48c02911543758c6bd53207c7e5

See more details on using hashes here.

File details

Details for the file pdfservices_sdk_foxit-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pdfservices_sdk_foxit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fad8815987e371643d4ba009d5b57f68faa9831981cb0a67f11c0b241f7f036
MD5 5dda172022648a162673b006db21b1fe
BLAKE2b-256 e5f7fa52474552453287e5a483347c1fec2cbc9bbf2b71d5813149ac6d0d2c10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page