• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: processing pdfs to images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: processing pdfs to images


  • Subject: Re: processing pdfs to images
  • From: Michael Hast <email@hidden>
  • Date: Thu, 24 Oct 2013 16:25:09 -0700

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"/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


--
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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >processing pdfs to images (From: Theodore Petrosky <email@hidden>)
 >Re: processing pdfs to images (From: Kieran Kelleher <email@hidden>)

  • Prev by Date: Re: processing pdfs to images
  • Next by Date: WebObjects Deployment on Linux - queer out of memory exception
  • Previous by thread: Re: processing pdfs to images
  • Next by thread: WebObjects Deployment on Linux - queer out of memory exception
  • Index(es):
    • Date
    • Thread