我在路径中收到错误,因为它在其中检索System.Byte[]
。如何访问我资源中添加的PDF?
代码:
PdfDocument = PdfSharp.Pdf.IO.PdfReader.Open(My.Resources.CANEezz_Individual.ToString, PdfDocumentOpenMode.Modify)
Dim font9 As XFont = New XFont("Arial", 8)
Dim page As PdfPage = PdfDocument.Pages(0)
Dim graph As XGraphics = XGraphics.FromPdfPage(page)
graph.DrawString("Bank Passboook", font9, XBrushes.Black, 518, 343)
Dim pdfFilename As String = "something.pdf"
PdfDocument.Save(pdfFilename)
Process.Start(pdfFilename)
答案 0 :(得分:4)
将byte[]
传递给MemoryStream
的构造函数,并将该内存流传递给PdfReader.Open()
方法。