我有一个PDF文档,其中有acro文本字段,它已经被共享给客户端。现在,客户端想要在其中一个文本字段中插入签名图像。我的经理让我尝试一种方法来做同样的事情。我的想法是将文本字段位置上的图像替换为图像大小。在acro文本字段位置显示图像
对于更换PDF的ACRO文本字段成图像,我基于给定的图像的宽度和高度,我需要改变ACRO文本框的宽度和高度试图如下
1.Finding the text field by its field id
String position = null;
List<FieldPosition> fieldPositons = form.getFieldPositions("50106");
for (FieldPosition position :fieldPositons) {
this.position = position.position;
}
2. Setting the image into that position of text field
Image image = Image.getInstance("ImageFileName");
Float dimensions = position.split("x");
image.setAbsolutePosition(dimensions[0], dimensions[1]);
content.addImage(image);
。
任何人都可以尝试如下,我的逻辑是否与itext pdf库一起工作。让我知道是否有任何想法替换acro文本字段与图像
对代码进行了一些更改后,我在文本字段位置获得了图像。 –