May 22, 2009

extracting Jpegs from PDF and push them to iPhoto album



When I try to read pdf over hundred pages on iPhone, it takes too much memory and hung up. So I've been trying to save a pdf file as jpegs to read it on iPhone. It was not a straight forward, but finally I think I got the best way (for me).

This is what I wanted to do.
1) select pdf file
2) create a new album on iPhoto whose name is same as pdf (without an extension .pdf)
3) extract each page as jpeg
4) push jpeg files into the new album

The most difficult part was (2), getting new album name. I tried to do it in automator way, but finally I came to create name using outer script (in this case, python).

Sorry the picture of UI is in Japanese, but they are
1. Select Finder item
2. Set variable (to variable 'filename')
3. Execute Shell Script
4. Set variable (to variable 'albumname')
5. Get variable ('filename')
6. Render pdf pages into images
7. Change Finder item name (to add sequential numbers to the file names)
8. Load files onto iPhoto(usinge variable 'albumname')
*Sorry: I don't have English version so names of blocks are not precisely translated.

Now, I can read them using iPhone/iPod .... Ooops!! All images are shrinked while loading via iTune and I can't read the letters. Damn!

No comments: