url to ps/pdf

I'm trying to write a script to convert URLs to either postscript or PDF (or
send them to a printer). I can use htmldoc (http://www.htmldoc.org/) on pages
written in HTML, but not on pages generated on-the-fly using PHP or Java, or on
files that are already PDF or text or.....

I'm just looking for something I can run on UNIX that, without popping up a GUI,
would perform the same magic as if I pointed a web browser at a link and clicked
"Print" with a PS or PDF printer driver. Anyone got that already or have any
suggestions?

Ed.
Ed Morton [ So, 18 November 2007 13:42 ] [ ID #1873425 ]

Re: url to ps/pdf

Ed Morton wrote:
> I'm trying to write a script to convert URLs to either postscript or PDF (or
> send them to a printer). I can use htmldoc (http://www.htmldoc.org/) on pages
> written in HTML, but not on pages generated on-the-fly using PHP or Java, or on
> files that are already PDF or text or.....
>
> I'm just looking for something I can run on UNIX that, without popping up a GUI,
> would perform the same magic as if I pointed a web browser at a link and clicked
> "Print" with a PS or PDF printer driver. Anyone got that already or have any
> suggestions?

I haven't tried it myself (yet), but there's a perl script html2ps
available from http://user.it.uu.se/~jan/html2ps.html that might work
for you.

Steve
Steven J Masta [ So, 18 November 2007 15:11 ] [ ID #1873432 ]

Re: url to ps/pdf

On 11/18/2007 8:11 AM, Steven J Masta wrote:
> Ed Morton wrote:
>
>>I'm trying to write a script to convert URLs to either postscript or PDF (or
>>send them to a printer). I can use htmldoc (http://www.htmldoc.org/) on pages
>>written in HTML, but not on pages generated on-the-fly using PHP or Java, or on
>>files that are already PDF or text or.....
>>
>>I'm just looking for something I can run on UNIX that, without popping up a GUI,
>>would perform the same magic as if I pointed a web browser at a link and clicked
>>"Print" with a PS or PDF printer driver. Anyone got that already or have any
>>suggestions?
>
>
> I haven't tried it myself (yet), but there's a perl script html2ps
> available from http://user.it.uu.se/~jan/html2ps.html that might work
> for you.
>
> Steve

I tried it previously and it seems to have all the same drawbacks as htmldoc,
but produces worse formatting in the success cases.

Thanks anyway,

Ed,
Ed Morton [ So, 18 November 2007 15:28 ] [ ID #1873433 ]

Re: url to ps/pdf

On Sun, 18 Nov 2007 06:42:07 -0600, Ed Morton <morton [at] lsupcaemnt.com> wrote:

> I'm just looking for something I can run on UNIX that, without
> popping up a GUI, would perform the same magic as if I pointed a web
> browser at a link and clicked "Print" with a PS or PDF printer
> driver. Anyone got that already or have any suggestions?

How are you getting the HTML pages now?

Sounds to me like if you used wget or curl to pull the page down to a
particular directory and had a script check that directory every so
often for HTML files, you could run your html-to-pdf program against any
HTML you might find in there.

--
Registered Linux User #450983 * Ubuntu Counter Project #10548
Home: http://nlphilia.com * Blog: http://nlphilia.net
The "mypacks.net" address from which this message was sent is
legitimate and not spam-trapped. It is, however, disposable.
Michael DeBusk [ Di, 20 November 2007 08:29 ] [ ID #1874651 ]

Re: url to ps/pdf

On 11/20/2007 1:29 AM, Michael DeBusk wrote:
> On Sun, 18 Nov 2007 06:42:07 -0600, Ed Morton <morton [at] lsupcaemnt.com> wrote:
>
>
>> I'm just looking for something I can run on UNIX that, without
>> popping up a GUI, would perform the same magic as if I pointed a web
>> browser at a link and clicked "Print" with a PS or PDF printer
>> driver. Anyone got that already or have any suggestions?
>
>
> How are you getting the HTML pages now?

Using a GUI web browser.

> Sounds to me like if you used wget or curl to pull the page down to a
> particular directory and had a script check that directory every so
> often for HTML files, you could run your html-to-pdf program against any
> HTML you might find in there.
>

I don't need to do that as htmldoc can just take a url and produce the ps/pdf
file, but it's all the stuff that gets displayed on the web that ISN'T an HTML
file that's the problem. For example:

http://www.nissanusa.com/apps/brochure?intcmp=HTML_HP.Promo. Brochure.P2

Ed.
Ed Morton [ Di, 20 November 2007 14:55 ] [ ID #1874654 ]
Linux » comp.unix.shell » url to ps/pdf

Vorheriges Thema: pdftk in script does not work: does in shell window.
Nächstes Thema: variable context