How to convert TIFF files to PDF using Python

Table of contents

    Convert TIFF images to PDFs for universal compatibility, web integration, and enhanced security. This tutorial demonstrates programmatic TIFF-to-PDF conversion using Python and Nutrient API for document-heavy workflows that require standardized formats.
    How to convert TIFF files to PDF using Python
    Summary

    Convert TIFF files to PDF using our TIFF-to-PDF Python API. Create a free account, get API credentials, and implement conversion using the requests library. Combine with 30+ other API tools for merging, OCR, and watermarking.

    Convert TIFF files to PDF using our TIFF-to-PDF Python API. Start with 200 free credits — no payment required. Different operations consume different credit amounts, so the number of PDF documents you can generate will vary. Create a free account(opens in a new tab) to get your API key.

    Why convert TIFF to PDF?

    Converting TIFF files to PDF is essential for document workflows that require standardized, shareable formats. Common use cases include:

    • Universal compatibility — Convert TIFF images to PDFs that open on any device without specialized software, ensuring recipients can view documents regardless of platform.
    • Reduced file sizes — Multipage TIFF files often compress better as PDFs, reducing storage costs and improving transfer speeds for document-heavy workflows.
    • Enhanced security — Add password protection, digital signatures, and encryption when converting to PDF, securing sensitive scanned documents or medical records.
    • Web integration — PDFs render consistently in browsers, while TIFFs require plugins or downloads, improving user experience for web-based document viewers.
    • Archival compliance — Many industries require PDF/A format for long-term document preservation, making TIFF-to-PDF conversion critical for regulatory compliance.

    The TIFF-to-PDF API automates this process in your workflow.

    Nutrient DWS Processor API

    Converting TIFF to PDF is one of 30+ operations available through our PDF API tools. Combine TIFF conversion with other tools for complex workflows:

    Your account includes access to all PDF API tools.

    Step 1 — Creating a free account on Nutrient

    Go to our website(opens in a new tab), where you’ll see the page below, prompting you to create your free account.

    Free account at Nutrient API

    Once you’ve created your account, you’ll see a page showing an overview of your plan details.

    You’ll start with 200 credits to process and can access all our PDF API tools.

    Step 2 — Obtaining the API key

    After you’ve verified your email, you can get your API key from the dashboard. In the menu on the left, click API keys. You’ll see the following page, which is an overview of your keys.

    Convert TIFF to PDF Python API Key

    Copy the Live API key — you’ll need it for the TIFF to PDF API.

    Step 3 — Setting up folders and files

    For this tutorial, use VS Code as your code editor. Create a folder called tiff_to_pdf and open it in VS Code. Create two folders inside tiff_to_pdf called input_documents and processed_documents.

    Paste your TIFF file inside the input_documents folder. You can use our demo image as an example.

    In the root folder, create a file called processor.py. This is the file where you’ll keep your code.

    Your folder structure will look like this:

    tiff_to_pdf
    ├── input_documents
    | └── image.tiff
    ├── processed_documents
    └── processor.py

    Step 4 — Writing the code

    Open the processor.py file and paste the code below into it:

    import requests
    import json
    response = requests.request(
    'POST',
    'https://api.nutrient.io/build',
    headers = {
    'Authorization': 'Bearer YOUR_API_KEY_HERE'
    },
    files = {
    'file': open('input_documents/input.tiff', 'rb')
    },
    data = {
    'instructions': json.dumps({
    'parts': [
    {
    'file': 'file'
    }
    ]
    })
    },
    stream = True
    )
    if response.ok:
    with open('processed_documents/result.pdf', 'wb') as fd:
    for chunk in response.iter_content(chunk_size=8096):
    fd.write(chunk)
    else:
    print(response.text)
    exit()

    Make sure to replace YOUR_API_KEY_HERE with your API key.

    Code explanation

    The code imports the required packages and creates the request with instructions for converting the TIFF file to PDF.

    It calls the API using the requests module and checks the response status. If successful, it stores result.pdf in the processed_documents folder.

    Output

    To execute the code, run the command below:

    Terminal window
    python3 processor.py

    On successful execution, you’ll see the new PDF file in the processed_documents folder. The folder structure should look like this:

    tiff_to_pdf
    ├── input_documents
    | └── document.tiff
    ├── processed_documents
    | └── result.pdf
    └── processor.py

    Additional resources

    Explore more ways to work with Nutrient API:

    Conclusion

    This tutorial showed how to convert TIFF files to PDF in Python using our TIFF-to-PDF API.

    Integrate TIFF conversion into your existing applications. Use the same API token for other operations like merging documents, adding watermarks, and more. Sign up(opens in a new tab) for a free trial.

    FAQ

    Does the API preserve image quality when converting TIFF to PDF?

    Yes. The API maintains the original TIFF image quality during conversion. Multipage TIFF files are automatically converted to multipage PDFs, with each page preserved at its original resolution and color depth.

    Can I convert multiple TIFF files into a single PDF document?

    Yes. Upload multiple TIFF files with different parameter names and reference them in the parts array. This allows you to merge multiple TIFF images (and other formats) into one consolidated PDF document in a single API call.

    What Python libraries do I need to use the TIFF-to-PDF API?

    You only need the requests library for making HTTP calls and the json library (built into Python) for formatting instructions. Install requests using pip install requests. No additional image processing libraries are required.

    Can I apply additional processing after converting TIFF to PDF?

    Yes. The Nutrient API supports chaining multiple operations in a single request. Use the actions array to convert TIFF files and then apply operations like watermarking, OCR, compression, or encryption to the resulting PDF document.

    Jonathan D. Rhyne

    Jonathan D. Rhyne

    Co-Founder and CEO

    Jonathan joined PSPDFKit in 2014. As Co-founder and CEO, Jonathan defines the company’s vision and strategic goals, bolsters the team culture, and steers product direction. When he’s not working, he enjoys being a dad, photography, and soccer.

    Explore related topics

    FREE TRIAL Ready to get started?