PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 6:20 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Paragraph Bookmark
PostPosted: Sat Dec 31, 2011 5:34 pm 
Offline

Joined: Sat Dec 31, 2011 5:23 pm
Posts: 2
Hi I am new to migradoc and pdfsharp,

the issue is that I can not get rid of the bookmarks that are automatically created when adding a paragraph like this:
Paragraph inicio = document.LastSection.AddParagraph();
inicio.Style = "Heading1";
inicio.AddSpace(110);
inicio.AddText("Factura nº");

I do not know how to get the pdf with no bookmarks.

Any solution to this issue will be great¡ (I have only seen questions about the creation of bookmarks but not to the removal of them...)

Thanks¡


Top
 Profile  
Reply with quote  
 Post subject: Re: Paragraph Bookmark
PostPosted: Sat Dec 31, 2011 6:40 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
Bookmarks are created for paragraphs that have the OutlineLevel set (i.e. the predefined Heading styles).
If you create own styles, they won't have bookmark entries created automatically.

Or you can clear the OutlineLevel for individual paragraphs or for all Heading styles.

Here is sample code that creates a bookmark for a paragraph:
Code:
    paragraph = sectionToc.AddParagraph();
    paragraph.Format.OutlineLevel = OutlineLevel.Level2;


Set the OutlineLevel to BodyText to avoid bookmarks for headings:
Code:
    paragraph = sectionToc.AddParagraph();
    paragraph.Format.OutlineLevel = OutlineLevel.BodyText;

Better create a new style (e.g. "Heading1WithoutBookmark") and set the OutlineLevel for this style (to avoid setting it for every single paragraph).

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
 Post subject: Re: Paragraph Bookmark
PostPosted: Sun Jan 01, 2012 12:51 pm 
Offline

Joined: Sat Dec 31, 2011 5:23 pm
Posts: 2
Thank you, your:
style.ParagraphFormat.OutlineLevel = OutlineLevel.BodyText;
was the solution¡


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group