我有一个 PDF 文档,需要添加几个图像字段。我将 pdf 文件作为图稿导入 Adobe LiveCycle。然后我添加了我的 2 个图像并保存为静态文件。当我使用 Adobe Reader 查看文件时,我可以看到图像。但是当我尝试将文件与使用 LiveCycle 创建的其他静态和动态 pdf 文件合并时,图像丢失了。

我看了下面的帖子iText PDF 合并后不显示图像(imageField)

但在检查了我的代码后显示的解决方案后,我已经在使用 PdfCopy 而不是 PdfWriter:

ByteArrayOutputStream output = new ByteArrayOutputStream();

        PdfReader reader = new PdfReader(baosList.get(0).toByteArray());
        Document document = new Document(reader.getPageSizeWithRotation(1));
        reader.close();

        PdfCopy writer = new PdfCopy(document, output);
        document.open();

        for (ByteArrayOutputStream baos : baosList)
        {
            // copy content
            reader = new PdfReader(baos.toByteArray());

            for (int idx = 1; idx <= reader.getNumberOfPages(); idx++)
                writer.addPage(writer.getImportedPage(reader, idx));

            reader.close();
            baos.close();
        }

我有其他动态 PDF 文件,图像很好。我想知道我的问题是否是因为我将原始文件导入为艺术品。