Skip to main content

Thumbor / PDF Preview

This extension provides preview for PDF.

Features

Given a PDF URL return preview image of first page

Installation

  • Prerequisite: Following system libraries are required:

  • Install using pip

    $ pip install tc_pdf
  • Register the extension within Thumbor’s configuration file

    COMMUNITY_EXTENSIONS = [
        'tc_pdf',
        ...
    ]
  • Launch thumbor with the Thumbor Community custom application:

    $ thumbor -a tc_core.app.App

Usage

tc_pdf handler route requires /pdf/ in URL after all filters but before the resource URL part e.g.

http://<thumbor_server>/unsafe/240x240/smart/pdf/localhost:8000/media/document/test.pdf

If you are using libthumbor to generate URLs then you can use this patch for CryptoURL class and then use it like this:

from crypto import CryptoURL

crypto = CryptoURL(key='my-security-key')

encrypted_url = crypto.generate(
    width=300,
    height=200,
    smart=True,
    image_url='/path/to/my/pdf_file.pdf',
    pdf=True, # <-- Pass this
)

Metadata

Release files for tc-pdf 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tc-pdf 1.0.0
File Size Uploaded Provenance Actions
tc_pdf-1.0.0.tar.gz 6.1 kB Without provenance Details for tc_pdf-1.0.0.tar.gz

Release files / tc_pdf-1.0.0.tar.gz

Download URL tc_pdf-1.0.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb4a06f054a8a9651a83f20c2ae09531dd60877b090eb3c31dd22e282df19a9b
BLAKE2b-256 checksum
How to use checksums
31237ca3317f6bf78253603006f1eca7134d99f9e520f68cbc03b8c78844bde7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/6.6.0 pkginfo/1.9.6 requests/2.30.0 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.10.4

Security for tc-pdf 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page