Package org.jpedal.parser

Examples of org.jpedal.parser.PdfStreamDecoder


                                }else if(!objDecoder.resolveFully(Resources)){
                                    linObject=null;
                                    isPageAvailable=false;
                                }else{
                                    Resources.isDataExternal(true);
                                    new PdfStreamDecoder(currentPdfFile).readResources(Resources,true);
                                    if(!Resources.isFullyResolved()){
                                        linObject=null;
                                        isPageAvailable=false;
                                    }
                                }
View Full Code Here


                if (pdfObject != null) {

                    /** the ObjectStore for this file */
                    ObjectStore objectStoreRef = new ObjectStore();

                    PdfStreamDecoder current = new PdfStreamDecoder(currentPdfFile, false, layers);
                    current.setParameters(true, false, 0,PdfDecoder.TEXT + PdfDecoder.RAWIMAGES + PdfDecoder.FINALIMAGES);
                    current.setXMLExtraction(false);
                    current.setObjectValue(ValueTypes.Name, "markedContent");
                    current.setObjectValue(ValueTypes.ObjectStore,objectStoreRef);
                    current.setObjectValue(ValueTypes.StatusBar, null);
                    current.setObjectValue(ValueTypes.PDFPageData,pdfPageData);
                    current.setIntValue(ValueTypes.PageNum, pageNumber);

                    res.setupResources(current, false, pdfObject.getDictionary(PdfDictionary.Resources), pageNumber, currentPdfFile);

                    current.setObjectValue(ValueTypes.MarkedContent,pageStream);

                    current.decodePageContent(pdfObject);

                    objectStoreRef.flush();

                }
            }catch(Exception e){
View Full Code Here

        PdfObject Resources=PatternObj.getDictionary(PdfDictionary.Resources);

        //decode and create graphic of glyph

        PdfStreamDecoder glyphDecoder=new PdfStreamDecoder(currentPdfFile);
        glyphDecoder.setParameters(false,true,7,0);

        glyphDecoder.setIntValue(ValueTypes.StreamType, ValueTypes.PATTERN);

        glyphDecoder.setObjectValue(ValueTypes.ObjectStore,localStore);

        //glyphDecoder.setMultiplier(multiplyer);


        //T3Renderer glyphDisplay=new T3Display(0,false,20,localStore);
        T3Renderer glyphDisplay=new PatternDisplay(0,false,20,localStore);
        glyphDisplay.setOptimisedRotation(false);
       
        try{
            glyphDecoder.setObjectValue(ValueTypes.DynamicVectorRenderer,glyphDisplay);

            /**read the resources for the page*/
            if (Resources != null){
                glyphDecoder.readResources(Resources,true);
            }
            glyphDecoder.setDefaultColors(gs.getStrokeColor(),gs.getNonstrokeColor());

            /**
             * setup matrix so scales correctly
             **/
            GraphicsState currentGraphicsState=new GraphicsState(0,0);
            //multiply to get new CTM
            if(matrix!=null)
                currentGraphicsState.CTM =matrix;


            glyphDecoder.decodePageContent(currentGraphicsState, streamData);


        } catch (PdfException e1) {
            e1.printStackTrace();
        }
View Full Code Here

        else
            //if(useHires)
                glyphDisplay.setHiResImageForDisplayMode(useHires);


            PdfStreamDecoder glyphDecoder=new PdfStreamDecoder(currentPdfFile,useHires,null); //switch to hires as well
            glyphDecoder.setParameters(false,true,15,0);

            glyphDecoder.setIntValue(ValueTypes.StreamType, ValueTypes.FORM);

            glyphDecoder.setBooleanValue(ValueTypes.XFormFlattening, true);
            glyphDecoder.setObjectValue(ValueTypes.ObjectStore,localStore);


            glyphDecoder.setObjectValue(ValueTypes.DynamicVectorRenderer,glyphDisplay);

        /**read any resources*/
        try{
          PdfObject Resources =XObject.getDictionary(PdfDictionary.Resources);
          if (Resources != null)
            glyphDecoder.readResources(Resources,false);

        }catch(Exception e){
          e.printStackTrace();
          System.out.println("Exception "+e+" reading resources in XForm");
        }

            /**decode the stream*/
        byte[] commands=XObject.getDecodedStream();

       
            if(commands!=null)
          glyphDecoder.decodeStreamIntoObjects(commands,false);


        boolean ignoreColors=glyphDecoder.ignoreColors;

        glyphDecoder=null;
View Full Code Here

TOP

Related Classes of org.jpedal.parser.PdfStreamDecoder

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.