Welcome Guest Search | Active Topics | Sign In | Register

_ASPXToPDF1.RenderAsPDF create pdf automatically Options
Harry50
Posted: Monday, August 17, 2015 5:00:44 PM
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
eo_support
Posted: Monday, August 17, 2015 5:09:53 PM
Rank: Administration
Groups: Administration

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

Have you tried to call RenderAsPDF in your Page_Load?

Thanks!
Harry50
Posted: Tuesday, August 18, 2015 10:57:19 AM
Rank: Member
Groups: Member

Joined: 7/21/2011
Posts: 12
Hi,

doesn't work! RenderAsPDF throws a NullReferenceException.
Any other ideas?

Thanks
eo_support
Posted: Tuesday, August 18, 2015 6:19:18 PM
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.aspx

Note that if the NullReferenceException is in your code, then obviously you would need to resolve that part yourself.

Thanks!


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.