If I tag an element, how do I go back later and find what page it is on?
If I go the invisible text route, how would you recommend making paragraphs "invisible" so they don't affect the layout? Also, even though the text is not visible in the document, it will still be visible in the outline?
I believe I have somethign that works. I did this and the text is not shown and the layout seems to be the same as if the text wasn't even there. I am adding the code here to complete this post so if someone finds it later than can see the whole thing:
Code:
Style style = pdfDoc.Styles["Heading1"]; // will be used for the root entry of the outline
style.Font.Size = .001;
style.Font.Color = Colors.White;
style.ParagraphFormat.PageBreakBefore = false;
style.ParagraphFormat.SpaceBefore = 0;
style.ParagraphFormat.SpaceAfter = 0;
style = pdfDoc.Styles["Heading2"]; // will be used for the second level of the outline
style.Font.Size = .001;
style.Font.Color = Colors.White;
style.ParagraphFormat.PageBreakBefore = false;
style.ParagraphFormat.SpaceBefore = 0;
style.ParagraphFormat.SpaceAfter = 0;
So to add the root to the outline, I do:
section.AddParagraph("Outline Root", "Heading1");
and to add second level outline entries I do:
section.AddParagraph("Specifications", "Heading2");