/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float x2 = ((PdfNumber) operands.get(0)).floatValue(); float y2 = ((PdfNumber) operands.get(1)).floatValue(); float x3 = ((PdfNumber) operands.get(2)).floatValue(); float y3 = ((PdfNumber) operands.get(3)).floatValue(); processor.currentPath.curveTo(x2, y2, x3, y3); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float x = ((PdfNumber) operands.get(0)).floatValue(); float y = ((PdfNumber) operands.get(1)).floatValue(); float w = ((PdfNumber) operands.get(2)).floatValue(); float h = ((PdfNumber) operands.get(3)).floatValue(); processor.currentPath.rectangle(x, y, w, h); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float x1 = ((PdfNumber) operands.get(0)).floatValue(); float y1 = ((PdfNumber) operands.get(1)).floatValue(); float x3 = ((PdfNumber) operands.get(2)).floatValue(); float y3 = ((PdfNumber) operands.get(3)).floatValue(); processor.currentPath.curveFromTo(x1, y1, x3, y3); } }
private static float[] getColorants(List<PdfObject> operands) { float[] c = new float[operands.size() - 1]; for (int i = 0; i < operands.size() - 1; i++) { c[i] = ((PdfNumber) operands.get(i)).floatValue(); } return c; }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float x = ((PdfNumber) operands.get(0)).floatValue(); float y = ((PdfNumber) operands.get(1)).floatValue(); processor.currentPath.lineTo(x, y); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float x = ((PdfNumber) operands.get(0)).floatValue(); float y = ((PdfNumber) operands.get(1)).floatValue(); processor.currentPath.moveTo(x, y); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float tx = ((PdfNumber) operands.get(0)).floatValue(); float ty = ((PdfNumber) operands.get(1)).floatValue(); Matrix translationMatrix = new Matrix(tx, ty); processor.textMatrix = translationMatrix.multiply(processor.textLineMatrix); processor.textLineMatrix = processor.textMatrix; } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { PdfNumber scale = (PdfNumber) operands.get(0); processor.getGraphicsState().setHorizontalScaling(scale.floatValue()); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { PdfNumber wordSpace = (PdfNumber) operands.get(0); processor.getGraphicsState().setWordSpacing(wordSpace.floatValue()); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { PdfNumber charSpace = (PdfNumber) operands.get(0); processor.getGraphicsState().setCharSpacing(charSpace.floatValue()); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral oper, List<PdfObject> operands) { float lineWidth = ((PdfNumber) operands.get(0)).floatValue(); processor.getGraphicsState().setLineWidth(lineWidth); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral oper, List<PdfObject> operands) { float miterLimit = ((PdfNumber) operands.get(0)).floatValue(); processor.getGraphicsState().setMiterLimit(miterLimit); } }
/** * {@inheritDoc} */ public void invoke(PdfCanvasProcessor processor, PdfLiteral operator, List<PdfObject> operands) { float ty = ((PdfNumber) operands.get(1)).floatValue(); List<PdfObject> tlOperands = new ArrayList<PdfObject>(1); tlOperands.add(0, new PdfNumber(-ty)); setTextLeading.invoke(processor, null, tlOperands); moveStartNextLine.invoke(processor, null, operands); } }
/** * The length of leader lines in default user space that extend from each endpoint of the line perpendicular * to the line itself. A positive value means that the leader lines appear in the direction that is clockwise * when traversing the line from its starting point to its ending point (as specified by {@link PdfName#L} (see {@link #getLine()}); * a negative value indicates the opposite direction. * @return a float specifying the length of leader lines in default user space. */ public float getLeaderLineLength() { PdfNumber n = getPdfObject().getAsNumber(PdfName.LL); return n == null ? 0 : n.floatValue(); }
/** * A non-negative number that represents the length of leader line extensions that extend from the line proper * 180 degrees from the leader lines. * @return a non-negative float that represents the length of leader line extensions; or if the leader line extension * is not explicitly set, returns the default value, which is 0. */ public float getLeaderLineExtension() { PdfNumber n = getPdfObject().getAsNumber(PdfName.LLE); return n == null ? 0 : n.floatValue(); }
/** * A non-negative number that represents the length of the leader line offset, which is the amount of empty space * between the endpoints of the annotation and the beginning of the leader lines. * @return a non-negative number that represents the length of the leader line offset, * or null if leader line offset is not set. */ public float getLeaderLineOffset() { PdfNumber n = getPdfObject().getAsNumber(PdfName.LLO); return n == null ? 0 : n.floatValue(); }
/** * PDF 2.0. When regenerating the annotation's appearance stream, this is the * opacity value that shall be used for stroking all visible * elements of the annotation in its closed state, including its background and border, but * not the popup window that appears when the annotation is opened. * * @return opacity for stroking operations, including background and border */ public float getStrokingOpacity() { PdfNumber strokingOpacity = getPdfObject().getAsNumber(PdfName.CA); return strokingOpacity != null ? strokingOpacity.floatValue() : 1; }
/** * Gets height based on XObject's BBox. * * @return float value. */ @Override public float getHeight() { return getBBox() == null ? 0 : getBBox().getAsNumber(3).floatValue() - getBBox().getAsNumber(1).floatValue(); }
/** * Gets width based on XObject's BBox. * * @return float value. */ @Override public float getWidth() { return getBBox() == null ? 0 : getBBox().getAsNumber(2).floatValue() - getBBox().getAsNumber(0).floatValue(); }
@Override public void add(PdfObject pdfObject) { if (pdfObject.isNumber()) { add(((PdfNumber)pdfObject).floatValue()); } else if (pdfObject instanceof PdfString) { add(((PdfString)pdfObject).getValueBytes()); } }