Version: (using KDE Devel) Installed from: Compiled sources kpdf doesn't recognize commands for expanding table of contents pdfbookmarksopen, pdfbookmarksopenlevel commands from hyperref package
These actions are not part of pdf 1.6 specification so that's a wish and not a bug
> These actions are not part of pdf 1.6 specification so that's a > wish and not a bug Hyperref creates PDF1.3 so it is hard believable these commands are not in 1.6 . Note: bookmarksopen and bookmarksopenlevel are _hyperref_ commands, not PDF.
You said it, they are _hyperref_ commands and not PDF, so they are not in the PDF spec, the PDF spec defines a few named actions and says "you have to implement that to be pdf compliant" and then says "other viewers/generators may implement other named actions but they have to keep in mind they are not going to be standard" So as i said this is a wish
btw having a document that uses that commands but be nice for testing
> btw having a document that uses that commands but be nice for testing http://skawina.eu.org/mikolaj/vst.pdf
And should i find in a 31 page document where the link having that command is?
> And should i find in a 31 page document where the link having > that command is? What link? This is property of PDF document. If you want smaller document here it is. Created an attachment (id=11312) bol.pdf
Maybe this helps to clarify: Yes, if you are using pdftex and hyperref to generate the pdf hyperref is responsible for creating this property of the future pdf-doc. So it is in the Doc and it is of PDF v.1.3 (Acrobat 4.x) My Win$$-Acrobat does what it should: Open the document with the Bookmark-Panel open and expanded bookmark-tree. Kpdf does not do that. bye, Rudy
> My Win$$-Acrobat does what it should: Open the document with the > Bookmark-Panel open and expanded bookmark-tree. Even xpdf (3.0 - didn't try earrlier versions) does that.
I can confirm this. Currently kpdf is the only pdf viewer I have found which does not expand the bookmarks and set the initial view as specified in the hyperref config.
Ok, now that i understood the whole thing, this IS a bug, let's see if we can get it fixed.
SVN commit 654682 by pino: React to the commands for opening the TOC pane, and for expanding the subtrees of the TOC. BUG: 104081 M +8 -0 core/generator_pdf/generator_pdf.cpp M +5 -0 part.cpp M +8 -0 ui/toc.cpp --- branches/KDE/3.5/kdegraphics/kpdf/core/generator_pdf/generator_pdf.cpp #654681:654682 @@ -15,6 +15,7 @@ #include <qapplication.h> #include <qpaintdevicemetrics.h> #include <qregexp.h> +#include <qvariant.h> #include <kapplication.h> #include <klistview.h> #include <klocale.h> @@ -582,6 +583,11 @@ if ( viewport.pageNumber >= 0 ) return viewport.toString(); } + else if ( key == "OpenTOC" ) + { + if ( pdfdoc->getCatalog()->getPageMode() == Catalog::UseOutlines ) + return "yes"; + } return QString(); } @@ -866,6 +872,8 @@ } } + item.setAttribute( "Open", QVariant( (bool)outlineItem->isOpen() ).toString() ); + // 3. recursively descend over children outlineItem->open(); GList * children = outlineItem->getKids(); --- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #654681:654682 @@ -470,6 +470,11 @@ if ( !m_watcher->contains(m_file) ) m_watcher->addFile(m_file); + // if the 'OpenTOC' flag is set, open the TOC + if ( m_document->getMetaData( "OpenTOC" ) == "yes" && m_toolBox->isItemEnabled( 0 ) ) + { + m_toolBox->setCurrentIndex( 0 ); + } // if the 'StartFullScreen' flag is set, start presentation if ( m_document->getMetaData( "StartFullScreen" ) == "yes" ) { --- branches/KDE/3.5/kdegraphics/kpdf/ui/toc.cpp #654681:654682 @@ -9,6 +9,7 @@ // qt/kde includes #include <qheader.h> +#include <qvariant.h> #include <klocale.h> // local includes @@ -121,6 +122,13 @@ // descend recursively and advance to the next node if ( e.hasChildNodes() ) addChildren( n, currentItem ); + + // open/keep close the item + bool isOpen = false; + if ( e.hasAttribute( "Open" ) ) + isOpen = QVariant( e.attribute( "Open" ) ).toBool(); + currentItem->setOpen( isOpen ); + n = n.nextSibling(); } }