我使用 Adobe Acrobat Pro 创建了一个 .PDF 文件。该文件有几个文本字段。使用 iTextSharp,我可以填充所有字段并邮寄 .PDF。
一件事困扰着我——接下来的一些内容将不“适合”在文本框中。在 Adobe 中,如果我输入的高度超过了分配的高度,滚动条就会启动 - 当字体大小未设置为自动并且允许多行时会发生这种情况。
但是,当我尝试设置以下属性时:
//qSize is float and set to 15;
//auto size of font is not being set here.
pdfFormFields.SetFieldProperty("notification_desc", "textsize", qSize, null);
// set multiline
pdfFormFields.SetFieldProperty("notification_desc", "setfflags", PdfFormField.FF_MULTILINE, null);
//fill the field
pdfFormFields.SetField("notification_desc", complaintinfo.OWNER_DESC);
然而,在编译和冲压后,滚动条不会出现在最终的 .PDF 中。
我不确定这是否是正确的做法。我在想也许我应该创建一个表格并用文本填充它,但文档很少或根本没有引用滚动条......