Rank: Member Groups: Member
Joined: 7/21/2011 Posts: 12
|
Hi,
we have an ASPX page with a button "create pdf" which creates a pdf of the page with some customizations in the event ASPXToPDF1_BeforeRender (page size, output area, footer positon etc.).
That works great, the pdf is perfectly created with images, footer and so on.
Now we have to generate this pdf automatically (e.g. as attachment of an email). So nobody clicks this "create pdf" button on the aspx page that shows the content of the pdf. How can this be done???
If we use HtmlToPdf.ConvertUrl(urlOrHtmlFile, outputFileName) all the customizations from ASPXToPDF1_BeforeRender event are missing.
Cheers, Harry
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Have you tried to call RenderAsPDF in your Page_Load?
Thanks!
|
Rank: Member Groups: Member
Joined: 7/21/2011 Posts: 12
|
Hi,
doesn't work! RenderAsPDF throws a NullReferenceException. Any other ideas?
Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, We have tested calling RenderAsPDF inside Page_Load and it works fine. So you may want to check if you have the latest version first. If you are already on the latest version and still have problem, please try to isolate the problem into a test project and send the test project to us. See here for more information on how to send test project to us: http://www.essentialobjects.com/forum/test_project.aspxNote that if the NullReferenceException is in your code, then obviously you would need to resolve that part yourself. Thanks!
|