Welcome Guest Search | Active Topics | Sign In | Register

MVCToPDF with VisibleElementIds? Options
Kevin
Posted: Tuesday, August 27, 2013 8:58:41 AM
Rank: Member
Groups: Member

Joined: 8/27/2013
Posts: 11
Hi,

I am using:

MVCToPDF.ResultFileName = filename;
MVCToPDF.RenderAsPDF();

I do not want to return the whole page though, does this mean I need to use HtmlToPdf instead?

Thanks,
Kevin
eo_support
Posted: Tuesday, August 27, 2013 9:03:45 AM
Rank: Administration
Groups: Administration

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

You can use HtmlToPdf directly but you do not have to. The idea of MVCToPDF is to capture whatever your page output is and turn it into PDF. So if you can add some code to hide certain section of your page before calling RenderAsPDF, those will not visible. The basic rule is, try to do whatever you would do if you were to produce the same output in your browser --- then add calls to RenderAsPDF to redirect that output to a PDF file.

Thanks!
eo_support
Posted: Tuesday, August 27, 2013 11:34:12 AM
Rank: Administration
Groups: Administration

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

I believe you can also use VisibleElementIds. You can just set it before calling RenderAsPDF. Internally RenderAsPDF calls HtmlToPdf.ConvertHtml. So almost all HTML to PDF options can be used with MVCToPDF.

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.