Welcome Guest Search | Active Topics | Sign In | Register

ASPXtoPDF - how to create PDF without oppening ASPX page Options
GregB
Posted: Wednesday, November 9, 2011 6:21:30 PM
Rank: Newbie
Groups: Member

Joined: 11/9/2011
Posts: 6
I was wondering if it is possible to use ASPXtoPDF control to create the PDF document of aspx page, but without launching the page. I was asked to automate a task of submitting .pdf document to a customer directly from the list of pending requests. Basically, I have a table of customer ids and I want to be able to click on the id to trigger pdf creation. Ideally, I would like to save the file and then attach it to the e-mail so it is ready to go.

Thank you!
eo_support
Posted: Wednesday, November 9, 2011 6:30:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would just call HtmlToPdf.ConvertUrl or HtmlToPdf.ConvertHtml (if you have the HTML) directly. If you call HtmlToPdf.ConvertHtml, you usually also need to set HtmlToPdf.Options.BaseUrl.

You can have HtmlToPdf.ConvertUrl/ConvertHtml to output to a file directly, or output to a PdfDocument object, then call Save on PdfDocument to it to a file/stream. Once you have the file, you can do whatever you would like to do, such as emailing it.

Thanks!
GregB
Posted: Wednesday, November 9, 2011 6:49:28 PM
Rank: Newbie
Groups: Member

Joined: 11/9/2011
Posts: 6
Awesome! Just tried and that is exactly what I was looking for. Great tool guys!
eo_support
Posted: Wednesday, November 9, 2011 7:04:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Glad to hear that it works for you!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.