Welcome Guest Search | Active Topics | Sign In | Register

ASP.NET MVC 3 Options
lanto
Posted: Saturday, November 5, 2011 3:12:32 PM
Rank: Newbie
Groups: Member

Joined: 11/5/2011
Posts: 3
How can I get a div on an ASP.NET MVC 3 page transformed into a PDF file?
eo_support
Posted: Saturday, November 5, 2011 3:41:59 PM
Rank: Administration
Groups: Administration

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

You would call HtmlToPdf.ConvertUrl or HtmlToPdf.ConvertHtml directly.

Thanks!
lanto
Posted: Saturday, November 5, 2011 6:09:13 PM
Rank: Newbie
Groups: Member

Joined: 11/5/2011
Posts: 3
I only want to a DIV converted to HTML...
eo_support
Posted: Saturday, November 5, 2011 6:17:01 PM
Rank: Administration
Groups: Administration

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

You can set this property if you just wish to convert a part of your page:

http://doc.essentialobjects.com/library/4/eo.pdf.htmltopdfoptions.visibleelementids.aspx

The code would be something like this:

Code: C#
HtmlToPdf.Options.VisibleElementIds = "your_div_id";
HtmlToPdf.ConvertUrl(your_url, pdf_file_name);


ConvertUrl has many overloaded versions. You can take a look of the documentation to see which one fits your need better.

Thanks
lanto
Posted: Sunday, November 6, 2011 12:39:10 AM
Rank: Newbie
Groups: Member

Joined: 11/5/2011
Posts: 3
That works,

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.