Welcome Guest Search | Active Topics | Sign In | Register

InvisibleElementIds Removing Page Contents Options
Nicholas Cardi
Posted: Wednesday, September 14, 2016 6:01:48 PM
Rank: Newbie
Groups: Member

Joined: 3/9/2015
Posts: 7
We are adding ids using the InvisibleElementIds property and separating each id with a semi-colon. The Elements are hidden but so is everything else on the page. Even divs without out those element ids

//Code...

StringBuilder sbHtml = new StringBuilder();
//Load string builder from sample html file sent to support

HtmlToPdf.Options.FooterHtmlFormat = "Hello from Footer";
HtmlToPdf.Options.HeaderHtmlFormat = "Hello From Header";
HtmlToPdf.Options.InvisibleElementIds = "header;footer";

PdfDocument doc = new PdfDocument();
HtmlToPdfResult result = HtmlToPdf.ConvertHtml(sbHtml.ToString(), doc);
using (MemoryStream ms = new MemoryStream())
{
doc.Save(ms);
byte[] pdf = ms.ToArray();
File.WriteAllBytes(Environment.CurrentDirectory + "\\testpdf.pdf", pdf);
}

// Notice the body of the PDF is blank and the HTML contains text!

I have sent sample html documents to support. Both the HTML input and the PDF output....

BTW: I am running version 16.2.1.0 on Windows 10 64 bit.

I also noticed this thread where an end user had the same issue and it was supposedly fixed.
https://www.essentialobjects.com/forum/postst9950_EO-PDF-not-supporting-CSS-Flex-property.aspx
eo_support
Posted: Thursday, September 15, 2016 8:53:09 AM
Rank: Administration
Groups: Administration

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

The reason is because you did not close your "header" DIV properly. As a result, other DIVs are parsed as children DIV of your header DIV. Since you hide header, all the children are hidden as well.

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.