Problem in binding the aspx page


#1

hi to all,

i am new to this forum. i have a problem in doing or binding the aspx page

with pdf. i am getting the below attached error. So please let me know the

solution for this. I am sending you the code also.

Code:

Aspose.Pdf.Pdf pdf=new Aspose.Pdf.Pdf();

EnableViewState=true;

string PATH="http://localhost:8080/datacom/dealer/usercontrol/SupportLetterReport.aspx";

pdf.BindHTMLFromUrl(PATH,"GET");

pdf.Save(@"c:\SupportletterReport.pdf");

please tell me the solution for this ASAP.

thanks in advance


#2

Thank you for considering Aspose.

1) Only simple HTML/ASPX page is supported. Please refer to http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf/ConvertingHtmlToPdf.html.

2) Please try code like the following:

pdf = new Aspose.Pdf.Pdf();
string surl=this.Request.Url.ToString();
WebClient webClient = new WebClient();
byte[] myDataBuffer = webClient.DownloadData(surl);
MemoryStream postStream=new MemoryStream (myDataBuffer);
pdf.BindHTML(postStream);
pdf.Save(@"c:\test.pdf")