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

To Do:

  • remove-password, protect, combine, 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)

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.1.tar.gz (913.7 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.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdfservices_sdk_foxit-0.0.1.tar.gz
  • Upload date:
  • Size: 913.7 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.1.tar.gz
Algorithm Hash digest
SHA256 f4385c5d4c31e9df45bdfd98bccf4771fc52bb8581e725857e6d8419fb744b65
MD5 ff2987615362d07973f6b9295d23b324
BLAKE2b-256 d6cc579998616d4534108fcd722ea620cbbb937828832763195b40d917ffbaac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pdfservices_sdk_foxit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b2335fd3b303fc2f490b0a9b64c3082ff5891a0224535b5d43dd75369ea2d41
MD5 2d5f24d7e49782c885169b8224d171ac
BLAKE2b-256 ecf9c9f0cd13397f15f38c8bb7d478d1a393c91d1b732d35c4cbc73f9a9fc9e1

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