Subject: Html2PDF
Date: 2011-01-05 15:12:51
From: Sylvain BENOIT
Source: html2pdf
----------------------------------------------------------------------

Hi !

I'm tried to convert an HTML document in PDF with Ultimate PDF.
But the HTML Document contains many page breaks, but PDF document generated haven't.

In html, we force a page break with :
<div style="page-break-afteralways"></div>
but pdf generator seems to ignore these.

i used this code to make a conversion :

var doc = new PdfDocumentPdfDocumentConformanceLevel.Pdf_A1B );
doc.PageSettings.Orientation = PdfPageOrientation.Portrait;

PdfPage page = doc.Pages.Add();

PdfUnitConvertor convertor = new PdfUnitConvertor();
SizeF pageSize = page.GetClientSize();

float width = -1;
float height = -1;

width = convertor.ConvertToPixels( page.GetClientSize().Width, PdfGraphicsUnit.Point );

Html2PdfOptions options = new Html2PdfOptions();
options.EnableJavaScript = true;
options.AutoDetectPageBreak = true;
options.EnableHyperlinks = false;
options.Width = (int)width;
options.Height = (int)height;
options.SplitTextLines = true;

doc.ImportHtmlText( html, options );

Somebody have an idea to solve my problem ?

PS : Sorry for my english, i'm french.

---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index