1 31 package org.pdfbox.util.operator.pagedrawer; 32 33 import java.util.List ; 34 import org.pdfbox.pdfviewer.PageDrawer; 35 import org.pdfbox.util.PDFOperator; 36 37 import java.awt.Graphics2D ; 38 import java.awt.geom.GeneralPath ; 39 import java.io.IOException ; 40 41 47 public class StrokePath extends org.pdfbox.util.operator.SetLineWidth 48 { 49 50 57 public void process(PDFOperator operator, List arguments) throws IOException 58 { 59 PageDrawer drawer = (PageDrawer)context; 60 Graphics2D graphics = ((PageDrawer)context).getGraphics(); 61 graphics.setColor( drawer.getStrokingColor() ); 62 List subPaths = drawer.getLineSubPaths(); 63 for( int i=0; i<subPaths.size(); i++ ) 64 { 65 GeneralPath subPath = (GeneralPath )subPaths.get( i ); 66 graphics.draw( subPath ); 67 } 68 subPaths.clear(); 69 GeneralPath path = drawer.getLinePath(); 70 graphics.draw( path ); 71 path.reset(); 72 } 73 } 74 | Popular Tags |