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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to avoid text and image splitting when converting HTML to PDF

Platform: WinForms |
Control: PDF |
Published Date: January 28, 2016 |
Last Revised Date: December 13, 2018
Tags: pdf, htmltopdf

Syncfusion HTML to PDF for .NET is used for converting web pages, SVG, MHTML, and HTML to PDF. Using this library, you can avoid text and image splitting across the PDF pages while converting HTML to PDF.

Steps to avoid text and image splitting on HTML to PDF conversion:

  1. Create a new C# Windows Forms application project.

  1. Install the Syncfusion.HtmlToPdfConverter.QtWebKit.WinForms NuGet package as reference to your .NET Framework application from NuGet.org.

  1. Copy the QtBinaries folder from the HtmltoPdfConverter NuGet package installed location to the project folder, which contains the HTMLtoPDF_Sample.csproj file.

 

  1. Disable the SplitTextLines and SplitImages properties available in the WebKitConverterSettings instance to avoid the text and image splitting during HTML to PDF conversion. Find the sample and code snippet below.

C#

 

A complete working sample can be downloaded from the HTMLtoPDF_Sample.zip

Take a moment to peruse the documentation for Converting HTML to PDF, where you will find various options for URL to PDF, HTML string to PDF, and hyperlinks.

An online sample link for Converting HTML to PDF.

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon