Merge Of Html Files Into A Single Html (or Pdf)
Using wget ( 'i' option) you can download from Internet several pages,
which can represent the various parts of a lenghty document (manual or tutorial). Is there in Linux a sw to merge the html pages in a single html file (or better in a PDF file)? |
well, none that ive heard of, but imho such a simple task doesn't need a specific program.
Ill demonstrate via an example: Code:
grep -iv "</body>" downloads/html/site/page1.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" > downloads/html/site/all.html The result of the site merge wont be pretty, and can break the code, but thats what you get when automating this kinda stuff anyways.. Thr above code would still need to be modified to take out the start tags of the new files also, but you hopefully get my point and can modify it yourself.. Thats the way to learn anyways.. (: |
Thank you for your replay. I have followed what you suggest (but in a more drastic way):
I simply merged the html files as they were, without beeing warried of having, for example 100 <html> tags. For my purposes, that is toprint the manual or tutorial, it worked perfectly. The only problem is to get the correct list of the html files as defined by the Table of Content, and to merge them in that order. But with a little script... |
merge HTML's to PDF
|
You can use this HTML to PDF converter to convert multiple HTML documents to same PDF. There is also a sample for this on the website.
|
Script!
I know, this is an old post, but i just wrote a bash script to get this done, here it is.
You will have to chmod +x it, to run it. Code:
#!/bin/bash PS: i know one shouldn't parse ls output, but for simplicity's sake i chose to ignore that. |
FYI, any var created inside a SHELL is invisible to the parent shell and they get destroyed when the shell exits, so there's no need to unset them all at the end.
|
Merge HTMLto PDF files can be done
I would need to convert HTML to PDF first and then merge them together. To do the conversion, this one could help: (URL removed)HTML to PDF converter for .NET[/URL]. That tool can also merge PDF files. Merging HTML files will need to modify the HTML structure.
This (URL removed) componentpro pdf one[/url] can also help. |
OSCARLILAM!
Before posting it is a good idea to look at the dates on the post so you don't end up a 'necro poster'. This thread originated over 13 years ago and the last post was almost 7 years ago. I doubt the original poster is looking anymore and I'm sure things have changed in the intervening years and more is possible, the world moves on. |
I removed links. If you feel it is in error contact me.
|
|
All times are GMT -5. The time now is 05:04 AM. |