1 50 51 package com.lowagie.text.pdf; 52 53 56 57 public class PdfFormXObject extends PdfStream { 58 59 61 62 public static final PdfNumber ZERO = new PdfNumber(0); 63 64 65 public static final PdfNumber ONE = new PdfNumber(1); 66 67 68 public static final PdfLiteral MATRIX = new PdfLiteral("[1 0 0 1 0 0]"); 69 70 72 73 75 80 81 PdfFormXObject(PdfTemplate template) { 83 super(); 84 put(PdfName.TYPE, PdfName.XOBJECT); 85 put(PdfName.SUBTYPE, PdfName.FORM); 86 put(PdfName.RESOURCES, template.getResources()); 87 put(PdfName.BBOX, new PdfRectangle(template.getBoundingBox())); 88 put(PdfName.FORMTYPE, ONE); 89 if (template.getLayer() != null) 90 put(PdfName.OC, template.getLayer().getRef()); 91 if (template.getGroup() != null) 92 put(PdfName.GROUP, template.getGroup()); 93 PdfArray matrix = template.getMatrix(); 94 if (matrix == null) 95 put(PdfName.MATRIX, MATRIX); 96 else 97 put(PdfName.MATRIX, matrix); 98 bytes = template.toPdf(null); 99 put(PdfName.LENGTH, new PdfNumber(bytes.length)); 100 flateCompress(); 101 } 102 103 } 104 | Popular Tags |