I’m get "Stack overflow at line 1" error when I convert HTML file to PDF file

Hi there,

We are trying to convert an html file (attached) into a PDF. We have our HTML template also attached, and can't seem to figure out why we are getting a stack overflow while using the command line to convert.

The specific error is:

Message from Webpage
Stack overflow at line 1


Are you able to offer us any help with fixing this error? We had it working before but are not sure why this is different. Thanks!

We apologize for any inconvenience this may have caused to you.

We can reproduce this problem in our system, this problem is caused by MS Internet Explorer, MS Internet Explorer does throw an error if your web page contain so many resources.

In order to solve this problem, we suggest you may use -webkit option in htmltools.exe application, -webkit option does use webkit engine to instead of MS Internet Explorer, so it hasn't this limitation like IE.

You may download HTML Converter Command Line (htmltools.exe) from following web page,


you can use -webkit option to convert this HTML file to PDF file properly,

htmltools.exe -webkit D:\downloads\test.html D:\downloads\test.pdf




Hi there,

I used the -webkit option, and man, thank you SO much! The speed has improved incredibly, and I'm able to use this much better than doc2pdf. I do still have one problem though.

Can you examine my batch file and make sure everything looks good? I'm having an issue with the last 2 commands where it just won't create the final pdf file. If I get rid of the very last line, then it will create the final pdf file, so I'm not sure what's happening in the very last line.


P.S. The batch commands are located in the pdf_conversion.txt.
The last command line in your .txt file is not work, because htmltools.exe is support HTML format as input format, it can't accept PDF file as input format, so that last command line will stop work.

"C:/Users/XXX/Downloads/htmltools/htmltools/htmltools.exe" -append 2 "pdf/test.pdf" "final/out.pdf"

If you wish merge PDF files into one PDF file, you can use -mergepdf option, e.g.,

htmltools.exe -mergepdf "C:\1.pdf|C:\2.pdf|C:\3.pdf" C:\out.pdf
htmltools.exe -mergepdf "C:\*.pdf" C:\out.pdf
htmltools.exe -mergepdf "C:\filelist.txt" C:\out.pdf
htmltools.exe -mergepdf "C:\test-extraction.pdf*10-15 C:\out10-15.pdf
htmltools.exe -mergepdf "C:\test-extraction.pdf*500-501 C:\out500-501.pdf

You can use -mergepdf option to merge PDF files into one PDF file quickly.


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

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!