使用pdfsharp将位图图像保存为PDF的最快方法

时间:2018-03-12 14:10:19

标签: image pdf bitmap pdfsharp

我需要从几个位图图像创建一个pdf文件。我目前正在使用以下代码:

Dim size As New XSize(0,0)      
For k = 0 to theBMPList.Count-1
    Dim oPage As New PdfPage()
    doc.Pages.Add(oPage)
    Dim xgr As XGraphics = XGraphics.FromPdfPage(oPage)
    Dim img As XImage = XImage.FromGdiPlusImage(theBMPList(k))
    size = new XSize(theBMPList(k).Width, theBMPList(k).Height)
    oPage.Height = size.Height
    oPage.Width = size.Width
    xgr.DrawImage(img, 0,0, size.Width-5, size.Height-5)
Next

这很好但很慢。有更好/更快的方法吗?

0 个答案:

没有答案