Generate PDF tags with VB.NET

0

My problem: I want to generate some more or less tags like this image , from 2 to 3 columns.

From the data of a ListView I try to create the labels but I do not know how to format them, since the only thing I have achieved is to print the data in the form of rows.

It should be noted that this is the first time that I am exporting data in an external file, now I am occupying the library iTextSharp and I really do not know if what I intend to do can be achieved with this library or I have to change my way of doing it homework. I appreciate any suggestions that help me achieve my goal.

Annex code with which I count from now.

Public Sub _PDF()

    Dim fileName As String = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() & ".pdf"
    Dim document As New Document(PageSize.A4, 50, 50, 25, 25)
    PdfWriter.GetInstance(document, New FileStream(fileName, FileMode.Create))
    document.Open()

    For t = 0 To lvEtiquetas.Items.Count - 1 'Recorrer elementos del ListView para imprimir todos los renglones.'
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(0).Text)))
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(1).Text)))
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(2).Text)))
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(3).Text)))
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(4).Text)))
        document.Add(New Paragraph(CStr(lvEtiquetas.Items(t).SubItems(5).Text)))
    Next

    document.Close()
    Dim prc As Process = New System.Diagnostics.Process()
    prc.StartInfo.FileName = fileName
    prc.Start()               
End Sub
    
asked by SdeSistemas 01.10.2018 в 20:54
source

0 answers