我正在使用jSignature javascript将签名保存到SVG。现在,我正试图将该SVG放在PDF文档上签名空白处。PDFSharp;将SVG签名添加到PDF文件
我可以通过将SVG转换为文件,使用SVG(SVG Rendering Library 2.3.0)打开该文件并将其转换为流,然后使用PDFSharp将其放入PDF中来完成。我的问题是,我无法从字符串中加载SVG库。它必须从文件加载。我从数据库中提取这些签名以及它们的表单相关数据。
Dim FileText As String
Dim Bytes() As Byte
Using DB As New wotcDB
FileText = (From t In DB.interviews Where t.ID = 1 Select t.Signature).FirstOrDefault
End Using
Bytes = System.Text.Encoding.ASCII.GetBytes(FileText)
Using DataStream As New System.IO.MemoryStream(Bytes)
svgDocument = Svg.SvgDocument.Open(DataStream) 'Issue
End Using
我得到的错误如下;
Severity Code Description Project File Line Suppression State
Error BC30518 Overload resolution failed because no accessible 'Open' can be called with these arguments:
'Public Shared Overloads Function Open(Of T As {SvgDocument, New})(path As String) As T': Type parameter 'T' cannot be inferred.
'Public Shared Overloads Function Open(Of T As {SvgDocument, New})(stream As Stream) As T': Type parameter 'T' cannot be inferred. WOTC-FE d:\Programming\Applications\frmDebug.vb 54 Active
我讨厌创建一个文件转换为图形的想法,当重载清楚地表明我可以使用流。我做错了什么?
你使用'svgDocument.Draw()'当你把它放到你的PDF使用PDFSharp? – Azimuth