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