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!
|
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!
|
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!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad to hear that it works for you!
|