Passport Loader
PassportPDF using Python

Learn How to Use PassportPDF REST API with Python

PassportPDF API is a REST API that lets you perform complex operations on documents and images easily. This tutorial will show you how to use it with Python.

PassportPDF API endpoints

PassportPDF API contains a lot of endpoints that can be used to do all sorts of processing on documents. Here’s a list of all the available endpoints:

  • Config
  • DocumentAI
  • Document
  • DocuVieware
  • Image
  • PassportManager
  • PassportPDFApplicationManager
  • PDF

For each endpoint, there are several utility functions that you can use. For example, for dealing with documents, you can use the functions from Document endpoint, such as:

  • DocumentClose
  • DocumentGetPreview
  • DocumentLoad
  • DocumentLoadFromURI
  • DocumentLoadMultipart

If you’re working on PDF documents specifically, then the PDF endpoint offers a variety of tools that allow you to:

  • Annotate PDF documents.
  • Convert to grayscale PDFs.
  • Convert to PDF/A.
  • Insert a new page in your PDF file.
  • Merge several PDF files into one.
  • OCR a PDF document.
  • Read barcodes.

And many other utilities can be found in the PassportPDF API reference page.

Industry use cases of PassportPDF using Python

We have created some Python tutorials that show you how to use the PassportPDF API with Python. These tutorials are inspired by real-world applications that many industries need.

1. PassportPDF for extracting key information from invoices

The goal of this tutorial is to extract key information from invoices (invoice number, phone number, total amount, …) and then save them to an Excel sheet. All of this will be done automatically through Python.

We take a document like this as input: 

And in the output, we will get all the key information extracted and saved into an Excel sheet: 

The full tutorial can be found here.

2. Extracting barcode information from PDF documents

In this second tutorial, we used PassportPDF to extract information that was embedded in a barcode. We had the document below as an input:

In the response, we got the following output:

As you can see, we get all the necessary information regarding the barcode. We got the barcode type, its symbology, its coordinates, and of course, the embedded data. In this case, the data is https://passportpdf.com/.

The full tutorial can be found here.

Final thoughts

You can use the PassportPDF API with Python to perform all sorts of operations on your documents. For more information about what you can do with this API, go to PassportPDF.

 

Cheers,

Nour

Share This Story, Choose Your Platform!

Related Posts