views:

16

answers:

1

Hi,

I am using HTMLDoc to generate a pdf file. But i want to generate the pdf file of two pages. In which on first page there should be image and on second page it will contain the HTML file content. Currently I am using this code to generate the pdf file. It is generating a pdf file of one page only and all my content and image is coming on single page only. Here is my code.

cmd = "htmldoc --webpage --color --no-toc --footer ... #{@size ? ' --size ' + @size : ''} #{@body_image ? ' --bodyimage ' + @body_image : ''} #{@margins && @margins.size == 4 ? ' --top ' + @margins[0] + ' --right ' + @margins[1] + ' --bottom ' + @margins[2] + ' --left ' + @margins[3] : ''} -f #{@pdf_file} #{html_file}  2>&1"

Thanks in advance. Gaurav Soni

A: 

From the HTMLDOC manual:

HTMLDOC supports many special HTML comments to initiate page breaks, set the header and footer text, and control the current media options.

So it looks you should insert this special comment into your HTML source at the spot you need a page break:

<!-- PAGE BREAK -->
pipitas