- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 open office 创建了 PDF 模板。我在其中添加了 PushButtonField
。每当用户点击它时,所有文本字段数据都会被清除 (其他形式数据不应被清除)。那么如何使用 java 或直接从开放式办公室禁用 (不可点击但可见) PushButtonField。我尝试了以下两种解决方案,但它们不起作用。
1) 在 OpenOffice 中将 PushButtonField 属性“Enabled
”设置为“No
”。
2) 从 Java 通过 id 访问 pushbuttonfield 并将选项设置为只读。
ad.setOptions(BaseField.READ_ONLY)
谢谢。
最佳答案
您可以尝试的一件事是部分展平表单。通过仅将您想要使其不可点击的按钮的名称传递给“partialFormFlattening”。
PdfDocument document = new PdfDocument(new PdfReader(INPUT), new PdfWriter(OUTPUT));
PdfAcroForm form = PdfAcroForm.getAcroForm(document, true);
form.partialFormFlattening(nameOfTheButtonField);
form.flattenFields();
document.close();
关于java - 使用 iText 在 PDF 中禁用 PushbuttonField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46088622/
我正在使用com.itextpdf.text.Image。我有 2 张图像,我想将其放入模板 pdf 的特定字段中。 我可以将图像放入 pdf 中,但如果图像宽度大于高度,我想旋转它。我已经尝试过这个
我正在使用 Java iText 库来操作 PDF 文档的表单字段,但遇到了一个简单的问题。我可以设置从 PdfStamper 对象检索到的 AcroFields 的属性,但我真正想做的是将操作设置为
我使用 open office 创建了 PDF 模板。我在其中添加了 PushButtonField。每当用户点击它时,所有文本字段数据都会被清除 (其他形式数据不应被清除)。那么如何使用 java
我正在尝试将 AcroFields 转换为特定类型,以便我可以为其设置属性。 当我调用 AcroFields.GetField(string name); 时,我得到的只是一个字符串。 当我调用 Ac
在这里,我正在使用 iText (v - 5.5.13) 和 Java 8 添加按钮到 PDF 文件中。 使用此按钮,我将操作设置为作为一个 JavaScript 警报的按钮 按钮添加成功,但当我单击
我是一名优秀的程序员,十分优秀!