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

Null pointer error while converting html to pdf

Thread ID:





115949 Mar 4,2014 02:00 PM UTC Mar 7,2014 10:07 AM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
Prakash Makhija
Asked On March 4, 2014 02:00 PM UTC

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);




KarthikeyanC [Syncfusion]
Replied On 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.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to 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