This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

The main goal of this product is to allow PDF into ImageFields in Plone. It uses code written by David Brenneman for collective.pdfpeek.

Install

Just add the following lines in your buildout:

collective.pdfpeek
collective.pdftransform

You must install pdftransform with the quick installer (no need to install pdfpeek, but it must be in the buildout as we use its methods)

Using pdftransform in your site

collective.pdftransform adds a pdf_to_image transform in Plone portal_transform. As transforms can not be used with FileField (or at least I did not find how …) it also provides a method in utils called update_form. You can use it in the post_validate method of your Archetype objects.

Here is an example (from Products.plonehrm, the Employee Archetype object):

...
from collective.pdftransform.utils import update_form
...
class Employee(BaseFolder):
    ...

    security.declarePrivate('post_validate')
    def post_validate(self, REQUEST, errors):
        update_form(self, REQUEST)

    ...

With this, all files submitted in the edit form, if they are PDF, are transformed into jpg files. You can specify an extra argument in update_form which is the list of fields, for example, if we had written this:

security.declarePrivate('post_validate')
def post_validate(self, REQUEST, errors):
    update_form(self, REQUEST,
                ['portrait_file', 'idScan_file'])

only the files submitted in the portrait and idScan fields would have been transformed.

You can also use the validator called isValidImageOrPDF in your Image fields.

Changelog

0.5 (2015-08-27)

  • Code cleanup. [maurits]

0.4 (2013-06-04)

  • Do not explicitly require collective.pdfpeek 1.2, but make that a minimum. [maurits]

0.3 (2012-10-30)

  • Patched pdfpeek to use the default 1.2 release. [vincent]
  • Allow setting PDF resolution in update_form. [vincent]

0.2 (2010-06-21)

  • Bugfix in utils/is_transformable_pdf. [vincent]

0.1 (2010-05-19)

  • added translations for french and dutch. [vincent]
  • updated the validator to return an error if the PDF file can not be transformed. [vincent]
  • added is_transformable_pdf in utils, tells if the PDF file uploaded can be transformed with pdf_to_image. [vincent]
  • added validator called ‘isValidImageOrPDF’ that checks that the submitted if is a PDF or an image (except BMP images as it can cause problems). [vincent]
  • added update_form in utils, that can be used in the post_validate method of your Archetype objects. [vincent]
  • Added transform to the portal_transform. [vincent]
Release History

Release History

0.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
collective.pdftransform-0.5.tar.gz (17.5 kB) Copy SHA256 Checksum SHA256 Source Aug 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting