| Code with Finding: |
class PdfFormXObject {
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));
if (template.getAdditional() != null) {
putAll(template.getAdditional());
}
flateCompress(compressionLevel);
}
}
|