@Override protected void processOperator(PDFOperator arg0, List arg1) throws IOException { opIndex ++; /* System.out.print("arg0: " + arg0); for (Object o : arg1) { if (o instanceof COSString) { System.out.println(" " + ((COSString)o).getString()); } else { System.out.print(" " + o); } } System.out.println(); */ // TODO Auto-generated method stub super.processOperator(arg0, arg1); }
/** * process : Q : Restore graphics state. * @param operator The operator that is being executed. * @param arguments List */ public void process(PDFOperator operator, List arguments) { context.setGraphicsState( (PDGraphicsState)context.getGraphicsStack().pop() ); ((PDFObjectExtractor)context).popClipBounds(); } }
/** * process : q : Save graphics state. * @param operator The operator that is being executed. * @param arguments List */ public void process(PDFOperator operator, List arguments) { context.getGraphicsStack().push( (PDGraphicsState) context.getGraphicsState().clone() ); ((PDFObjectExtractor)context).pushClipBounds(); }
adjustment=(-adjustment/1000)*context.getGraphicsState().getTextState().getFontSize() * (context.getGraphicsState().getTextState().getHorizontalScalingPercent()/100); adjMatrix.setValue( 2, 0, adjustment ); context.setTextMatrix( adjMatrix.multiply( context.getTextMatrix() ) );
/** * w Set line width. * @param operator The operator that is being executed. * @param arguments List * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { super.process( operator, arguments ); float lineWidth = (float)context.getGraphicsState().getLineWidth(); if( lineWidth == 0 ) { lineWidth = 1; } ((PDFObjectExtractor)context).getGraphics().setStroke( new BasicStroke( lineWidth ) ); } }
getContext().processSubStream( page, pdResources, invoke );
/** * CS Set color space for stroking operations. * @param operator The operator that is being executed. * @param arguments List * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { super.process( operator, arguments ); PDFObjectExtractor drawer = (PDFObjectExtractor)context; // PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace(); PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor(); Color color = colorInstance.getJavaColor(); drawer.setStrokingColor( color ); // System.out.println("setting strokingColor: " + color); } }
/** * fill and stroke the path. * @param operator The operator that is being executed. * @param arguments List * * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { PDFObjectExtractor drawer = (PDFObjectExtractor)context; drawer.simpleFillPath(); GeneralPath currentPath = (GeneralPath)drawer.getLinePath().clone(); context.processOperator( "f", arguments ); drawer.setLinePath( currentPath ); context.processOperator( "S", arguments ); } }
/** * k Set color space for non stroking operations. * @param operator The operator that is being executed. * @param arguments List * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { super.process( operator, arguments ); PDFObjectExtractor drawer = (PDFObjectExtractor)context; // PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace(); PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor(); Color color = colorInstance.getJavaColor(); drawer.setNonStrokingColor( color ); } }
super.processOperator( operator, arguments );
/** * cs Set color space for non stroking operations. * @param operator The operator that is being executed. * @param arguments List * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { try { super.process( operator, arguments ); PDFObjectExtractor drawer = (PDFObjectExtractor)context; // PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace(); PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor(); Color color = colorInstance.getJavaColor(); drawer.setNonStrokingColor( color ); } catch( IOException e ) { //ignore for now and continue drawing } } }
/** * CS Set color space for stroking operations. * @param operator The operator that is being executed. * @param arguments List * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { super.process( operator, arguments ); try { PDFObjectExtractor drawer = (PDFObjectExtractor)context; // PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace(); PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor(); Color color = colorInstance.getJavaColor(); drawer.setStrokingColor( color ); } catch( IOException e ) { //ignore for now and continue drawing } } }