You are here

README.txt in PDF to ImageField 6.2

Same filename and directory in other branches
  1. 6 README.txt
  2. 7 README.txt
  3. 7.2 README.txt
= PDF To ImageField =

The PDF To ImageField module provides automatic conversion of 
uploaded PDF files to images. 
It can be used either to create a snapshot of the front page,
or to generate a gallery of images from each page in the document.

The module is implemented as CCK widget for FileField where PDFs are uploaded to.
It places generated images into a CCK ImageField on the same content type.

@author Updated by dman 2011
@author Original module by Peritus 2010

== Requirements ==

  CCK, Filefield, Imagefield modules.
  ImageAPI + Imagemagick
  Imagemagick support on your server.

== Installation == 

Once the module is enabled, check your site status at /admin/reports/status
You should see a message that will tell you if your system is ready to run.
If not, you need to check the requirements, and the ImageMagick settings
at admin/settings/imageapi.
See the ImageAPI project docs for troubleshooting that.

If ImageMagick appears to be available but still does not convert PDFs, it 
could be it wasn't installed with 'Ghostscript' libraries or other required 
dependencies. You'l have to go to the ImageMagick forums for help with that.

== Configuration ==

- First, add an imagefield on your chosen content type. This is where the 
  generated images will be stored.
- Set the allowed fields to 1 if you just want a cover page, or 'unlimited' 
  if you want all pages to be generated.
- Next add a filefield to your chosen content type and choose 
  'pdf_to_imagefield' as the renderer.
- When configuring this field, you will be required to link the uploaded file
  field with the target image field.
- You can add imagecache handling to the imagefield rendering as normal to 
  adjust the size of the results and how they display on the page.


== Processing ==

Processing of PDF may take some time.
Larger documents use the 'batch' process to generate each page.

== Use of ImageMagick ==

Actual processing is performed using ImageAPI's ImageMagick toolkit.
GD is not supported.

=== Dev notes ===

The only candidate function from ImageAPI which may perform PDF to image 
conversion is _imageapi_imagemagick_convert(). Unfortunately, it can't pass 
arguments to 'convert' tool of ImageMagick *before* source file specification, 
which is needed to change default density of 100x100dpi. 
For this reason, a custom function is included in the module's source:

function pdf_to_imagefield_convert_pdf($source, $dest, $args = array(), $extra = array()) {
  . . .
}

== Quickstart ==

There is a drush make file and a 'Features' demo example you can use to help set
up and try this functionality immediately.

=== Use drush make to fetch all required modules ===

- If you have "drush" and "drush make" :
- Change to a working directory you want to install a new site into.
- Get the stub makefile from http://drupalcode.org/project/pdf_to_imagefield.git/blob_plain/refs/heads/6.x-2.x:/pdf_to_imagefield_demo.make.stub
- Run
    drush make --working-copy pdf_to_imagefield.make.stub
  This will download all the dependencies required to run pdf_to_imagefield 
  and the demo feature pdf_document.
- Install the Drupal site and configure the database as usual.

=== Use the Feature to auto-configure a content type ==

- Enable the "PDF Document" feature through module admin, or via
    drush en pdf_document
- Check your site status at /admin/reports/status to ensure ImageMagick works.
- A new content type will be available at /node/add/document
  Adding a PDF file to it should create an image when the node is saved
   (not on preview)
  

File

README.txt
View source
  1. = PDF To ImageField =
  2. The PDF To ImageField module provides automatic conversion of
  3. uploaded PDF files to images.
  4. It can be used either to create a snapshot of the front page,
  5. or to generate a gallery of images from each page in the document.
  6. The module is implemented as CCK widget for FileField where PDFs are uploaded to.
  7. It places generated images into a CCK ImageField on the same content type.
  8. @author Updated by dman 2011
  9. @author Original module by Peritus 2010
  10. == Requirements ==
  11. CCK, Filefield, Imagefield modules.
  12. ImageAPI + Imagemagick
  13. Imagemagick support on your server.
  14. == Installation ==
  15. Once the module is enabled, check your site status at /admin/reports/status
  16. You should see a message that will tell you if your system is ready to run.
  17. If not, you need to check the requirements, and the ImageMagick settings
  18. at admin/settings/imageapi.
  19. See the ImageAPI project docs for troubleshooting that.
  20. If ImageMagick appears to be available but still does not convert PDFs, it
  21. could be it wasn't installed with 'Ghostscript' libraries or other required
  22. dependencies. You'l have to go to the ImageMagick forums for help with that.
  23. == Configuration ==
  24. - First, add an imagefield on your chosen content type. This is where the
  25. generated images will be stored.
  26. - Set the allowed fields to 1 if you just want a cover page, or 'unlimited'
  27. if you want all pages to be generated.
  28. - Next add a filefield to your chosen content type and choose
  29. 'pdf_to_imagefield' as the renderer.
  30. - When configuring this field, you will be required to link the uploaded file
  31. field with the target image field.
  32. - You can add imagecache handling to the imagefield rendering as normal to
  33. adjust the size of the results and how they display on the page.
  34. == Processing ==
  35. Processing of PDF may take some time.
  36. Larger documents use the 'batch' process to generate each page.
  37. == Use of ImageMagick ==
  38. Actual processing is performed using ImageAPI's ImageMagick toolkit.
  39. GD is not supported.
  40. === Dev notes ===
  41. The only candidate function from ImageAPI which may perform PDF to image
  42. conversion is _imageapi_imagemagick_convert(). Unfortunately, it can't pass
  43. arguments to 'convert' tool of ImageMagick *before* source file specification,
  44. which is needed to change default density of 100x100dpi.
  45. For this reason, a custom function is included in the module's source:
  46. function pdf_to_imagefield_convert_pdf($source, $dest, $args = array(), $extra = array()) {
  47. . . .
  48. }
  49. == Quickstart ==
  50. There is a drush make file and a 'Features' demo example you can use to help set
  51. up and try this functionality immediately.
  52. === Use drush make to fetch all required modules ===
  53. - If you have "drush" and "drush make" :
  54. - Change to a working directory you want to install a new site into.
  55. - Get the stub makefile from http://drupalcode.org/project/pdf_to_imagefield.git/blob_plain/refs/heads/6.x-2.x:/pdf_to_imagefield_demo.make.stub
  56. - Run
  57. drush make --working-copy pdf_to_imagefield.make.stub
  58. This will download all the dependencies required to run pdf_to_imagefield
  59. and the demo feature pdf_document.
  60. - Install the Drupal site and configure the database as usual.
  61. === Use the Feature to auto-configure a content type ==
  62. - Enable the "PDF Document" feature through module admin, or via
  63. drush en pdf_document
  64. - Check your site status at /admin/reports/status to ensure ImageMagick works.
  65. - A new content type will be available at /node/add/document
  66. Adding a PDF file to it should create an image when the node is saved
  67. (not on preview)