PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:49 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adding a Page Label
PostPosted: Thu Dec 16, 2021 11:18 pm 
Offline

Joined: Fri Dec 10, 2021 3:33 pm
Posts: 7
I would like to add a page label to each page I create in a document. Is there a way I can do this with PDFsharp? I have looked at many examples but can't seem to find anything that does what I'm looking for.


Top
 Profile  
Reply with quote  
 Post subject: Re: Adding a Page Label
PostPosted: Fri Dec 17, 2021 7:43 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
gtm wrote:
I would like to add a page label to each page I create in a document.
What is a "page label"?

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Adding a Page Label
PostPosted: Fri Dec 17, 2021 3:53 pm 
Offline

Joined: Fri Dec 10, 2021 3:33 pm
Posts: 7
TH-Soft wrote:
gtm wrote:
I would like to add a page label to each page I create in a document.
What is a "page label"?


I guess I picked up the term from a PDF viewer called BlueBeam. It is the title that is attached to the page but is not displayed on the page.
On Adobe Acrobat Reader, it is displayed on the top tool bar to the right of the up and down arrows and just before the (current page number of total page numbers).

This is what it looks like in the PDF File.

4 0 obj
<</Type/Catalog/Pages 2 0 R/PageLabels<</Nums[0<</P(SK1)>>]>>>>
endobj

SK1 is the text I'm looking to get access to. Can you help?


Top
 Profile  
Reply with quote  
 Post subject: Re: Adding a Page Label
PostPosted: Sat Jan 08, 2022 8:57 pm 
Offline

Joined: Fri Dec 10, 2021 3:33 pm
Posts: 7
TH-Soft, Is there any information you can give me on creating a page label? I have found this in the PDFsharp open source code.

// <summary>
/// (Optional; PDF 1.3) A number tree defining the page labeling for the document.
/// The keys in this tree are page indices; the corresponding values are page label dictionaries.
/// Each page index denotes the first page in a labeling range to which the specified page
/// label dictionary applies. The tree must include a value for pageindex 0.
/// </summary>
[KeyInfo("1.3", KeyType.NumberTree | KeyType.Optional)]
public const string PageLabels = "/PageLabels";

It looks like there should be a way to access it. Does anyone know how to access a number tree?

Thanks,
Todd


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 143 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