Package org.pdfbox.pdmodel.interactive.documentnavigation.destination

Examples of org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination


            {
                throw new OutlineNotLocalException( "Error: Outline does not reference a local page." );
            }
        }
       
        PDPageDestination pageDest = null;
        if( rawDest instanceof PDNamedDestination )
        {
            //if we have a named destination we need to lookup the PDPageDestination
            PDNamedDestination namedDest = (PDNamedDestination)rawDest;
            PDDocumentNameDictionary namesDict = doc.getDocumentCatalog().getNames();
            if( namesDict != null )
            {
                PDDestinationNameTreeNode destsTree = namesDict.getDests();
                if( destsTree != null )
                {
                    pageDest = (PDPageDestination)destsTree.getValue( namedDest.getNamedDestination() );
                }
            }
        }
        else if( rawDest instanceof PDPageDestination)
        {
            pageDest = (PDPageDestination) rawDest;
        }
        else if( rawDest == null )
        {
            //if the destination is null then we will simply return a null page.
        }
        else
        {
            throw new IOException( "Error: Unknown destination type " + rawDest );
        }
       
        if( pageDest != null )
        {
            page = pageDest.getPage();
            if( page == null )
            {
                int pageNumber = pageDest.getPageNumber();
                if( pageNumber != -1 )
                {
                    List allPages = doc.getDocumentCatalog().getAllPages();
                    page = (PDPage)allPages.get( pageNumber );
                }
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.