private PdfCanvas addImage(PdfXObject xObject, float a, float b, float c, float d, float e, float f) { saveState(); concatMatrix(a, b, c, d, e, f); PdfName name = resources.addImage(xObject.getPdfObject()); contentStream.getOutputStream().write(name).writeSpace().writeBytes(Do); restoreState(); return this; }
/** * Adds {@code PdfImageXObject} to canvas. * * @param image the {@code PdfImageXObject} object * @param a an element of the transformation matrix * @param b an element of the transformation matrix * @param c an element of the transformation matrix * @param d an element of the transformation matrix * @param e an element of the transformation matrix * @param f an element of the transformation matrix * @return canvas a reference to this object. */ private PdfCanvas addImage(PdfImageXObject image, float a, float b, float c, float d, float e, float f) { saveState(); concatMatrix(a, b, c, d, e, f); PdfName name = resources.addImage(image); contentStream.getOutputStream().write(name).writeSpace().writeBytes(Do); restoreState(); return this; }
PdfImageXObject imgXObj = new PdfImageXObject(img); canvas.addXObject(imgXObj, width - borderWidth, 0, 0, height - borderWidth, borderWidth / 2, borderWidth / 2); xObject.getResources().addImage(imgXObj); } else if (form != null) { canvas.addXObject(form, (height - borderWidth) / form.getHeight(), 0, 0, (height - borderWidth) / form.getHeight(), borderWidth / 2, borderWidth / 2);
PdfImageXObject imgXObj = new PdfImageXObject(img); canvas.addXObject(imgXObj, width - borderWidth, 0, 0, height - borderWidth, borderWidth / 2, borderWidth / 2); xObject.getResources().addImage(imgXObj); } else if (form != null) { canvas.addXObject(form, (height - borderWidth) / form.getHeight(), 0, 0, (height - borderWidth) / form.getHeight(), borderWidth / 2, borderWidth / 2);