Welcome Guest Search | Active Topics | Sign In | Register

RenderAsPDF still includes area for hidden elements Options
tturner
Posted: Wednesday, June 27, 2012 11:14:50 AM
Rank: Newbie
Groups: Member

Joined: 6/27/2012
Posts: 2
We are testing out EO.PDF and really like what it can do for us, but one issue I am having is that when I tell it to save only a specific area it keeps the spacing of the other areas, while not displaying the content.

Basically, we have a master page with a header, left navigation area, and a footer. The content for these areas doesn't display, but the spacing for the navigation area does as well as the background image from an outer div.


Code: C#
HtmlToPdf.Options.PageSize = PdfPageSizes.Letter;
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit;
HtmlToPdf.Options.VisibleElementIds = "printinvoice";
ASPXToPDF1.RenderAsPDF("Invoice-" + TransactionID + ".pdf");


I have also tried adding the following:

Code: C#
// Test to see if this helps
HtmlToPdf.Options.InvisibleElementIds = "header,sidebar,footer";



I can provide a sample of the PDF, as well as additional HTML from the master file and page.


-Tim
eo_support
Posted: Wednesday, June 27, 2012 4:47:42 PM
Rank: Administration
Groups: Administration

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

We tested this feature and it seems to work fine. Please make sure the ID you provided is the ClientID of the element. This is not the same as your server control ID. For an ASP.NET page, very often the ClientID is much longer and it also includes the parent control ID. Such as "Header_Label1".

Thanks!
tturner
Posted: Wednesday, June 27, 2012 7:02:57 PM
Rank: Newbie
Groups: Member

Joined: 6/27/2012
Posts: 2
The elements I am trying to access are actually not server controls and therefore they do not have a ClientID.
eo_support
Posted: Wednesday, June 27, 2012 8:53:53 PM
Rank: Administration
Groups: Administration

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

In that case you can create a test page to demonstrate the problem and post the test page. We tested the feature and it works fine. So we will need a test page in order to investigate further.

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.