1
我们使用ABCPDF.Net版本5从HTML创建PDF文件。但是,即使HtmlOptions.AddLinks设置为true,链接也不会生效,除非那些在HTML中显示为URL。事实上,当它设置为true时,链接会呈现为棕色背景,当它设置为false时不会显示。下面是我们用来创建PDF(vb.net)代码:ABCPDF链接不工作
Dim oFile As Stream = New MemoryStream()
Dim objPDFInvoice As Doc = New Doc
With objPDFInvoice
Dim w As Double = .MediaBox.Width
Dim h As Double = .MediaBox.Height
Dim l As Double = .MediaBox.Left
Dim b As Double = .MediaBox.Bottom
.Rect.Left += 15
.Rect.Bottom += 15
.Rect.Width -= 15
.Rect.Height -= 15
.HtmlOptions.AddLinks = True
Dim theID As Integer = .AddImageUrl("file://" & sFileName, True, 800, True)
While True
If Not .Chainable(theID) Then
Exit While
End If
.Page = .AddPage()
theID = .AddImageToChain(theID)
End While
For iPage As Integer = 1 To .PageCount
.PageNumber = iPage
.Flatten()
Next
If .PageCount > 0 Then .Page = 1
.SetInfo(.Root, "/HtmlContent:Text", sBody.ToString)
.SetInfo(.Root, "/HtmlFilename:Text", "Certification" & ".pdf")
.Encryption.Type = 2
.Encryption.CanAssemble = False
.Encryption.CanChange = False
.Encryption.CanCopy = False
.Encryption.CanEdit = False
End With
objPDFInvoice.Save(oFile)
objPDFInvoice.Clear()
的OFILE内存流,然后发送作为电子邮件的附件,但是出于测试,我把它保存到一个文件中。请注意,sBody是AddImageURL中使用的HTML文件内容的字符串表示形式。
任何想法为什么会发生这种情况?
由于提前, 鲍里斯Zakharin
我们遇到同样的问题解决了该问题,你有没有找到解决的办法? – Bertvan 2012-03-14 08:37:11