/** * Rotares this matrix by the given factors. * * @param theta The angle of rotation measured in radians */ public void rotate(double theta) { Matrix m = Matrix.getRotateInstance(theta, 0, 0); concatenate(m); }
/** * The Tm operator. Sets the text matrix to the given rotation and translation values. * A current text matrix will be replaced with the new one. * @param angle The angle used for the counterclockwise rotation in radians. * @param tx The translation value in x-direction. * @param ty The translation value in y-direction. * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #setTextMatrix(Matrix)} instead. */ @Deprecated public void setTextRotation(double angle, double tx, double ty) throws IOException { setTextMatrix(Matrix.getRotateInstance(angle, (float) tx, (float) ty)); }
private AffineTransform calculateMatrix(PDRectangle bbox, int rotation) { if (rotation == 0) { return new AffineTransform(); } float tx = 0, ty = 0; switch (rotation) { case 90: tx = bbox.getUpperRightY(); break; case 180: tx = bbox.getUpperRightY(); ty = bbox.getUpperRightX(); break; case 270: ty = bbox.getUpperRightX(); break; default: break; } Matrix matrix = Matrix.getRotateInstance(Math.toRadians(rotation), tx, ty); return matrix.createAffineTransform(); }
cs.transform(Matrix.getRotateInstance(angle, x1, y1)); cs.transform(Matrix.getRotateInstance(angle, x2, y2));
private void drawUpLeftArrow(PDAnnotationText annotation, final PDAppearanceContentStream contentStream) throws IOException { adjustRectAndBBox(annotation, 17, 17); contentStream.setMiterLimit(4); contentStream.setLineJoinStyle(1); contentStream.setLineCapStyle(0); contentStream.setLineWidth(0.59f); // value from Adobe contentStream.transform(Matrix.getRotateInstance(Math.toRadians(45), 8, -4)); contentStream.moveTo(1, 7); contentStream.lineTo(5, 7); contentStream.lineTo(5, 1); contentStream.lineTo(12, 1); contentStream.lineTo(12, 7); contentStream.lineTo(16, 7); contentStream.lineTo(8.5f, 19); contentStream.closeAndFillAndStroke(); }
cs.transform(Matrix.getRotateInstance(angle, x1, y1)); float lineLength = (float) Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); if (ANGLED_STYLES.contains(annotation.getStartPointEndingStyle())) cs.transform(Matrix.getRotateInstance(angle, x1, y1)); drawStyle(annotation.getStartPointEndingStyle(), cs, 0, y, lineEndingSize, hasStroke, hasBackground, false); cs.transform(Matrix.getRotateInstance(angle, x2, y2)); drawStyle(annotation.getEndPointEndingStyle(), cs, 0, y, lineEndingSize, hasStroke, hasBackground, true);
PDPageContentStream.AppendMode.PREPEND, false)) cs.transform(Matrix.getRotateInstance(-Math.toRadians(angle), 0, 0));
/** * Rotares this matrix by the given factors. * * @param theta The angle of rotation measured in radians */ public void rotate(double theta) { Matrix m = Matrix.getRotateInstance(theta, 0, 0); concatenate(m); }
cs.transform(Matrix.getRotateInstance(-Math.toRadians(angle), 0, 0));
/** * Rotares this matrix by the given factors. * * @param theta The angle of rotation measured in radians */ public void rotate(double theta) { Matrix m = Matrix.getRotateInstance(theta, 0, 0); concatenate(m); }
/** * The Tm operator. Sets the text matrix to the given rotation and translation values. * A current text matrix will be replaced with the new one. * @param angle The angle used for the counterclockwise rotation in radians. * @param tx The translation value in x-direction. * @param ty The translation value in y-direction. * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #setTextMatrix(Matrix)} instead. */ @Deprecated public void setTextRotation(double angle, double tx, double ty) throws IOException { setTextMatrix(Matrix.getRotateInstance(angle, (float) tx, (float) ty)); }
/** * The Tm operator. Sets the text matrix to the given rotation and translation values. * A current text matrix will be replaced with the new one. * @param angle The angle used for the counterclockwise rotation in radians. * @param tx The translation value in x-direction. * @param ty The translation value in y-direction. * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #setTextMatrix(Matrix)} instead. */ @Deprecated public void setTextRotation(double angle, double tx, double ty) throws IOException { setTextMatrix(Matrix.getRotateInstance(angle, (float) tx, (float) ty)); }
cs.transform(Matrix.getRotateInstance(angle, x1, y1)); cs.transform(Matrix.getRotateInstance(Math.toRadians(rotation), 0, 0)); float xOffset; float yOffset;
contentStream.setTextMatrix(Matrix.getRotateInstance(Math.PI / 2, centerX, centerY));
Matrix matrix = Matrix.getRotateInstance(Math.toRadians(rotation), 0, 0); Point2D.Float point2D = matrix.transformPoint(rect.getWidth(), rect.getHeight());
contentStream.transform(Matrix.getRotateInstance(Math.toRadians(45), 2500, -800));
contentStream.setTextMatrix(Matrix.getRotateInstance(i * Math.PI * 0.25, centeredXPosition, pageSize.getHeight() - centeredYPosition)); contentStream.showText(message + " " + i); contentStream.setTextMatrix(Matrix.getRotateInstance(-i*Math.PI*0.25, centeredXPosition, centeredYPosition)); contentStream.showText(message + " " + i);
private AffineTransform calculateMatrix(PDRectangle bbox, int rotation) { if (rotation == 0) { return new AffineTransform(); } float tx = 0, ty = 0; switch (rotation) { case 90: tx = bbox.getUpperRightY(); break; case 180: tx = bbox.getUpperRightY(); ty = bbox.getUpperRightX(); break; case 270: ty = bbox.getUpperRightX(); break; default: break; } Matrix matrix = Matrix.getRotateInstance(Math.toRadians(rotation), tx, ty); return matrix.createAffineTransform(); }
private AffineTransform calculateMatrix(PDRectangle bbox, int rotation) { if (rotation == 0) { return new AffineTransform(); } float tx = 0, ty = 0; switch (rotation) { case 90: tx = bbox.getUpperRightY(); break; case 180: tx = bbox.getUpperRightY(); ty = bbox.getUpperRightX(); break; case 270: ty = bbox.getUpperRightX(); break; default: break; } Matrix matrix = Matrix.getRotateInstance(Math.toRadians(rotation), tx, ty); return matrix.createAffineTransform(); }
cs.transform(Matrix.getRotateInstance(-Math.toRadians(angle), 0, 0));