Package org.pdfbox.pdmodel

Examples of org.pdfbox.pdmodel.PDResources


     *
     * @return The appearance stream resources.
     */
    public PDResources getResources()
    {
        PDResources retval = null;
        COSDictionary dict = (COSDictionary)stream.getDictionaryObject( COSName.RESOURCES );
        if( dict != null )
        {
            retval = new PDResources( dict );
        }
        return retval;
    }
View Full Code Here


    return fonts;
  }

  private void getDocumentFonts() {
    fonts = new LinkedList();
    PDResources ress;
    LinkedList myFontList = null;
    if (!pdDocument.isEncrypted()) {
      try {
        for (int page = 0; page < pdDocument.getNumberOfPages(); page++) {
          ress = ((PDPage) (pdDocument.getDocumentCatalog()
              .getAllPages().get(page))).findResources();
          myFontList = new LinkedList(ress.getFonts().values());
          for (int i = 0; i < myFontList.size(); i++) {
            fonts.add(new PdfBoxFontAdapter(((PDFont) (myFontList
                .get(i))).getBaseFont(), ((PDFont) (myFontList
                .get(i))).getSubType(), page));
          }
View Full Code Here

        Iterator pagesIter = pages.iterator();
        while( pagesIter.hasNext() )
        {
            PDPage page = (PDPage)pagesIter.next();
            COSBase contents = page.getCOSDictionary().getDictionaryObject( COSName.CONTENTS );
            PDResources resources = page.findResources();
            if( resources == null )
            {
                resources = new PDResources();
                page.setResources( resources );
            }
            COSDictionary res = resources.getCOSDictionary();

            if( contents instanceof COSStream )
            {
                COSStream stream = (COSStream) contents;
                Map objectNameMap = new TreeMap();
View Full Code Here

    private void mergePage(int pageCount, COSArray array, PDPage page, List layoutPages)
    {
        int layoutPageNum = pageCount % layoutPages.size();
        LayoutPage layoutPage = (LayoutPage) layoutPages.get(layoutPageNum);
        PDResources resources = page.findResources();
        if( resources == null )
        {
            resources = new PDResources();
            page.setResources( resources );
        }
        COSDictionary docResDict = (COSDictionary) resources.getCOSDictionary();
        COSDictionary layoutResDict = layoutPage.res;
        mergeArray(PROC_SET, docResDict, layoutResDict);
        mergeDictionary(COSName.FONT, docResDict, layoutResDict, layoutPage.objectNameMap);
        mergeDictionary(XOBJECT, docResDict, layoutResDict, layoutPage.objectNameMap);
        mergeDictionary(EXT_G_STATE, docResDict, layoutResDict, layoutPage.objectNameMap);
View Full Code Here

        long start = System.currentTimeMillis();
        if( log.isDebugEnabled() )
        {
            log.debug( "processPage( " + page + ", " + content + " )" );
        }
        PDResources resources = page.findResources();
        Map fonts = null;
        if( resources != null )
        {
            fonts = resources.getFonts();
        }
        currentPage++;
        if( currentPage >= startPage && currentPage <= endPage )
        {
            charactersList.clear();
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.PDResources

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.