PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Thu Jan 22, 2026 6:29 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Aug 25, 2011 12:18 pm 
Offline

Joined: Thu Aug 25, 2011 12:11 pm
Posts: 1
I am trying to figure out if this is possible using PDFSharp. I have existing PDF files, I would like to open the file, modify the settings of the PDF to show the bookmark pane when PDF is opened and to zoom to show whole page when pdf is opened. Then I would like to save the PDF.

I would like to avoid trying to copy the PDF page by page to a new PDF and would prefere to simply edit settings of an existing PDF.

My main question, is finding out if this is indeed possible. If so, I should be able to figure it out myself but a pointer to any samples would be appreciated.

Thanks,

Chris


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2011 1:06 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3142
Location: Cologne, Germany
This sample sets a /FitV open action for an existing file:
http://www.pdfsharp.net/wiki/WorkOnPdfO ... ample.ashx
There is a similar option to show the complete page.

I'm not sure if you can control the bookmark pane the same way.

This part of the PDF API is not yet covered by PDFsharp, so you'll have to check the PDF documentation by Adobe for further commands and details.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 19, 2015 4:31 pm 
Offline

Joined: Thu Mar 19, 2015 2:27 pm
Posts: 5
Hi!

I was looking for a way to ensure that bookmarks were hidden when opening a document ( that is to set Navigation tab to Page only using the terminology from the Initial View tab of the Acrobat document properties ) when I found this discussion from 2011. I just thought that I'd add my findings, to make it simpler for other people looking for the same thing:

It seems that since 2011 support has been added in PDFSharp to show bookmarks:
Code:
document.PageMode = PdfPageMode.UseOutlines;

or, to turn them off (as I needed):
Code:
document.PageMode = PdfPageMode.UseNone


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 19, 2015 4:51 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3142
Location: Cologne, Germany
Hi, Andreas,

Thanks for sharing the information.

Besides PageMode there also are properties PageLayout and ViewerPreferences.
So there are several options that can be set without an OpenAction.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: Google [Bot] and 313 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