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.
Unfortunately, activation email could not send to your email. Please try again.

Null pointer error while converting html to pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

115949 Mar 4,2014 09:00 AM Mar 7,2014 05:07 AM ASP.NET Web Forms (Classic) 1
loading
Tags: PDF
Prakash Makhija
Asked On March 4, 2014 09:00 AM

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

t.SetApartmentState(ApartmentState.STA);

t.Start();

t.Join();

}

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

document.Close(true);

}

}


KarthikeyanC [Syncfusion]
Replied On March 7, 2014 05:07 AM

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.

 

Thanks,

Karthikeyan.C


CONFIRMATION

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.

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.

;