WKHTMLTOPDF Create only the first page in PDF format

I am working on a project requiring the creation of a PDF file from HTML content. I am using wkhtmltopdf , which in my opinion is the best solution I have received so far.

I was wondering if there is a way to generate only a single page PDF file.

I have a visualized HTML interface and I want the user to get the same result (say, 90%) in the resulting PDF file.

In the following example, the content is still on the first page, but wkhtmltopdf generates a second that contains nothing:

enter image description here

PDF . 0.12 wkhtmltopdf, - , .

, , , ? , , ?

+4
2

PDF . . pdftk .

:

wkhtmltopdf http://stackoverflow.com temp.pdf
pdftk temp.pdf cat 1 output output.pdf
rm temp.pdf
+1

wkhtmltopdf HTML-.

HTML-, . , . - . - ,

string switches = "";
switches += "--print-media-type ";
switches += "--page-size Letter ";
p.StartInfo.Arguments = switches + " " + url + " " + fileName;
0

All Articles