|
Rank: Member Groups: Member
Joined: 1/10/2012 Posts: 15
|
Hi
I am using ASptoPDF to render a complex data driven page as a pdf. The page contains a lot of graphics and therefore the time to build and then stream (2meg file) to the user is a little long.
I have therefore decided to generated the file and save it to disk to avoid it being created every time (the data changes once a week, so the same report is valid for 7 days) and display a link to the pdf to download if it already exists.
I have modfied my complex apsx page to that it renders the pdf and also saves it to disk, however this also then streams the file to the user and I can't seem to save to disk "silently"
My question is - is it possible to render an aspxfile from another page or other code? So ideally I would like to have a UI that with a button that says "Build PDF". when clicked this builds the pdf from the aspx page and saves it to disc but does not stream it. Once the build is complete it displays the link below for the user to download it with a further click.
Is it possible to call the aspxtopdf from a url other than the actual page the code is in?
Thanks
johnathan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
If you just wish to render another page, you can simply call HtmlToPdf.ConvertUrl(your_page_url, final_file_name). It's a single call and it's even easier than ASPXToPDF.
Thanks
|
|
Rank: Member Groups: Member
Joined: 1/10/2012 Posts: 15
|
thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are welcome. Let us know if you have any other questions.
Thanks
|
|