问题标签 [itextsharp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2023 浏览

c# - 使用 ColumnText 写入 DirectContent 不会更新 PdfDocument.GetVerticalPosition

我使用 ITextSharp 生成 PDF,并且遇到需要通过 ColumnText 使用 DirectContent 的情况。

问题是,通过 ColumnText 对象写入文本后, PdfDocument.GetVerticalPosition 没有更新?请参阅以下失败的测试:

无论如何要告诉作者或文档更新文档currentHeight。

obvoius 解决方案是使用 PdfDocument.SetVerticalPosition 如果它只存在:-)

还是我误解了使用 DirectContent 的整个概念?

在我看来,如果文档上的当前 Y 位置无法更新或未自动更新,则在将内容添加到 DirectContent 后,您将无法使用 PdfDocument.Add。

0 投票
1 回答
1806 浏览

itextsharp - 我使用 itext.dll 使用 ASP.NET 生成 PDF,我想在文档中添加页脚?

我使用 itext.dll 使用ASP.NET生成 PDF ,并且我希望在我的文档中以以下形式添加页脚:

如果不对总页数进行硬编码,这是否可能?即有没有一种方法可以获取文档中的总页数?

0 投票
2 回答
6603 浏览

c# - itextsharp“对象引用未设置为对象的实例”错误

我有以下代码。在我的开发环境中,我没有得到任何错误,但在我的生产环境中却有。

当代码运行时,我在_pdfWriter = PdfWriter.GetInstance(_pdf, fs);上收到以下错误

为什么你认为我得到这个错误?文件流已创建,_pdf 已在构造函数中设置。

更新

问题是 _pdf 为空。我不确定为什么它在构造函数中设置为 null。我可以通过这样做来解决这个问题:

我仍然想知道我做错了什么......

0 投票
3 回答
2688 浏览

asp.net - ASP.NET - 中等信任度的 PDF 组件

任何人都可以推荐一些在中等信任环境中工作的与 ASP.NET 兼容的 PDF 组件吗?我读到ITextSharp效果很好,但是来自ABCPdfA​​SPPdf,用代码编译整个 PDF 的想法非常令人生畏。理想情况下,我想使用类似wkhtmltopdf的东西来简单地将 HTML 页面转换为 PDF(但当然这在中等信任度下不起作用)。

就价格而言:免费是最好的,但付费解决方案并非不可能。

如果我找不到合适的选项,我可能会选择在单独的机器上托管 Web 服务,我可以在该机器上运行完全受信任的应用程序,但这绝对不是最佳选择。

0 投票
4 回答
24490 浏览

c# - iTextSharp 国际文本

我在 asp.net 页面中有一个表格,并尝试将其导出为 PDF 文件,我有几个国际字符未在生成的 PDF 文件中显示,任何建议,

提前致谢

0 投票
2 回答
2246 浏览

c# - itextsharp 更改表格单元格数据

我有一个pdf文件我想通过itextsharp更改表格单元格数据有什么办法吗

0 投票
1 回答
653 浏览

c# - 获取字体时 iTextSharp 崩溃并出现 StackOverflowException

当我尝试创建字体时,iTextSharp 真的非常不喜欢它:

这给了我一个用户友好的StackOverflowException. 所以我尝试了这个:

它做同样的事情。试过Font.TIMES了,也得到了同样的东西。所以我尝试根据这个答案降低一点,这表明以下内容:

再一次,StackOverflowException。虽然一致性很好,但我更希望库让我选择一种字体。

我敢肯定我只是在某个地方弄错了一些配置;但我不知道它可能是什么。

0 投票
1 回答
2563 浏览

c# - iTextSharp : pdfPTable 与其他内容重叠

我正在使用 iTextsharp 从 C# 应用程序生成 PDF 文档。我有一个 PdfPTable 来显示一些表格数据。我在表格中的问题与另一段重叠。无论如何我可以将表格放在特定位置吗?然后下面是我的代码

现在我的第二个段落(objChildInfoPara)与第一个重叠

谁能告诉我如何摆脱这个问题?

0 投票
3 回答
30360 浏览

c# - iTextSharp DLL 是否可以免费使用并与我的 Web 应用程序项目一起重新分发?

iTextSharp DLL是否可以免费使用并与我将出售的 Web 应用程序项目一起重新分发?

0 投票
2 回答
1970 浏览

pdf - How can I use revisions to avoid invalidating digital signatures in a PDF?

Using Acrobat 9, if I sign a PDF using a self-signed certificate and then edit the PDF after I sign it, Acrobat will inform me that there is a valid signature on the document but that the document also has unsigned changes. If I then sign the PDF again and look in the signature panel, it will show the first signed revision with a valid signature, notate that changes were made after the first revision was signed and then show a second signed revision with a valid signature.

I am trying to duplicate that behavior using iTextSharp. In code, I create a PDF and sign it. Then, I edit the PDF and sign it again. When I open the document in Acrobat, it shows both revisions but marks the first revision as an invalid signature because the document was altered. From what I can gather, I think iTextSharp is signing the entire document rather than just the first revision inside that document. I have set the Append parameter to true in both the PdfStamper and PdfSignatureAppearance constructors, but it does not seem to have any effect.

Since I can get the desired result using Acrobat, I am assuming I am just not using iTextSharp correctly. Can anyone shed some light on this?