Package org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline

Examples of org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline


     *
     * @return The document's outline.
     */
    public PDDocumentOutline getDocumentOutline()
    {
        PDDocumentOutline retval = null;
        COSDictionary dict = (COSDictionary)root.getDictionaryObject( COSName.OUTLINES );
        if( dict != null )
        {
            retval = new PDDocumentOutline( dict );
        }

        return retval;
    }
View Full Code Here


                cloner.cloneMerge(srcNames, destNames);
            }

        }

        PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
        PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
        if (srcOutline != null)
        {
            if (destOutline == null)
            {
                PDDocumentOutline cloned = new PDDocumentOutline((COSDictionary) cloner.cloneForNewDocument(srcOutline));
                destCatalog.setDocumentOutline(cloned);
            }
            else
            {
                PDOutlineItem first = srcOutline.getFirstChild();
View Full Code Here

    public void validate(PreflightContext ctx) throws ValidationException
    {
        PDDocumentCatalog catalog = ctx.getDocument().getDocumentCatalog();
        if (catalog != null)
        {
            PDDocumentOutline outlineHierarchy = catalog.getDocumentOutline();
            if (outlineHierarchy != null)
            {
                // Count entry is mandatory if there are childrens
                if (!isCountEntryPresent(outlineHierarchy.getCOSDictionary())
                        && (outlineHierarchy.getFirstChild() != null || outlineHierarchy.getLastChild() != null))
                {
                    addValidationError(ctx, new ValidationError(ERROR_SYNTAX_TRAILER_OUTLINES_INVALID,
                            "Outline Hierarchy doesn't have Count entry"));
                }
                else if (isCountEntryPositive(ctx, outlineHierarchy.getCOSDictionary())
                        && (outlineHierarchy.getFirstChild() == null || outlineHierarchy.getLastChild() == null))
                {
                    addValidationError(ctx, new ValidationError(ERROR_SYNTAX_TRAILER_OUTLINES_INVALID,
                            "Outline Hierarchy doesn't have First and/or Last entry(ies)"));
                }
                else
                {
                    exploreOutlineLevel(ctx, outlineHierarchy.getFirstChild());
                }
            }
        }
        else
        {
View Full Code Here

                cloner.cloneMerge(srcNames, destNames);
            }

        }

        PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
        PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
        if (srcOutline != null)
        {
            if (destOutline == null)
            {
                PDDocumentOutline cloned = new PDDocumentOutline((COSDictionary) cloner.cloneForNewDocument(srcOutline));
                destCatalog.setDocumentOutline(cloned);
            }
            else
            {
                PDOutlineItem first = srcOutline.getFirstChild();
View Full Code Here

      throws ValidationException {
    List<ValidationError> result = new ArrayList<ValidationError>(0);

    PDDocumentCatalog catalog = handler.getDocument().getDocumentCatalog();
    if (catalog != null) {
      PDDocumentOutline outlineHierarchy = catalog.getDocumentOutline();
      if (outlineHierarchy != null) {
        // ---- Count entry is mandatory if there are childrens
        if (!isCountEntryPresent(outlineHierarchy.getCOSDictionary()) && (outlineHierarchy.getFirstChild() != null || outlineHierarchy.getLastChild() != null) ) {
          result.add(new ValidationError(
              ERROR_SYNTAX_TRAILER_OUTLINES_INVALID,
              "Outline Hierarchy doesn't have Count entry"));
        } else if (isCountEntryPositive(outlineHierarchy.getCOSDictionary(), handler.getDocument().getDocument())
            && (outlineHierarchy.getFirstChild() == null || outlineHierarchy.getLastChild() == null)) {
          result.add(new ValidationError(ERROR_SYNTAX_TRAILER_OUTLINES_INVALID,
              "Outline Hierarchy doesn't have First and/or Last entry(ies)"));
        } else {
          exploreOutlineLevel(outlineHierarchy.getFirstChild(), handler, result);
        }
      }
    } else {
      throw new ValidationException(
          "There are no Catalog entry in the Document.");
View Full Code Here

                cloner.cloneMerge(srcNames, destNames);
            }

        }

        PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
        PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
        if( srcOutline != null )
        {
            if( destOutline == null )
            {
                PDDocumentOutline cloned =
                    new PDDocumentOutline( (COSDictionary)cloner.cloneForNewDocument( srcOutline ) );
                destCatalog.setDocumentOutline( cloned );
            }
            else
            {
                PDOutlineItem first = srcOutline.getFirstChild();
View Full Code Here

     *
     * @return The document's outline.
     */
    public PDDocumentOutline getDocumentOutline()
    {
        PDDocumentOutline retval = null;
        COSDictionary dict = (COSDictionary)root.getDictionaryObject( COSName.OUTLINES );
        if( dict != null )
        {
            retval = new PDDocumentOutline( dict );
        }

        return retval;
    }
View Full Code Here

                cloneMerge(destination, srcNames, destNames);
            }  
               
        }

        PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
        PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
        if( srcOutline != null )
        {
            if( destOutline == null )
            {
                PDDocumentOutline cloned =
                    new PDDocumentOutline( (COSDictionary)cloneForNewDocument( destination, srcOutline ) );
                destCatalog.setDocumentOutline( cloned );
            }
            else
            {
                PDOutlineItem first = srcOutline.getFirstChild();
View Full Code Here

                if( document.isEncrypted() )
                {
                    document.decrypt( "" );
                }
                PrintBookmarks meta = new PrintBookmarks();
                PDDocumentOutline outline =  document.getDocumentCatalog().getDocumentOutline();
                if( outline != null )
                {
                    meta.printBookmark( outline, "" );
                }
                else
View Full Code Here

                cloner.cloneMerge(srcNames, destNames);
            }

        }

        PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
        PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
        if( srcOutline != null )
        {
            if( destOutline == null )
            {
                PDDocumentOutline cloned =
                    new PDDocumentOutline( (COSDictionary)cloner.cloneForNewDocument( srcOutline ) );
                destCatalog.setDocumentOutline( cloned );
            }
            else
            {
                PDOutlineItem first = srcOutline.getFirstChild();
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline

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.