| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
| Set initial view properties on existing PDF's https://forum.pdfsharp.net/viewtopic.php?f=2&t=1757 |
Page 1 of 1 |
| Author: | chrisward [ Thu Aug 25, 2011 12:18 pm ] |
| Post subject: | Set initial view properties on existing PDF's |
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 |
|
| Author: | Thomas Hoevel [ Thu Aug 25, 2011 1:06 pm ] |
| Post subject: | Re: Set initial view properties on existing PDF's |
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. |
|
| Author: | andreas1974 [ Thu Mar 19, 2015 4:31 pm ] |
| Post subject: | Re: Set initial view properties on existing PDF's |
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
|
|
| Author: | Thomas Hoevel [ Thu Mar 19, 2015 4:51 pm ] |
| Post subject: | Re: Set initial view properties on existing PDF's |
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. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|