Examples of PdfKeyPairsIterator


Examples of org.jpedal.objects.raw.PdfKeyPairsIterator

                isAESIdentity=key.equals("Identity");

                stringsEncoded=true;

                PdfKeyPairsIterator keyPairs=CF.getKeyPairsIterator();

                while(keyPairs.hasMorePairs()){

                    CFkey=keyPairs.getNextKeyAsString();

                    if(CFkey.equals(key))
                        StrFObj=keyPairs.getNextValueAsDictionary();

                    //roll on
                    keyPairs.nextPair();
                }
            }

            key=encyptionObj.getName(PdfDictionary.StmF);

            if(key!=null){

                isAESIdentity=key.equals("Identity");

                PdfKeyPairsIterator keyPairs=CF.getKeyPairsIterator();

                while(keyPairs.hasMorePairs()){

                    CFkey=keyPairs.getNextKeyAsString();

                    if(CFkey.equals(key))
                        StmFObj=keyPairs.getNextValueAsDictionary();

                    //roll on
                    keyPairs.nextPair();
                }
            }
        }

        isEncrypted = true;
View Full Code Here

Examples of org.jpedal.objects.raw.PdfKeyPairsIterator

    /**
     * create list for lookup
     */
    private void setupOCMaps(PdfObject propertiesObj, PdfObjectReader currentPdfFile) {

        PdfKeyPairsIterator keyPairs=propertiesObj.getKeyPairsIterator();

        String glyphKey,ref;
        PdfObject glyphObj;

        while(keyPairs.hasMorePairs()){

            glyphKey=keyPairs.getNextKeyAsString();

            glyphObj=keyPairs.getNextValueAsDictionary();
            ref=glyphObj.getObjectRefAsString();

            currentPdfFile.checkResolved(glyphObj);

            byte[][] childPairs=glyphObj.getKeyArray(PdfDictionary.OCGs);

            if(childPairs!=null)
                setupchildOCMaps(childPairs, glyphKey,currentPdfFile);
            else{
                propertyMap.put(ref,glyphObj);

                String currentNames=(String) refToPropertyID.get(ref);
                if(currentNames==null)
                    refToPropertyID.put(ref, glyphKey);
                else
                    refToPropertyID.put(ref, currentNames+ ',' +glyphKey);
            }
            //roll on
            keyPairs.nextPair();
        }

    }
View Full Code Here

Examples of org.jpedal.objects.raw.PdfKeyPairsIterator

            }

            /**
             * read all the key pairs for Glyphs
             */
            PdfKeyPairsIterator keyPairs=CharProcs.getKeyPairsIterator();

            String glyphKey,pKey;
            PdfObject glyphObj;
           
            while(keyPairs.hasMorePairs()){

                glyphKey=keyPairs.getNextKeyAsString();               
                glyphObj=keyPairs.getNextValueAsDictionary();

                Object diffValue=null;
                if(diffLookup!=null){
                  pKey= StandardFonts.convertNumberToGlyph(glyphKey, containsHexNumbers, allNumbers);
                    diffValue=diffLookup.get(pKey);
                }

                //decode and store in array
                if(glyphObj!=null && renderPage){

                    //decode and create graphic of glyph
                    T3Renderer glyphDisplay=new T3Display(0,false,20,objectStore);

                    glyphDisplay.setHiResImageForDisplayMode(hires);
                    glyphDisplay.setType3Glyph(glyphKey);
                   
                    try{
                        glyphDecoder.setObjectValue(ValueTypes.DynamicVectorRenderer,glyphDisplay);
                        glyphDecoder.setDefaultColors(currentGraphicsState.getNonstrokeColor(),currentGraphicsState.getNonstrokeColor());
                        int  renderX,renderY;
                   

                        //if size is 1 we need to scale up so we can see
                        int factor=1;
                        double[] fontMatrix=pdfObject.getDoubleArray(PdfDictionary.FontMatrix);
                        if(fontMatrix!=null && fontMatrix[0]==1 && (fontMatrix[3]==1 || fontMatrix[3]==-1))
                        factor=10;
                       
                        GraphicsState gs=new GraphicsState(0,0);
                        gs.CTM = new float[][]{{factor,0,0},
                                {0,factor,0},{0,0,1}
                        };

                        T3Size t3 = glyphDecoder.decodePageContent(glyphObj, gs);


                        renderX=t3.x;
                        renderY=t3.y;

                        //allow for rotated on page in case swapped
                        if(renderX==0 && renderY!=0){
                            renderX=t3.y;
                            renderY=t3.x;                               
                        }

                        T3Glyph glyph=new T3Glyph(glyphDisplay, renderX,renderY,glyphDecoder.ignoreColors,glyphKey);
                        glyph.setScaling(1f/factor);

                        otherKey=-1;
                        if(diffValue!=null){
                          key= (Integer) diffValue;
                         
                          if(keyPairs.isNextKeyANumber())
                          otherKey=keyPairs.getNextKeyAsNumber();
                        }else
                          key=keyPairs.getNextKeyAsNumber();

                        glyphs.setT3Glyph(key,otherKey, glyph);

                    }catch(Exception e){
                      e.printStackTrace();
                     
                      if(LogWriter.isOutput())
                        LogWriter.writeLog("Exception "+e+" is Type3 font code");
                    }
                }
               
              //roll on
              keyPairs.nextPair();   
            }
            isFontEmbedded = true;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.