Home > pdf > Recursive HTML to PDF

Recursive HTML to PDF

December 15Hits:13
Advertisement

I have a folder with this structure:

/main-folder  /index.html  /subfolder1     /index1.html     /file1.html 

with many sub folder and only html files... i want to convert all them to pdf using only one command or a simple script that doesn't require all file names.

Do you know one

Answers

I would suggest installing the WKHtmlToPDF tool from http://code.google.com/p/wkhtmltopdf/.

You can then change to the root folder and use find and xargs to convert them:

cd /main-folder
find . -name \*.html | sed 's/.html$//g' | xargs -n 1 --replace=X wkhtmltopdf X.html X.pdf

This will then build a PDF with each HTML file.

The following command should do the job for one link:

gnome-web-print http://www.ubuntu.com ubuntu.pdf

For multiple links, it shouldn't be difficult to write a loop that handles each link one by one.

Tags:html, pdf

Related Articles

  • Recursive HTML to PDFDecember 15

    I have a folder with this structure: /main-folder /index.html /subfolder1 /index1.html /file1.html with many sub folder and only html files... i want to convert all them to pdf using only one command or a simple script that doesn't require all file n

  • How can I recursively copy all pdf files in a directory (and it's subdirectories) into a single output directory?September 20

    I have a directory containing a large number of PDF files, some of which are in subdirectories (which can extend several layers deep). I would like to move all files matching *.pdf into a single output folder named papers. How can I do this? --------

  • Howto recursively create PDF thumnbails on linux command lineFebruary 5

    I am able to use ImageMagick to create a thumbnail of the first page of a PDF using: convert -thumbnail x80 95.pdf[0] thumb_95.png This works fine and generates a thumb_95.png file. I have tried several permutations of "find" using xargs but i c

  • Parse a site for PDFsJuly 16

    I need to download all the PDF files present on a site. Trouble is, they aren't listed on any one page, so I need something (a program? a framework?) to crawl the site and download the files, or at least get a list of the files. I tried WinHTTrack, b

  • Recursive ls with conditionsFebruary 15

    Why can't I use a command like this to find all the pdf files in a directory and subdirectories? How do I do it? (I'm using bash in ubuntu) ls -R *.pdf EDIT How would I then go about deleting all these files? --------------Solutions------------- Why

  • After a series of nested \includegraphics, some PDF viewers fail to display the image

    After a series of nested \includegraphics, some PDF viewers fail to display the imageOctober 8

    I'll admit this is a convoluted example, but I like drawing with TikZ and LaTeX and this particular issue has come up for me more than once. The minimal working example takes a few files, but in a nutshell - a PDF is produced at each compile with the

  • Backing up all pictures from a harddriveNovember 28

    My uncle gave me a harddrive to recover from. The harddrive is perfectly intact and no problems with it. I plugged it in and XP allowed me to go in using My Computer. Now the thing is the data is spread out on this disk. What I want to do is go throu

  • How to search in PDF files recursively? January 31

    Is there a way to search pdf files using the power of grep, without converting to text first in Ubuntu? --------------Solutions------------- Install the package pdfgrep, then use the command: find /path -iname '*.pdf' -exec pdfgrep pattern {} + If yo

  • How to configure latexmk to work recursively? (PDF Thumbnails)September 27

    I'm writing a book which will include and explain a handful of different memoir page layouts. Setting the scene In the book, I want to imbed thumbnails of pages from PDFs generated with the page layouts, which I'm successfully doing with \includegrap

  • Recursively find and move corrupted PDFsApril 1

    The Issue I was using python-skydrive to download files to my PC, and I accidentally corrupted a good amount of my PDF files. When I try to view them in Document Viewer, I get the following error message: File type plain text document (text/plain) is

  • How can I recursively identify non-searchable PDFs and copy them to a folder?May 16

    Further to an earlier post which provided a script solution: From my question it may be possible to tell that I am a computer user and have no programming knowledge. I have hundreds of searchable and unsearchable pdfs in various folders and subfolder

  • How do I download all pdfs on webpage recursively keeping track of the site structure? October 24

    I'd like to download all the PDFs linked to this webpage and its subpages: http://www.regione.fvg.it/rafvg/cms/RAFVG/infrastrutture-lavori-pubblici/infrastrutture-logistica-trasporti/FOGLIA9/FOGLIA17/ However, the PDF links are all relative to a /tav

  • Linux: Compressing all .pdf files recursively (.tar)June 20

    At the linux command line, I'd like to compress all .pdf files in a directory, any of it's subdirectories and so on - but only .pdf files. I'm struggling to figure out the syntax, any ideas appreciated. --------------Solutions------------- Try this:

  • How can I automatically convert all source code files in a folder (recursively) to a single PDF with syntax highlighting?

    How can I automatically convert all source code files in a folder (recursively) to a single PDF with syntax highlighting?May 29

    I would like to convert source code of a few projects to one printable file to save on a usb and print out easily later. How can I do that? Edit First off I want to clarify that I only want to print the non-hidden files and directories(so no contents

  • Searching through txt, pdf, and doc filesAugust 18

    I need something that can quickly search through many .txt, .pdf, and .doc files (.djvu also preferable). Can anyone here name or recommend such a tool (Windows platform) ? --------------Solutions------------- PowerGREP is another suggestion. From th

  • Command line tool to search phrases in large number of pdf filesJuly 13

    I'm using Opensuse 10.3 and like to know command line tools to search phrases in large number of pdf files inside a directory. In Windows XP the Explorer search allows this but is too slow. Is there grep tips here? --------------Solutions------------

  • wget recursive download is resulting in 403 Forbidden Error. Solution?January 26

    I am trying to download a set of files recursively from a site using wget -r -l2 -A.pdf -U Mozilla -e robots=off http://download.xyz.com/songs/ But its not working it rather throws error. onnecting to download.xyz.com[124.37.187.210]:80... connected.

  • How can I grep in PDF files?January 31

    Is there a way to search pdf files using the power of grep, without converting to text first in Ubuntu? --------------Solutions------------- Install the package pdfgrep, then use the command: find /path -iname '*.pdf' -exec pdfgrep pattern {} + If yo

  • Batch convert .doc files to .txt (plain ascii text) and/or .html recursively in folders and subfolders, Windows and Mac?March 2

    Is there a tool to do this. I've seen some Python/Java tools to automate OpenOffice but has anyone reliably scripted this to do more than one file, and recurse through a folder/directory tree with .doc files in it, placing the converted .txt and .htm

  • Download all PDF links in a web page?March 20

    Do you know a good software to download all PDF links in a web page?? Operating system is Windows 7. --------------Solutions------------- You can use wget and run a command like this: wget --recursive --level=1 --no-directories --no-host-directories

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.346 s.