我把我的信写在一个程序中,然后用PDF输出它们。最近,我实现了一个小型控制台程序,它应该遍历每一页,并将我的特殊设计设置为字母(包含我的地址等)作为背景。
问题是,我的信是用卡利布里写的。在使用pdf邮票之前,原始PDF看起来很棒,在设置背景之后,(而不是修改文本)的样式看起来有点不同。
在截图里看到了我的意思。

我无法向我解释,因此我认为这可能是个错误。你有什么意见建议?
我的密码在这里。
public static void main(String[] args) throws IOException, DocumentException {
PdfBackgroundSetter.setBackgroundToPdf(args[0], args[1], args[2]);
}
public static void setBackgroundToPdf(String inputContentPdfPath, String outputPdfPath, String inputBackgroundPdfPath) throws IOException, DocumentException {
PdfReader inputContentReader = new PdfReader(inputContentPdfPath);
PdfStamper outputStamper = new PdfStamper(inputContentReader, new FileOutputStream(outputPdfPath));
PdfReader inputBackgroundReader = new PdfReader(inputBackgroundPdfPath);
PdfImportedPage backgroundPage = outputStamper.getImportedPage(inputBackgroundReader, 1);
int numberOfPages = inputContentReader.getNumberOfPages();
for (int i = 1; i <= numberOfPages; i++) {
outputStamper.getUnderContent(i).addTemplate(backgroundPage, 0, 0);
}
outputStamper.close();
inputContentReader.close();
inputBackgroundReader.close();
}略为修改(匿名)PDF-文件可在这里找到:
发布于 2014-07-15 12:56:10
正如@Chris已经说过的,这本质上是Adobe / Acrobat引入的一个工件。它特别依赖于所讨论的Acrobat/Reader版本,可以通过在后台PDF中不使用透明组来防止这种情况。
详细信息
我只能在某些Adobe软件版本Acrobat9.5中重现这个问题,但对于当前的情况,我看不到Adobe中的问题。
Acrobat 9.5中的普通内容和内容与背景合并:


普通内容和内容与Reader中的背景合并:


工件似乎与背景文件中使用透明组的事实相关联。删除了背景文件中的所有透明组后,我得到以下信息:
Acrobat 9.5中的纯内容和内容合并为没有透明组的背景:


实际上,在Acrobat和Reader的最新版本中,透明度组的处理有了许多改进。我已经意识到了与实际透明度问题和淘汰赛小组有关的这些改进,但这似乎是另一个改进。
https://stackoverflow.com/questions/24722182
复制相似问题