我正在尝试在新的PDF页面中从类型表单中绘制XObject,我执行了以下操作:
this.cell = (PDFormXObject) xobject;
PDDocument document = new PDDocument();
PDPage page = new PDPage();
PDPageContentStream contentStream = new PDPageContentStream(document, page);
contentStream.transform(new Matrix(1, 0, 0, 1, -cell.getBBox().getLowerLeftX(),-cell.getBBox().getLowerLeftY()));
contentStream.drawForm(cell);
contentStream.close();
document.addPage(page);
document.save("D://temp//blankPage.pdf");
document.close();