@Override public void closeTemplate(PDDocument template) throws IOException { template.close(); pdfStructure.getTemplate().close(); } }
@Override public void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws IOException { // create blank n0 background layer form PDFormXObject n0Form = new PDFormXObject(pdfStructure.getTemplate().getDocument().createCOSStream()); n0Form.setBBox(bbox); n0Form.setResources(new PDResources()); n0Form.setFormType(1); innerFormResource.put(COSName.getPDFName("n0"), n0Form); LOG.info("Created background layer form"); }
@Override public void closeTemplate(PDDocument template) throws IOException { template.close(); pdfStructure.getTemplate().close(); } }
@Override public void closeTemplate(PDDocument template) throws IOException { template.close(); pdfStructure.getTemplate().close(); } }
PDDocument template = pdfStructure.getTemplate();
/** * Returns the visual signature COSDocument as a stream and closes the template field * PDDocument. * * @return the visual signature COSDocument as a stream * @throws IOException * @deprecated This will be removed in 2.1 because the method name is misleading and confusing, * and the work done rather belongs into the calling class: * <pre> * {@code * COSDocument visualSignature = structure.getVisualSignature(); * ByteArrayOutputStream baos = new ByteArrayOutputStream(); * COSWriter writer = new COSWriter(baos); * writer.write(visualSignature); * writer.close(); * structure.getTemplate().close(); * ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); * } </pre> */ @Deprecated public ByteArrayInputStream getTemplateAppearanceStream() throws IOException { COSDocument visualSignature = getVisualSignature(); ByteArrayOutputStream memoryOut = new ByteArrayOutputStream(); COSWriter memoryWriter = new COSWriter(memoryOut); memoryWriter.write(visualSignature); ByteArrayInputStream input = new ByteArrayInputStream(memoryOut.toByteArray()); getTemplate().close(); return input; }
@Override public void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws IOException { // create blank n0 background layer form PDFormXObject n0Form = new PDFormXObject(pdfStructure.getTemplate().getDocument().createCOSStream()); n0Form.setBBox(bbox); n0Form.setResources(new PDResources()); n0Form.setFormType(1); innerFormResource.put(COSName.getPDFName("n0"), n0Form); LOG.info("Created background layer form"); }
@Override public void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle formatter) throws IOException { // create blank n0 background layer form PDFormXObject n0Form = new PDFormXObject(pdfStructure.getTemplate().getDocument().createCOSStream()); n0Form.setBBox(formatter); n0Form.setResources(new PDResources()); n0Form.setFormType(1); innerFormResource.put(COSName.getPDFName("n0"), n0Form); LOG.info("Created background layer form"); }
PDDocument template = pdfStructure.getTemplate();
PDDocument template = pdfStructure.getTemplate();