如何在ItextSharp

时间:2017-11-19 19:09:12

标签: vb.net itext

我正在尝试根据用户输入的次数制作徽标的副本。但我只能制作一份图像副本,因为我不知道如何根据整数值复制它。

这是我的代码:

Public Function print_logo()
Dim image as image // I cut off the file path cause I don't need that as an explanation
img.ScalePercent(40.0F) // COMPANY LOGO
img.Alignment = iTextSharp.text.Image.ALIGN_CENTER

'Exporting to PDF

Dim folderPath As String = "C:\Temp\"
If Not Directory.Exists(folderPath) Then
    Directory.CreateDirectory(folderPath)
End If

Using stream As New FileStream(folderPath & "temp2.pdf", FileMode.Create)
    Dim pgsize As New iTextSharp.text.Rectangle(216, 504)
    Dim pdfdoc As New Document(pgsize, 15.0F, 15.0F, 10.0F, 20.0F)
    PdfWriter.GetInstance(pdfDoc, stream)

    pdfDoc.Open()
    pdfDoc.Add(img)
    pdfDoc.Close()
    stream.Close()


    System.Diagnostics.Process.Start("C:\\Temp\\temp2.pdf")

End Using


Return True
End Function

0 个答案:

没有答案