How to create TOC or index during converting HTML to PDF?

Question:  I convert HTML files to PDF format on the fly. There are documents containing repetitive information - premises and their addresses, let's call them elements. At the end of a document I need to create an index. Each index entry should have a page number referring to the page where element was added. The number of elements that can fit on one page will vary. How can I create TOC a document index? Or how can I get notified while library adds certain type of HTML element to the PDF document? Is there any solution on VeryPDF?

Answer: When you need to create TOC during the conversion from HTML to PDF file, maybe you can have a free trial of software VeryPDF Web Page to PDF Converter Cloud API, by which you still can run the conversion on the fly but you can not make the conversion in batch. When you need to run the conversion in batch, please use the desktop command line version of VeryPDF HTML Converter. By the API converter, you can create TOC and set depth, set font style, font size according to TOC level. Please check more information of this software on homepage, in the following part, I will show you how to make it work.

Please get an API code.

Convert HTML to PDF and create TOC

  • When using VeryPDF Web Page to PDF Converter Cloud API to convert HTML to PDF and create TOC, you do not need to download any third party application. Simply open browser and then input URL following the below example then you can run then conversion fast and accurately.
  • Here is an example for your reference:
    http://online.verypdf.com/api/apikey=XXXXXXXXXXXXX&app=
    html2pdf&infile=https://www.verypdf.com&outfile=verypdf.pdf&—grayscale-proxy
    By the above link we can convert website of VeryPDF to grayscale PDF using proxy. Now let us check parameters related with TOC setting.

--toc-depth*     <level>     Set the depth of the toc (default 3)
      --toc-disable-back-links*           Do not link from section header to toc
      --toc-disable-links*           Do not link from toc to sections
      --toc-font-name*     <name>     Set the font used for the toc (default Arial)
      --toc-header-font-name*     <name>     The font of the toc header (if unset use --toc-font-name)
      --toc-header-font-size*     <size>     The font size of the toc header (default 15)
      --toc-header-text*     <text>     The header text of the toc (default Table Of Contents)
      --toc-l1-font-size*     <size>     Set the font size on level 1 of the toc (default 12)
      --toc-l1-indentation*     <num>     Set indentation on level 1 of the toc (default 0)
      --toc-l2-font-size*     <size>     Set the font size on level 2 of the toc (default 10)
      --toc-l2-indentation*     <num>     Set indentation on level 2 of the toc (default 20)
      --toc-l3-font-size*     <size>     Set the font size on level 3 of the toc (default 8 )
      --toc-l3-indentation*     <num>     Set indentation on level 3 of the toc (default 40)
      --toc-l4-font-size*     <size>     Set the font size on level 4 of the toc (default 6)
      --toc-l4-indentation*     <num>     Set indentation on level 4 of the toc (default 60)
      Please check more parameters on user manual, there are many more I can not list all of then here.

By this API, we can run the conversion within browser without any third party installation and then design TOC information. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

One Reply to “How to create TOC or index during converting HTML to PDF?”

  1. Why toc* argument do not work with HTML to PDF command line tool ?

    VA:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.20_1166]
    Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!