【发布时间】:2018-03-29 23:29:34
【问题描述】:
在 iText5 中,可以像这样开始绘制 Graphics2D 对象
Rectangle rect = PageSize.A3.rotate();
PdfContentByte cb = writer.getDirectContent();
Graphics2D g = cb.createGraphics(rect.getWidth(), rect.getHeight());
“writer”是“PdfWriter”的一个实例。
iText7 中不存在 PdfContentByte,我还没有找到让 Graphics2D 参与其中的方法。这还有可能吗?
我完全知道现在有一个画布,您可以在上面绘制圆形、矩形、线条……但这意味着重新编写所有现有代码,所以如果您仍然可以以某种方式使用 Graphics2D,它将是首选方式。
【问题讨论】:
标签: java graphics2d itext7