Skip to main content

collective.pdfjs - Plone integration for Mozilla’s JavaScript PDF reader

Introduction

This product adds pdf.js support for Plone.

Pdf.js is a JavaScript library for rendering PDF documents in the canvas, without using external plugins; only JavaScript is needed.

This product will make the JavaScript library available as a resource, and add a new view for the File content type.

Please note that pdf.js is still under heavy development; as such:

  • a modern browser is required;

  • not all PDFs may be rendered correctly, or at all;

Installation

Using zc.buildout add collective.pdfjs to the list of eggs to install:

[instance]
recipe = plone.recipe.zope2instance
...
eggs =
    ...
    collective.pdfjs

Re-run buildout, e.g. with:

$ ./bin/buildout

Restart your plone instance and install this addon.

Usage

If the view detects a PDF file, it will attempt to render it inline using pdf.js. If the user browser doesn’t have JavaScript enabled, it will embed any available PDF reader plugin (Acrobat’s, Google Chrome native, etc) instead.

Additional information

Currently, the whole document is downloaded and each page rendered incrementally inside the canvas. This means that big files on slow connections will take a while before displaying; you might want to switch to the standard view in this case.

Source Code and Contributions

If you want to help with the development (improvement, update, bug-fixing, …) of collective.pdfjs this is a great idea!

The code is located in the github collective.

You can clone it or get access to the github-collective and work directly on the project.

Contributors

Changelog

1.0.5 (2024-07-26)

  • Better CSS scoping for toolbar styles, to reduce side effects on other layout elements.

1.0.4 (2023-02-27)

  • Add missing dependency on plone.app.upgrade [MrTango]

1.0.3 (2023-02-27)

  • Depend only on Products.CMFPlone not on Plone package [MrTango]

1.0.2 (2022-11-04)

  • Fix manifest file

1.0.1 (2022-11-04)

  • hide upgrade steps in quickinstaller [MrTango]

1.0 (2022-11-04)

  • Overhaul to the most recent pdfjs release including its recent viewer.js [jensens, benniboy]

  • make it compatiple with Plone 6 [MrTango]

0.4.2

  • Tests: added a test on availableLayouts This fails because the view is not present, no idea why. Must recheck.

  • Added human name for the view, after a suggestion by Marcel

0.4.0

  • Tests: basic code coverage

  • Reasonably minified pdf.js

0.3.6

  • Minified pdf.min.js

  • Tested on Chrome and Firefox

0.2.2

  • Renders the Tracemonkey PDF

Release files for collective.pdfjs 1.0.5

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

Source distribution (sdist)

Source distribution for collective.pdfjs 1.0.5
File Size Uploaded
collective.pdfjs-1.0.5.tar.gz 486.0 kB Details

Release files / collective.pdfjs-1.0.5.tar.gz

Download URL collective.pdfjs-1.0.5.tar.gz
Size 486.0 kB
Tags Source
SHA-256 checksum
How to use checksums
71eb996c7b38cec851019d28bd3c877cdf7d7b9c3e5b43721d2fb86b29458324
BLAKE2b-256 checksum
How to use checksums
1b426efc58c889ca077c63f70c6fc5acfc7052d7912e5a6a4cfda66fad0b61e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/6.0.0 pkginfo/1.7.1 requests/2.28.1 requests-toolbelt/0.10.0 tqdm/4.62.0 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

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