We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SplitTextLines problem

Hi all,

i have problem with SplitTextLines property,

here is the sample code i use:

Using htmlconverter As New HtmlConverter()
htmlconverter.AutoDetectPageBreak = True
htmlconverter.EnableHyperlinks = True
'Renders html from the string to image.
Dim mf As New PdfMetafile(TryCast(htmlconverter.FromString(sourceStr, HttpContext.Current.Server.MapPath("./export/") & fileName & ".html", ImageType.Metafile, CInt(Math.Truncate(width * 1.3)), -1, AspectRatio.KeepWidth), Metafile))
mf.Quality = 100

Dim format As New PdfMetafileLayoutFormat()
format.Break = PdfLayoutBreakType.FitPage
format.Layout = PdfLayoutType.Paginate
format.SplitTextLines = False
format.SplitImages = False

'Draws the image.
mf.Draw(page, New PointF(0, 0), format)
End Using

as you can see i am setting format.SplitTextLines = False but whenever i have a page break there can be a split in text on two pages

here is the sample HTML generated by the aspx:



3 *



the span element somethimes is split between pages




3 Replies

GM Geetha M Syncfusion Team July 6, 2011 12:41 PM UTC

Hi Alek,

Thank you for your interest in Syncfusion products.

Page break and SplitText are two different functionalities. If you want to avoid moving to next page during page break, please set AutoDetectPageBreak to false.

htmlconverter.AutoDetectPageBreak = False

Please try this and let me know if you have any questions.

Regards,
Geetha



PK Prashant Kamboj May 24, 2022 04:03 PM UTC

I am also getting same issue.  htmlconverter.AutoDetectPageBreak = False  is not working

Do we have any solution?



GK Gowthamraj Kumar Syncfusion Team May 25, 2022 04:00 PM UTC

Hi Prashant Kamboj,

We have checked the HTML to PDF conversion with test document using our old IE rendering engine, but it is working properly without any issue. IE rendering engine makes use of MSHTML (IE rendering engine) to convert HTML to vector images. From the images, we will render the PDF document. Microsoft has changed its behavior from IE 9 and above, that IE may generate bitmap images instead of vector images. The limitation with IE: However, if the input HTML contains HTML-5 or CSS3, IE(MSHTML) will only generate bitmapped output (PDF text could not be selected) and it is the behavior of IE.  


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/HtmlSample_SplitText376162476

Output: https://www.syncfusion.com/downloads/support/directtrac/general/pd/IE_Output106613421


Note: Generated using the default Internet Explorer rendering engine. Content is preserved as raster (bitmap) images. For vector rendering and better overall image quality, you may use our Blink or WebKit powered engines with a simple change. The use of these engines is subject to additional terms.


Suggestion: We suggest you try our new WebKit/Blink HTML converter to get better output. WebKit/Blink converter never produces bitmap document and it has more features and enhancement than IE based HTML converter. Kindly refer below link for more information of our WebKit/Blink converter.  

WebKit: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit

Blink: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/blink

KB: https://www.syncfusion.com/kb/9143/how-to-convert-html-to-pdf-in-c-and-vb-net

https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf#supported-and-unsupported-features-by-rendering-engines


If you want to get the result in single page PDF, we have also provided a support to convert HTML to single page pdf document using WebKit/Blink rendering engine. Please find the below documentation link,
Blink: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/blink#html-to-single-pdf-page
WebKit: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#html-to-single-pdf-page


Please let us know if you need any further assistance in this.


Regards,

Gowthamraj K


Loader.
Live Chat Icon For mobile
Up arrow icon