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

Null pointer error while converting html to pdf

I am using below code to convert html file to PDF but some times it gives null pointer exception, can you please look at it and help me out

public partial class htmltopdf : System.Web.UI.Page


protected void Page_Load(object sender, EventArgs e)


Thread t = new Thread(new ThreadStart(converter));





private void converter()


PdfDocument document = new PdfDocument();

PdfLayoutResult result = null;

String param = Request.QueryString["URL"].ToString();

String FileName = Request.QueryString["FileName"].ToString();

String FileName1 = FileName + ".pdf";

String URL = "";

String CName = System.Environment.MachineName;

String UID = Request.QueryString["UID"].ToString();

param = param + "&UID=" + UID;

URL = "https://www.google.co.in/" + param;

using (HtmlConverter html = new HtmlConverter())


result = html.ConvertToTaggedPDF(document,URL );


document.Save(FileName1, Response, HttpReadType.Save);




1 Reply

KC Karthikeyan Chandrasekar Syncfusion Team March 7, 2014 10:07 AM UTC

Hi Prakash,

Thank you for using Syncfusion Products.


I am afraid that I am not able to reproduce this issue, could you please provide us the complete stack trace of this issue. So that it will be more helpful for us to investigate in this and provide you the solution.




Live Chat Icon For mobile
Up arrow icon