How to replicate an image based on an integer value on ItextSharp

46 views Asked by At

I am trying to make copies of a Logo according to how many times the user has inputted. But I can only make one copy of the image cause I don't know how to replicate it based on an integer value.

Here is my code:

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

There are 0 answers