Hi Ted:

Recently we used PDF Box (http://pdfbox.apache.org/) to convert PDF's to images within the Java application. But command line works as well.

Michael

On 10/24/2013 7:56 AM, Kieran Kelleher wrote:
Hi ted,

Here is a script that shows how using two terminal commands that should be 
available via macports. This should give you enough hints to achieve what you 
need hopefully :)

Regards, kieran

------------------------------------------------------------------------------------

#!/bin/bash

# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick

PDF=$1

echo "Processing $PDF"
DIR=`basename "$1" .pdf`

mkdir "$DIR"

echo '  Splitting PDF file to pages...'
pdftk "$PDF" burst output "$DIR"/%04d.pdf
pdftk "$PDF" dump_data output "$DIR"/metadata.txt

echo '  Converting pages to JPEG files...'
for i in "$DIR"/*.pdf; do
   convert -colorspace RGB -interlace none -density 300x300 -quality 100 "$i" 
"$DIR"/`basename "$i" .pdf`.jpg
done

echo 'All done'

------------------------------------------------------------------------------------


On Oct 24, 2013, at 10:39 AM, Theodore Petrosky <tedp...@yahoo.com> wrote:

I was hoping to find a 'How to' on this. I need to add attachments to my app. 
Just adding the pdfs is pretty straight forward. Since they are only uploaded 
pdfs, I wanted to process them to some form of tiff to have a thumbnail 
available in various sizes and resolutions.

Is there a 'best practice' of this. I started looking at the wonder reference 
and I find all kinds of stuff:

ImageMagickCommandlineMetadataParser
ImageMagickImageProcessor
IERImageProcessor
IERThumbnailer

Does anyone have any example code? i feel as though i am just flailing around!

Ted
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com

This email sent to kelleh...@gmail.com


  _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/mhast%40desertsky.com

This email sent to mh...@desertsky.com


--
Tel: (602) 279-4600 ext: 635
Desert Sky Software: www.desertsky.com
    Specializing in the Development and Hosting of
    e-Business Applications.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to