tp.addImage(image, image.getWidth(), 0, 0, image.getHeight(), 0, 0); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight(); tp.setBoundingBox(new Rectangle(template.getWidth(), template.getHeight())); writer.addDirectTemplateSimple(tp, PdfName.FRM); tp.addTemplate(template, template.getBoundingBox().getLeft(), template.getBoundingBox().getBottom()); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight();
tp.addImage(image, image.getWidth(), 0, 0, image.getHeight(), 0, 0); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight(); tp.setBoundingBox(new Rectangle(template.getWidth(), template.getHeight())); writer.addDirectTemplateSimple(tp, PdfName.FRM); tp.addTemplate(template, template.getBoundingBox().getLeft(), template.getBoundingBox().getBottom()); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight();
tp.addImage(image, image.getWidth(), 0, 0, image.getHeight(), 0, 0); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight(); tp.setBoundingBox(new Rectangle(template.getWidth(), template.getHeight())); writer.addDirectTemplateSimple(tp, PdfName.FRM); tp.addTemplate(template, template.getBoundingBox().getLeft(), template.getBoundingBox().getBottom()); haveIcon = true; boundingBoxWidth = tp.getBoundingBox().getWidth(); boundingBoxHeight = tp.getBoundingBox().getHeight();
/** * Constructs a <CODE>PdfFormXObject</CODE>-object. * * @param template the template * @param compressionLevel the compression level for the stream * @since 2.1.3 (Replacing the existing constructor with param compressionLevel) */ PdfFormXObject(PdfTemplate template, int compressionLevel) // throws BadPdfFormatException { super(); put(PdfName.TYPE, PdfName.XOBJECT); put(PdfName.SUBTYPE, PdfName.FORM); put(PdfName.RESOURCES, template.getResources()); put(PdfName.BBOX, new PdfRectangle(template.getBoundingBox())); put(PdfName.FORMTYPE, ONE); if (template.getLayer() != null) put(PdfName.OC, template.getLayer().getRef()); if (template.getGroup() != null) put(PdfName.GROUP, template.getGroup()); PdfArray matrix = template.getMatrix(); if (matrix == null) put(PdfName.MATRIX, MATRIX); else put(PdfName.MATRIX, matrix); bytes = template.toPdf(null); put(PdfName.LENGTH, new PdfNumber(bytes.length)); flateCompress(compressionLevel); }
/** * Constructs a <CODE>PdfFormXObject</CODE>-object. * * @param template the template * @param compressionLevel the compression level for the stream * @since 2.1.3 (Replacing the existing constructor with param compressionLevel) */ PdfFormXObject(PdfTemplate template, int compressionLevel) // throws BadPdfFormatException { super(); put(PdfName.TYPE, PdfName.XOBJECT); put(PdfName.SUBTYPE, PdfName.FORM); put(PdfName.RESOURCES, template.getResources()); put(PdfName.BBOX, new PdfRectangle(template.getBoundingBox())); put(PdfName.FORMTYPE, ONE); if (template.getLayer() != null) put(PdfName.OC, template.getLayer().getRef()); if (template.getGroup() != null) put(PdfName.GROUP, template.getGroup()); PdfArray matrix = template.getMatrix(); if (matrix == null) put(PdfName.MATRIX, MATRIX); else put(PdfName.MATRIX, matrix); bytes = template.toPdf(null); put(PdfName.LENGTH, new PdfNumber(bytes.length)); flateCompress(compressionLevel); }
/** * Constructs a <CODE>PdfFormXObject</CODE>-object. * * @param template the template * @param compressionLevel the compression level for the stream * @since 2.1.3 (Replacing the existing constructor with param compressionLevel) */ PdfFormXObject(PdfTemplate template, int compressionLevel) // throws BadPdfFormatException { super(); put(PdfName.TYPE, PdfName.XOBJECT); put(PdfName.SUBTYPE, PdfName.FORM); put(PdfName.RESOURCES, template.getResources()); put(PdfName.BBOX, new PdfRectangle(template.getBoundingBox())); put(PdfName.FORMTYPE, ONE); if (template.getLayer() != null) put(PdfName.OC, template.getLayer().getRef()); if (template.getGroup() != null) put(PdfName.GROUP, template.getGroup()); PdfArray matrix = template.getMatrix(); if (matrix == null) put(PdfName.MATRIX, MATRIX); else put(PdfName.MATRIX, matrix); bytes = template.toPdf(null); put(PdfName.LENGTH, new PdfNumber(bytes.length)); flateCompress(compressionLevel); }