public PdfTemplate createTemplate(float width, float height) { return PdfTemplate.createTemplate(wrt, width, height); }
public PdfTemplate createTemplate(float width, float height) { return PdfTemplate.createTemplate(wrt, width, height); }
/** * Creates a new template. * <P> * Creates a new template that is nothing more than a form XObject. This template can be included * in this template or in another template. Templates are only written * to the output when the document is closed permitting things like showing text in the first page * that is only defined in the last page. * * @param writer the PdfWriter to use * @param width the bounding box width * @param height the bounding box height * @return the created template */ public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) { return createTemplate(writer, width, height, null); }
/** * Creates a new template. * <P> * Creates a new template that is nothing more than a form XObject. This template can be included * in this template or in another template. Templates are only written * to the output when the document is closed permitting things like showing text in the first page * that is only defined in the last page. * * @param writer the PdfWriter to use * @param width the bounding box width * @param height the bounding box height * @return the created template */ public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) { return createTemplate(writer, width, height, null); }
public boolean setFieldAsImage(String field, Image image) { try { if (Float.isNaN(image.getAbsoluteX())) image.setAbsolutePosition(0, image.getAbsoluteY()); if (Float.isNaN(image.getAbsoluteY())) image.setAbsolutePosition(image.getAbsoluteY(), 0); PdfTemplate tmpl = PdfTemplate.createTemplate(wrt, image.getWidth(), image.getHeight()); tmpl.addImage(image); PdfStream str = tmpl.getFormXObject(PdfStream.NO_COMPRESSION); PdfIndirectReference ref = wrt.addToBody(str).getIndirectReference(); PdfDictionary d = new PdfDictionary(); d.put(PdfName.N, ref); return setField(field, d); } catch (Exception de) { throw new ExceptionConverter(de); } }
public boolean setFieldAsImage(String field, Image image) { try { if (Float.isNaN(image.getAbsoluteX())) image.setAbsolutePosition(0, image.getAbsoluteY()); if (Float.isNaN(image.getAbsoluteY())) image.setAbsolutePosition(image.getAbsoluteY(), 0); PdfTemplate tmpl = PdfTemplate.createTemplate(wrt, image.getWidth(), image.getHeight()); tmpl.addImage(image); PdfStream str = tmpl.getFormXObject(PdfStream.NO_COMPRESSION); PdfIndirectReference ref = wrt.addToBody(str).getIndirectReference(); PdfDictionary d = new PdfDictionary(); d.put(PdfName.N, ref); return setField(field, d); } catch (Exception de) { throw new ExceptionConverter(de); } }
try { ImgWMF wmf = (ImgWMF)image; wmf.readWMF(PdfTemplate.createTemplate(this, 0, 0));
try { ImgWMF wmf = (ImgWMF)image; wmf.readWMF(PdfTemplate.createTemplate(this, 0, 0));