|
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?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You would call HtmlToPdf.ConvertUrl or HtmlToPdf.ConvertHtml directly.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/5/2011 Posts: 3
|
I only want to a DIV converted to HTML...
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
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.aspxThe 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
|
|
Rank: Newbie Groups: Member
Joined: 11/5/2011 Posts: 3
|
That works,
Thanks!
|
|