我们最近使用Aspose.pdf库为客户端编写了一些代码,在我的系统上,有问题的pdf打开得很好,并且大多数合并字段都已填写(我们没有确切的合并字段列表)。
他们告诉我,在他们的系统上,一些文档需要2-4分钟才能打开,而另一些则根本不打开。
文档根本无法打开的可能原因是什么?
我的代码如下:
' Load form
Dim doc As Aspose.Pdf.Document = New Aspose.Pdf.Document(sTemplateDir & sDocName)
'Get names of form fields
Dim fields As Aspose.Pdf.InteractiveFeatures.Forms.Field() = doc.Form.Fields
Dim sField As String
Dim field As Aspose.Pdf.InteractiveFeatures.Forms.Field
If fields.Length > 0 Then
For Each field In fields
'Get name of field
sField = field.FullName
'If the merge field isn't valid then we'll just leave it and assume its a fill-in
If nMergeCol.Contains(sField) And Not IsNothing(sField) Then
field.Value = nMergeCol.Item(sField)
End If
Next
End If发布于 2016-03-08 01:47:04
这个问题已经解决了!正如我们所怀疑的,这是客户端的Javascript在pdf文件中的问题。问题是在计算中使用了绝对值(name.value)。一旦切换到相对值(this.event.value),pdf文件就开始使用AsPose代码正常运行。
https://stackoverflow.com/questions/35274425
复制相似问题