Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^4: Convert PDF to HTML (or JPEG)

by LanX (Bishop)
on Sep 14, 2009 at 20:56 UTC ( #795214=note: print w/replies, xml ) Need Help??

in reply to Re^3: Convert PDF to HTML (or JPEG)
in thread Convert PDF to HTML (or JPEG)

Hi Almut,

Now I had the time to check my old computer for these 8 year old bash scripts I used :)

And ... well ... it's really strange, but I'm not experiencing your problems!



that's the script I used:

cd /home/lanx/tmp; SOURCE="test.pdf"; ILTYPE="plane" ; GEOMETRY="1240x1754"; QUALITY=90; DENSITY="150x150"; for OUT in "jpg" "png"; do echo $OUT; DEST="$SOURCE.%02d.$OUT"; convert +adjoin -interlace $ILTYPE -geometry $GEOMETRY \ -density $DENSITY -quality $QUALITY $SOURCE $DEST done

Maybe some other installations like latex2html or GraphicsMagick are altering the behavior of convert on my box?

Cheers Rolf

PS: Große Vallüla ??? xD (SCNR)

UPDATE: just noticed I didn't even use the -antialias switch ...

Replies are listed 'Best First'.
Re^5: Convert PDF to HTML (or JPEG)
by almut (Canon) on Sep 14, 2009 at 23:29 UTC

    Thanks, that's already a lot better (placing the -density option before the source file name seems to have caused the major improvement).

    Yet, I'm not really convinced of the quality that can be achieved that way. Maybe I'm little picky in these things, but I still feel the text looks a bit ragged, and the graphics don't seem to be anti-aliased at all (I also tried putting -antialias in various places — couldn't see a difference, though).  In other words, I can't help thinking that the results of running gs separately somehow look better (the version on the right in the side-by-side comparison (300%-zoom, cropped)) — at least smoother.  Anyhow, I guess I'll stick with my technique for the time being.


    PS: Große Vallüla ??? xD

    Yeah well, that was the first adequate PDF file I found in my temp directory.  Rest assured, I have no affiliation with Maria & Margot, or that kind of music, whatsoever ;) — I just like hiking in the mountains.

      Right, I remember reading somewhere that with convert switches order counts ...

      UPDATE< convert can process several files at a time, and the switches have to be before the corresponding filename! >

      > Yet, I'm not really convinced of the quality that can be achieved that way.

      UPDATE< Did you try a higher density yet? 300 works fine for me and filesize even drops!>

      Actually I switched 7 years ago to pstoimg from the latex2html distribution producing very neat png's.

      (but it's -as I noticed today - just a perl wrapper around gs ;)

      Anyway pstoimg has two switches for antialiasing : -antialias and -aaliastext so I suppose thats the point where convert may loose the necessary information...

      Cheers Rolf

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://795214]
[Eily]: I'm tempted to consider sunD for flamebait
[Eily]: while I know that in a void his post doesn't deserve that, we all know the context, and he knows that the technical part of his answer will be ignored

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2018-02-22 15:55 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (294 votes). Check out past polls.