This module lets you show a preview of PDF files uploaded through FileField.
This module uses ImageMagick to extract the first page of a PDF file to a JPEG image which is used as PDF preview link to the file.
If imagecache module is available, you can select any imagecache preset for the PDF preview image link.
Instead of convert pdf files onto a set of images like PDF to ImageField does, and lost any connection to the PDF file, PDFPreview extract only the first page and uses it as link to PDF file.
The images are stored on a configurable folder inside your files folder, so it's fully compatible with multisite installations. If the image is missing at display moment it will be created.
Motivation:
In the company I work for, we are developing a lot of drupal sites for town council web pages. Most of them use PDF files as the main way to publish content which is delivered in some other ways such as paper. Sometimes theese documents are simply text documents, but other are colorful documents like local publications. The way we worked until now was taking a screenshot of the first page, and upload it as attachment to the same node with the pdf file, and write some ugly code to theme the link. This module permits "upload and forgive" of pdf files.
I've found a module that converts pdf pages to a set of images, but this isn't what we need.
The sandbox page of this module is:
http://drupal.org/sandbox/juanjo_dv/1158034
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | pdfpreview-1161358-16.patch | 8.53 KB | tim.plunkett |
Comments
Comment #1
1websitedesigner commentedSounds like a very useful module. Just putting a proposal together to include this kind of work, so haven't tested it yet, but thanks for creating it!
Comment #2
tr commentedRemove this from your .info file:
Your code needs to be changed to conform to Drupal coding standards. Please read http://drupal.org/coding-standards There are too many problems to mention. Pay special attention to your use of spaces.
The .module and .install files should not end with
?>Translations are no longer supposed to be bundled with modules. Please remove your translations folder and its contents.
In your documentation comments, "Implementation of" should be "Implements"
Menu titles and descriptions should *not* be wrapped in t():
On the other hand, form titles and descriptions *should* be wrapped in t():
Running the Coder module on your project will catch many of these issues.
I didn't try to install the module to see if it works.
Comment #3
juanjo_vlc commentedHi,
I've just run Coder on the module and make suggested changes.
But I don't know if the correct way to document hook implementations is the way TR suggests "Implements" or the way Coder suggests "Implementation of" and other modules use.
Comment #4
tr commentedhttp://drupal.org/node/1354#hookimpl
Comment #5
juanjo_vlc commentedOk, I left the coments as you said.
Comment #6
juanjo_vlc commentedHi, have you taked another look?
Comment #7
eL commentedIt will be great module. Thanks for it!
May be, it will be better to impolement this in ImageField too. Because, I would like to have one field for images and PDF thumbnails, not to have one field for images and second field for PDF files with thumbnail.
Comment #8
r.aubin commentedThis module looks great. Installed and ran some initial tests and it worked perfectly. Quick, easy first page image generation. Can't wait to see an official release. Great work!
Comment #9
juanjo_vlc commentedThanks for your comments, I still waiting for the promotion to a full project.
Comment #10
juanjo_vlc commentedComment #11
juanjo_vlc commentedThere are some people waiting to the promotion, please, take a look as soon as possible.
Comment #12
eewing commentedWonderful project! This is exactly what I need. It would really streamline the uploading of PDF newsletters. Will there be a D7 version of this!?
Comment #13
sreynen commentedI reviewed the code and documented issues in the project issue queue. They should all be easy to address, but only the LICENSE.txt issue is important enough to wait on approving this application.
Comment #14
sreynen commentedI just noticed another bug, added to the issue queue.
Comment #15
sreynen commentedLooks like juanjo_dv has addressed all issues I found.
Comment #16
tim.plunkettI agree that this module is ready for a release, even though it has some coding standards issues.
Attached is a patch that will handle most of the problems for you.
I've granted you full project creation rights. Use this ability carefully!
Thank you for your patience.
Comment #17
juanjo_vlc commentedThank for your review, and for your patch.
I see that one of my weakiest points is quoting.
I'm goint to code a loop for writting 10.000 times " string literal: simple quote, string with variables or escape characters: double quote"
Done ;)