Re: processing pdfs to images
Re: processing pdfs to images
- Subject: Re: processing pdfs to images
- From: Kieran Kelleher <email@hidden>
- Date: Thu, 24 Oct 2013 10:56:19 -0400
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"/d.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 <email@hidden> 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 (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden