iText7-如果/DA使用十进制字体大小,则PdfFormField.setValue()失败 [英] iText7 - PdfFormField.setValue() fails if the /DA uses a decimal font size

查看:121
本文介绍了iText7-如果/DA使用十进制字体大小,则PdfFormField.setValue()失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iText 7.0.0

iText 7.0.0

我有一个由Adobe LiveCycle ES 10创建的PDF,该PDF产生一个带有

的TextField.

i have a PDF created by Adobe LiveCycle ES 10 that's producing a TextField with a

/DA /Arial-BoldMT 9.00 Tf 0.000 0.000 1.000 rg

这会导致PdfFormField.regenerateField()出现故障,该故障期望文本字体大小为Integer(我在PDF规范中没有看到任何具体说明是正确的)

this causes a failure in PdfFormField.regenerateField() which expects the text font size to be an Integer (i don't see any specific mention in the PDF spec that this would be true)

对于我的特殊情况,可以接受的解决方法似乎只是在字典中设置/V,但奇怪的是,为什么setValue()如此工作呢?

an acceptable workaround for my particular case appears to be just setting /V in the dictionary, but curiously why does setValue() work so hard?

推荐答案

此问题已在iText 7.0.1中修复.现在,字体大小将作为十进制值处理,并在整个API中以浮点数显示

This is fixed in iText 7.0.1. Font sizes are now handled as decimal values and exposed in the entire API as floats

这篇关于iText7-如果/DA使用十进制字体大小,则PdfFormField.setValue()失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆