【问题标题】:iText - render html dropdown to editable pdf using c#iText - 使用 c# 将 html 下拉列表呈现为可编辑的 pdf
【发布时间】:2021-10-24 15:34:39
【问题描述】:

我在 HTM 页面中有下拉列表。我想使用 iText 库将其转换为可编辑的 pdf。我必须设置 AcroForms/字段。无法呈现下拉 html(选择/选项)标签。

期望:下拉菜单在 PDF 中应该是可编辑的。

'

       String dest = "h2PMethod1_1.pdf";
       PdfWriter pdfWriter = new PdfWriter(dest);
        ConverterProperties converterProperties = new ConverterProperties();            
       iText.Kernel.Pdf.PdfDocument pdfDocument = new iText.Kernel.Pdf.PdfDocument(pdfWriter);
       converterProperties.SetCreateAcroForm(true);
        iText.Forms.PdfAcroForm form = iText.Forms.PdfAcroForm.GetAcroForm(pdfDocument, true);
        Document document = HtmlConverter.ConvertToDocument(htmlString, pdfDocument, converterProperties);
        document.Close();

'

【问题讨论】:

  • 正如@artyom-minsk 所写,select 元素不支持SetCreateAcroForm 模式,直到最新的pdfHTML 版本3.0.5。这是唯一一个在 acroform 转换模式下与其他表单元素工作方式不同的表单元素。

标签: c# .net pdf itext acrofields


【解决方案1】:

当前版本的 HtmlConverter 似乎不支持选择标签属性。

【讨论】:

  • 请添加更多详细信息以扩展您的答案,例如工作代码或文档引用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-09-11
  • 2019-10-19
  • 1970-01-01
  • 1970-01-01
  • 2017-08-29
  • 1970-01-01
  • 2012-02-07
相关资源
最近更新 更多