/** * The cm operator. Concatenates the current transformation matrix with the given * {@link AffineTransform}. * @param at the transformation matrix * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #transform} instead. */ @Deprecated public void concatenate2CTM(AffineTransform at) throws IOException { transform(new Matrix(at)); }
/** * The cm operator. Concatenates the current transformation matrix with the given values. * @param a The a value of the matrix. * @param b The b value of the matrix. * @param c The c value of the matrix. * @param d The d value of the matrix. * @param e The e value of the matrix. * @param f The f value of the matrix. * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #transform} instead. */ @Deprecated public void concatenate2CTM(double a, double b, double c, double d, double e, double f) throws IOException { transform(new Matrix((float) a, (float) b, (float) c, (float) d, (float) e, (float) f)); }
transform(new Matrix(transform));
contentStream.transform(new Matrix(transform)); contentStream.drawForm(form); contentStream.restoreGraphicsState();
PDPageContentStream.AppendMode.PREPEND, false)) cs.transform(Matrix.getRotateInstance(-Math.toRadians(angle), 0, 0));
/** * The cm operator. Concatenates the current transformation matrix with the given * {@link AffineTransform}. * @param at the transformation matrix * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #transform} instead. */ @Deprecated public void concatenate2CTM(AffineTransform at) throws IOException { transform(new Matrix(at)); }
contentStream.transform(transformationMatrix);
cs.transform(Matrix.getRotateInstance(-Math.toRadians(angle), 0, 0));
/** * The cm operator. Concatenates the current transformation matrix with the given * {@link AffineTransform}. * @param at the transformation matrix * @throws IOException If there is an error writing to the stream. * @deprecated Use {@link #transform} instead. */ @Deprecated public void concatenate2CTM(AffineTransform at) throws IOException { transform(new Matrix(at)); }
public void applyPdfMatrix(AffineTransform transform) { try { cs.transform(new Matrix(transform)); } catch (IOException e) { logAndThrow("applyPdfMatrix", e); } }
public void applyPdfMatrix(AffineTransform transform) { try { cs.transform(new Matrix(transform)); } catch (IOException e) { logAndThrow("applyPdfMatrix", e); } }
PDDocument document = PDDocument.load(resource); PDPage page = document.getDocumentCatalog().getPages().get(0); PDPageContentStream cs = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.PREPEND, false, false); PDRectangle cropBox = page.getCropBox(); float tx = (cropBox.getLowerLeftX() + cropBox.getUpperRightX()) / 2; float ty = (cropBox.getLowerLeftY() + cropBox.getUpperRightY()) / 2; cs.transform(Matrix.getTranslateInstance(tx, ty)); cs.transform(Matrix.getRotateInstance(Math.toRadians(45), 0, 0)); cs.transform(Matrix.getTranslateInstance(-tx, -ty)); cs.close();
private void drawStringUsingText(AttributedCharacterIterator iterator, float x, float y) throws IOException, FontFormatException { contentStreamSaveState(); AffineTransform tf = new AffineTransform(baseTransform); tf.concatenate(transform); tf.translate(x, y); contentStream.transform(new Matrix(tf)); fontTextDrawer.drawText(iterator, fontDrawerEnv); contentStreamRestoreState(); }
public void placeXForm(float x, float y, PDFormXObject xFormObject) { try { cs.saveGraphicsState(); cs.transform(new Matrix(AffineTransform.getTranslateInstance(x, y))); cs.drawForm(xFormObject); cs.restoreGraphicsState(); } catch (IOException e) { logAndThrow("placeXForm", e); } } }
public void placeXForm(float x, float y, PDFormXObject xFormObject) { try { cs.saveGraphicsState(); cs.transform(new Matrix(AffineTransform.getTranslateInstance(x, y))); cs.drawForm(xFormObject); cs.restoreGraphicsState(); } catch (IOException e) { logAndThrow("placeXForm", e); } } }
PDDocument document = PDDocument.load(resource); PDPage page = document.getDocumentCatalog().getPages().get(0); PDPageContentStream cs = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.PREPEND, false, false); Matrix matrix = Matrix.getRotateInstance(Math.toRadians(45), 0, 0); cs.transform(matrix); cs.close(); PDRectangle cropBox = page.getCropBox(); Rectangle rectangle = cropBox.transform(matrix).getBounds(); PDRectangle newBox = new PDRectangle((float)rectangle.getX(), (float)rectangle.getY(), (float)rectangle.getWidth(), (float)rectangle.getHeight()); page.setCropBox(newBox); page.setMediaBox(newBox);
contentStream.transform(new Matrix(0, 1, -1, 0, pageWidth, 0)); contentStream.setFont( font, fontSize ); contentStream.beginText();