Hi experts,

I've been researching about convert an aspx to pdf but nothing seems to help me.
I found crystal reports but my layout is not just gridview only.

In my aspx, it includes textboxes, labels, tables, gridview. I need to print them to a pdf format automatically.

Due to the limited resources, I can't download the softwares available.

I saw codes like
PdfConverter pdfConverter = new PdfConverter();

(link is http://www.html-to-pdf.net/Support.aspx#csharp)

I tried them but it don't work. What are some other ways I can do?

Thanks in advance.

you'd have to download those tools or purchase them. I don't know of a particular method or free tool that will allow you to do that...

First, Thanks for your reply.

oh oh(I have to convince my client to buy the software)...

Erm, is there any other methods to convert these web widgets into some format that is not editable, (I can't use ms word etc)

I can't think of anything offhand. Everything I might be able to think of is available as a commercial product...

I placed on the page the button and the panel wich contains data for pdf. The code of btnConvert_Click event was next:

Dim objStringWriter As New System.IO.StringWriter
Dim objHTMLWriter As New HtmlTextWriter(objStringWriter)
Panel1.RenderControl(objHTMLWriter)
Dim htmldata As String = objStringWriter.ToString()

For converting page content to the PDF try to use PDF Duo .Net component (download this ASP.NET component).
Then it is easy to convert string "htmldata" to PDF with next code:

conv.OpenHTML(htmldata)
conv.SavePDF("example.pdf")
commented: Don't talk with old thread. Create your own thread if required. +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.