New: PDF to E-Invoice for Factur-X/ZUGFeRD, and PDF to PDF/A for archive-ready PDF/A-3b.

How PDF.co Uses PyMuPDF for Everyday Document Work

You’ve finished the report. Now you need to shrink the PDF, create a preview, combine it with a few supporting files, or pull out the pages someone actually needs. Those small tasks add up—especially when you’re doing them for every document. PDF.co lets you build them into your workflow through a hosted API, and its compression engine is one example of Artifex technology at work.

Behind PDF.co is Artifex, the company that maintains the platform and is also behind MuPDF and PyMuPDF. PyMuPDF brings MuPDF’s document capabilities into your Python application. PDF.co gives you document operations through web requests and workflow integrations.

Four PDF tasks you can take off your to-do list

Make a PDF easier to share

A big PDF can slow down a handoff and take up extra storage. PDF.co’s /v2/pdf/compress endpoint gives you compression presets and image-quality controls to help bring the size down. Try it with a document that’s typical of your work, then check both the size and readability of the result. Stronger image compression can mean less visual detail, and you won’t get the same reduction—or necessarily any reduction—from every PDF.

PDF Compress API documentation

Convert between PDFs and images

Need a preview of a PDF page? Or a PDF made from a collection of images? PDF.co can render PDFs as PNGs and turn JPG, PNG, and TIFF images into PDFs through its hosted service. PyMuPDF also handles rendering and conversion in Python.

PDF-to-PNG documentation

Image-to-PDF documentation

Bring your PDFs together

A report here, an appendix there, and a handful of supporting PDFs: that’s a lot to send separately. PDF.co’s PDF Merge operation combines multiple PDFs into one document. Add it to your application or automation, and you have a repeatable way to assemble the package without opening and combining the files by hand.

PDF Merge documentation

Send along just the pages you need

Your recipient may need one section, not the whole packet. PDF.co’s page-based split operation lets you specify page numbers or ranges and create separate output files. You can use those files in different steps of your workflow. Just check the endpoint’s page-selection syntax when you build the request.

Page splitting documentation

What compression looks like in practice

Follow along in our Zapier compression tutorial as we shrink Canines.pdf from 1.8 MB to an 846 KB file. The workflow takes a PDF from Google Drive, compresses it with PDF.co, and saves the result back to Drive. Here’s the before and after, with file sizes as displayed in the tutorial:

Input: Canines.pdf — 1.8 MB.

Before compression: Google Drive shows Canines.pdf at 1.8 MB.

Output: compressed_file.pdf — 846 KB.

After compression: Google Drive shows compressed_file.pdf at 846 KB.

See the compression workflow and its before-and-after screenshots

Should you use a Python library or a hosted API?

Use PyMuPDF when you want document processing inside your own Python application. You import the library and run it in an environment you control, with direct access from your code. That control also comes with work: your team handles installation, updates, compute resources, and the workflow around it.

Use PDF.co when you want your application or integration to send the job to a hosted service. PDF.co runs the document-processing service; your workflow supplies the files, handles errors, and saves the results. You can make those requests from Python, another language, or a supported automation platform. A Python client calls the hosted API.

Start with two questions: where do you want the processing to happen, and how much of the system do you want to manage? Then compare the operations and settings your workflow needs.

Explore the PyMuPDF library documentation

Try it with your own workflow

This Zapier tutorial walks you through taking a PDF from Google Drive, compressing it with PDF.co, and saving the result back to Drive. Keep the current PDF Compress documentation handy for API parameters and code examples. Save the output in your own storage, then compare its size and readability with the original.

Follow the PDF.co compression tutorial

Check the PDF Compress API documentation

We’re working to bring more of Artifex’s document technology to PDF.co.