/** * Default constructor. * * @throws IOException If there is an error loading text stripper properties. */ public PrintImageLocations() throws IOException { addOperator(new Concatenate()); addOperator(new DrawObject()); addOperator(new SetGraphicsStateParameters()); addOperator(new Save()); addOperator(new Restore()); addOperator(new SetMatrix()); }
@Override public void process(Operator operator, List<COSBase> arguments) throws IOException { if (context.getGraphicsStackSize() > 1) { context.restoreGraphicsState(); } else { // this shouldn't happen but it does, see PDFBOX-161 throw new EmptyGraphicsStackException(); } }
@Override public void process(Operator operator, List<COSBase> operands) throws IOException { if (operands.size() < 1) { throw new MissingOperandException(operator, operands); } if (!checkArrayTypesClass(operands, COSNumber.class)) { return; } COSNumber value = (COSNumber) operands.get(0); context.getGraphicsState().setFlatness(value.floatValue()); }
addOperator(new BeginText()); addOperator(new CurveTo()); addOperator(new Concatenate()); addOperator(new SetStrokingColorSpace()); addOperator(new SetNonStrokingColorSpace()); addOperator(new SetLineDashPattern()); addOperator(new DrawObject()); // special graphics version addOperator(new EndText()); addOperator(new SetStrokingDeviceGrayColor()); addOperator(new SetNonStrokingDeviceGrayColor()); addOperator(new SetGraphicsStateParameters()); addOperator(new ClosePath()); addOperator(new SetFlatness()); addOperator(new SetLineJoinStyle()); addOperator(new SetLineCapStyle()); addOperator(new SetStrokingDeviceCMYKColor()); addOperator(new SetNonStrokingDeviceCMYKColor()); addOperator(new LineTo()); addOperator(new MoveTo()); addOperator(new SetLineMiterLimit()); addOperator(new EndPath()); addOperator(new Save()); addOperator(new Restore()); addOperator(new AppendRectangleToPath()); addOperator(new SetStrokingDeviceRGBColor()); addOperator(new SetNonStrokingDeviceRGBColor()); addOperator(new SetRenderingIntent()); addOperator(new CloseAndStrokePath());
addOperator(new SetLineWidth()); addOperator(new Concatenate()); addOperator(new SetLineDashPattern()); addOperator(new DrawObject()); addOperator(new SetLineJoinStyle()); addOperator(new SetLineCapStyle()); addOperator(new SetStrokingDeviceCMYKColor()); addOperator(new SetNonStrokingDeviceCMYKColor()); addOperator(new Restore()); addOperator(new Save()); addOperator(new SetGraphicsStateParameters()); addOperator(new SetFontAndSize()); addOperator(new SetTextRenderingMode()); addOperator(new SetMatrix()); addOperator(new MoveText()); addOperator(new NextLine());
public PDFBoxTree() throws IOException { super(); super.setSortByPosition(true); super.setSuppressDuplicateOverlappingText(true); //add operators for tracking the graphic state addOperator(new SetStrokingColorSpace()); addOperator(new SetNonStrokingColorSpace()); addOperator(new SetLineDashPattern()); addOperator(new SetStrokingDeviceGrayColor()); addOperator(new SetNonStrokingDeviceGrayColor()); addOperator(new SetFlatness()); addOperator(new SetLineJoinStyle()); addOperator(new SetLineCapStyle()); addOperator(new SetStrokingDeviceCMYKColor()); addOperator(new SetNonStrokingDeviceCMYKColor()); addOperator(new SetLineMiterLimit()); addOperator(new SetStrokingDeviceRGBColor()); addOperator(new SetNonStrokingDeviceRGBColor()); addOperator(new SetRenderingIntent()); addOperator(new SetStrokingColor()); addOperator(new SetNonStrokingColor()); addOperator(new SetStrokingColorN()); addOperator(new SetNonStrokingColorN()); addOperator(new SetFontAndSize()); addOperator(new SetLineWidth()); init(); }
Save s = new Save(...); s.set...(...); // maybe ... equal.add(s);
@Override public void process(Operator operator, List<COSBase> arguments) throws MissingOperandException { if (arguments.size() < 6) { throw new MissingOperandException(operator, arguments); } if (!checkArrayTypesClass(arguments, COSNumber.class)) { return; } COSNumber a = (COSNumber)arguments.get( 0 ); COSNumber b = (COSNumber)arguments.get( 1 ); COSNumber c = (COSNumber)arguments.get( 2 ); COSNumber d = (COSNumber)arguments.get( 3 ); COSNumber e = (COSNumber)arguments.get( 4 ); COSNumber f = (COSNumber)arguments.get( 5 ); Matrix matrix = new Matrix(a.floatValue(), b.floatValue(), c.floatValue(), d.floatValue(), e.floatValue(), f.floatValue()); context.setTextMatrix(matrix); context.setTextLineMatrix(matrix.clone()); }
@Override public void process(Operator operator, List<COSBase> arguments) throws IOException { if (arguments.size() < 6) { throw new MissingOperandException(operator, arguments); } if (!checkArrayTypesClass(arguments, COSNumber.class)) { return; } // concatenate matrix to current transformation matrix COSNumber a = (COSNumber) arguments.get(0); COSNumber b = (COSNumber) arguments.get(1); COSNumber c = (COSNumber) arguments.get(2); COSNumber d = (COSNumber) arguments.get(3); COSNumber e = (COSNumber) arguments.get(4); COSNumber f = (COSNumber) arguments.get(5); Matrix matrix = new Matrix(a.floatValue(), b.floatValue(), c.floatValue(), d.floatValue(), e.floatValue(), f.floatValue()); context.getGraphicsState().getCurrentTransformationMatrix().concatenate(matrix); }
addOperator(new Concatenate()); addOperator(new DrawObject()); // special text version addOperator(new EndText()); addOperator(new SetGraphicsStateParameters()); addOperator(new Save()); addOperator(new Restore()); addOperator(new NextLine()); addOperator(new SetCharSpacing()); addOperator(new ShowTextAdjusted()); addOperator(new SetTextLeading()); addOperator(new SetMatrix()); addOperator(new SetTextRenderingMode()); addOperator(new SetTextRise());
@Override public void process(Operator operator, List<COSBase> arguments) throws IOException { if (context.getGraphicsStackSize() > 1) { context.restoreGraphicsState(); } else { // this shouldn't happen but it does, see PDFBOX-161 throw new EmptyGraphicsStackException(); } }
@Override public void process(Operator operator, List<COSBase> operands) throws IOException { if (operands.size() < 1) { throw new MissingOperandException(operator, operands); } if (!checkArrayTypesClass(operands, COSNumber.class)) { return; } COSNumber value = (COSNumber) operands.get(0); context.getGraphicsState().setFlatness(value.floatValue()); }
public ImageExtractor() { addOperator(new Concatenate()); addOperator(new DrawObject()); addOperator(new SetGraphicsStateParameters()); addOperator(new Save()); addOperator(new Restore()); addOperator(new SetMatrix()); }
... public Main(){ Save saveObject = new Save(); saveObject.field = new JTextField(12); saveObject.button = new JButton("Click"); add(saveObject.field); add(saveObject.button); this.save = saveObject;//assuming you have a class field of type Save named "save" ...
@Override public void process(Operator operator, List<COSBase> arguments) throws IOException { if (context.getGraphicsStackSize() > 1) { context.restoreGraphicsState(); } else { // this shouldn't happen but it does, see PDFBOX-161 throw new EmptyGraphicsStackException(); } }
/** * Default constructor. * * @throws IOException If there is an error loading text stripper properties. */ public PrintImageLocations() throws IOException { addOperator(new Concatenate()); addOperator(new DrawObject()); addOperator(new SetGraphicsStateParameters()); addOperator(new Save()); addOperator(new Restore()); addOperator(new SetMatrix()); }