I thought this was easy, but it turns out to be not so obvious.
My problem: I have a database with hour registration. I need to print out about hundreds of pages and have them signed by employees. Of course I want to do this automatically. Up to now I have a collection of html pages (got them using wget). So the final thing I want is to print them all out in one go.
How to do that?
I search for a command-line option to convert the html to pdf. Or have firefox/konqueror print them directly without user intervention (there is not a switch like "firefox --print <url>"). Note that the pages are off-line, not on the server. The original pages can only retrieved with after authorization. That's why I used wget with a saved session cookie.
Anyone got an simple solution?
Thanks, Theo
Theo Band wrote:
I thought this was easy, but it turns out to be not so obvious.
My problem: I have a database with hour registration. I need to print out about hundreds of pages and have them signed by employees. Of course I want to do this automatically. Up to now I have a collection of html pages (got them using wget). So the final thing I want is to print them all out in one go.
How to do that?
I search for a command-line option to convert the html to pdf. Or have firefox/konqueror print them directly without user intervention (there is not a switch like "firefox --print <url>"). Note that the pages are off-line, not on the server. The original pages can only retrieved with after authorization. That's why I used wget with a saved session cookie.
Anyone got an simple solution?
I have not tried this my self, but try using html2ps and ghostscript to generate PDF's
htnl2ps is written ib Perl and can be found at http://user.it.uu.se/~jan/html2ps.html
Syntax: is:
perl html2ps file.html > file.ps
You can script that through the collection of html files, optionally pushing the postscript output through Ghostscript.
On 15/02/07, Theo Band theo.band@xanadu-wireless.com wrote:
I thought this was easy, but it turns out to be not so obvious.
My problem: I have a database with hour registration. I need to print out about hundreds of pages and have them signed by employees. Of course I want to do this automatically. Up to now I have a collection of html pages (got them using wget). So the final thing I want is to print them all out in one go.
How to do that?
I search for a command-line option to convert the html to pdf. Or have firefox/konqueror print them directly without user intervention (there is not a switch like "firefox --print <url>"). Note that the pages are off-line, not on the server. The original pages can only retrieved with after authorization. That's why I used wget with a saved session cookie.
Anyone got an simple solution?
Doesn't sending the HTML content to 'lpr' Just Work? I would've thought all the Foomatic filtering magic would've known what to do with HTML, though I don't have a Linux box setup for printing here.
Otherwise, look for html2pdf or html2ps.
Will.
Will McDonald wrote: >
Doesn't sending the HTML content to 'lpr' Just Work? I would've thought all the Foomatic filtering magic would've known what to do with HTML, though I don't have a Linux box setup for printing here.
I think it would do a find job of printing the HTML. I don't see how it can usefully do much more than that without parsing the HTML and pulling in all the images, style sheets and other important inclusions.
Something that understands HTML and has access to all the bits in all the relevant locations should do, but I don't have any ideas of specific packages.
On 15/02/07, John Summerfield debian@herakles.homelinux.org wrote:
Will McDonald wrote: >
Doesn't sending the HTML content to 'lpr' Just Work? I would've thought all the Foomatic filtering magic would've known what to do with HTML, though I don't have a Linux box setup for printing here.
I think it would do a find job of printing the HTML. I don't see how it can usefully do much more than that without parsing the HTML and pulling in all the images, style sheets and other important inclusions.
Fair point. I suppose that would depend on the particular format of the HTML content, is it really just simple, internally consistent HTML with no referenced images or external style definitions?
Will.
Will McDonald wrote:
On 15/02/07, John Summerfield debian@herakles.homelinux.org wrote:
Will McDonald wrote: >
Doesn't sending the HTML content to 'lpr' Just Work? I would've thought all the Foomatic filtering magic would've known what to do with HTML, though I don't have a Linux box setup for printing here.
I think it would do a find job of printing the HTML. I don't see how it can usefully do much more than that without parsing the HTML and pulling in all the images, style sheets and other important inclusions.
Fair point. I suppose that would depend on the particular format of the HTML content, is it really just simple, internally consistent HTML with no referenced images or external style definitions?
Will.
The HTML is all local on disk, no external references (one logo, but that's not important). I tried lpr <htmlfile> but that just print the HTML :-( A filter for PDF is present, that's why I also looked for a HTML to PDF converter. They exist, but work with PHP on a server, and that's a little bit to much work right now. At least I hope there is a little command-line utility html2pdf or htnl2ps or html2printer...
Theo
Theo Band wrote:
Will McDonald wrote:
On 15/02/07, John Summerfield debian@herakles.homelinux.org wrote:
Will McDonald wrote: >
Doesn't sending the HTML content to 'lpr' Just Work? I would've thought all the Foomatic filtering magic would've known what to do with HTML, though I don't have a Linux box setup for printing here.
I think it would do a find job of printing the HTML. I don't see how it can usefully do much more than that without parsing the HTML and pulling in all the images, style sheets and other important inclusions.
Fair point. I suppose that would depend on the particular format of the HTML content, is it really just simple, internally consistent HTML with no referenced images or external style definitions?
Will.
The HTML is all local on disk, no external references (one logo, but that's not important). I tried lpr <htmlfile> but that just print the HTML :-( A filter for PDF is present, that's why I also looked for a HTML to PDF converter. They exist, but work with PHP on a server, and that's a little bit to much work right now. At least I hope there is a little command-line utility html2pdf or htnl2ps or html2printer...
Theo _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi,
You can also look at the Python based scripts available from ReportLab - i dont have their URL handy but Google should help.
ChrisG
Benchmarking system.
any program to test speed write/read of devices, speed of memory,info about caches, etc?
devel wrote:
Benchmarking system.
any program to test speed write/read of devices, speed of memory,info about caches, etc?
nbench is what I use for performance benchmark. No disk info though. http://www.tux.org/~mayer/linux/bmark.html
On 2/15/07, Theo Band theo.band@xanadu-wireless.com wrote:
I thought this was easy, but it turns out to be not so obvious.
My problem: I have a database with hour registration. I need to print out about hundreds of pages and have them signed by employees. Of course I want to do this automatically. Up to now I have a collection of html pages (got them using wget). So the final thing I want is to print them all out in one go.
How to do that?
I search for a command-line option to convert the html to pdf. Or have firefox/konqueror print them directly without user intervention (there is not a switch like "firefox --print <url>"). Note that the pages are off-line, not on the server. The original pages can only retrieved with after authorization. That's why I used wget with a saved session cookie.
Anyone got an simple solution?
Thanks, Theo
Try HTMLDOC http://www.htmldoc.org/ We have used it for one of our customers and it seems to do a fine job of converting HTML to PDF. I haven't used it outside of our product except for some simle tests. It seemed to do fine with those tests.
DavidE