Converting PDF to JPG on YDL 6.1

General discussion Forum. All YDL related question which are not Install or Beginner questions.

Converting PDF to JPG on YDL 6.1

Postby CronoCloud » 15 Jun 2009, 18:28

Sometimes you just might want to have a PDF document on your PSP, normally I'd use ImageMagicks convert to do the job:

Code: Select all
convert foo.pdf foo.jpg


But apparently the YDL 6.1 version of ImageMagick's convert isn't able to mess with PDF's. (Same thing happened with the PS2 LInux kit's version). Now I could always compile a new version and make certain I get PDF support in there, which is what I did on the PS2, but that's annoying, and I figured I could do it another way.

1. First make a convenient directory and put your PDF in it, helps keep things organized.

2. convert the PDF to PS (postscript)
Code: Select all
pdftops foo.pdf


3. convert the PS to a series of images in one of the PNM (ppm) formats
Code: Select all
pstopnm -dpi=100 -xborder=0 -yborder=0 foo.ps


You can check how the images look with:
Code: Select all
display foo.ppm


3. Then you can convert the ppm's to JPG that the PSP can handle:
Code: Select all
for x in $(ls -1 *.ppm); do convert -quality 100 $x $(basename $x .ppm).jpg; done


4. The PSP tends to sort things funny, based on modification date, and depending on how your images get copied they might be out of order, but you can ensure they do get copied over first page first, last page last. (modify as necessary to point to the target directory on your PSP/memory card)
Code: Select all
for x in $(ls -1 *.jpg); do sleep 1; cp $x /target_directory_on_psp_or_card/; done


Ron Rogers Jr. (CronoCloud)
CECHE01 PS3 (MGS4 80GB Bundle) without OtherOS and with an upgraded 320GB HD
Running Fedora 23 on a Compaq Presario CQ5320F upgraded with a Phenom X4 and GT640
Vizio E221A1 22" 1080P TV with HDMI, using 1080P over HDMI
PSN ID: CronoCloudAuron
User avatar
CronoCloud
Moderator
Moderator
 
Posts: 523
Joined: 21 Oct 2006, 05:48
Location: Central Illinois, USA

Return to General

Who is online

Users browsing this forum: No registered users and 43 guests