gpt4 book ai didi

java - 是否可以用 itext 覆盖 PDF 标题?

转载 作者:行者123 更新时间:2023-12-02 00:02:05 24 4
gpt4 key购买 nike

我将一些文档合并到一个 pdf 文件中。有些页面有页眉和页脚,但不是全部。我尝试从文档中删除标题,但无法编辑文档。我只能玩pdf文件。有什么建议吗?

最佳答案

是的,可以在合并过程中在所需位置绘制内容。

                //in merge a loop
for (int i = 1; i <= pages; i++)
{
PdfImportedPage page = copy.GetImportedPage(reader, i);
PdfCopy.PageStamp stamp = copy.CreatePageStamp(page);
PdfContentByte cb = stamp.GetUnderContent();
// use cb to draw your new content
stamp.AlterContents();
copy.AddPage(page);
}

关于java - 是否可以用 itext 覆盖 PDF 标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14646552/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com