Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts

    converting rendered HTML to pdf from terminal

    does any one know of a way to convert a rendered HTML page to pdf from the command line on mac OS X (10.3)?

    I have tried google and a variety of other search engines but everything they come up with isnt what I am looking for.

    I did install ghostscript for ps2pdf but have been unsucessful in converting a rendered html page to post script so that I can use ps2pdf.

    any ideas?
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    You might want to try to first convert the document to postScript using html2ps (http://user.it.uu.se/~jan/html2ps.html).

    Then from the command line try something like:

    $> html2ps myFile.html | ps2pdf myFile.pdf

    or

    $> html2ps myFile.html > test.ps; ps2pdf test.ps test.pdf; rm test.ps

  • #3
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    its funny you mention that, I just downloaded that this morning...
    Technically, it works, but it looks really bad compared to what I can do with css. It doesn’t preserve backgrounds or fonts very well but the tables do come out the way i had them.
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

  • #4
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Yeah, I think they had another one to handle CSS better called xhtml2ps. Might want to try that. Also, I was looking at the documentation, and it looks like if you have the CSS in an external stylesheet, it's generally ignored, whereas if you have the CSS in the <head></head> tags, it works better.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •