vb.net and ItextSharp

0

Thanks to all, I have a problem, through a list I am trying to create a PDF, with the title and the content. Example:

Title 1

Title 1 description

My problem is that if you have more than one content for Title 1 it will always duplicate the title.

Example:

Title 1

Title 1 description

Title 1

Title 1 description

And I wanted to do the following:

Title 1

Title 1 description

Description Title 1.2

Title 2

Title 2 description

My code:

        Dim x As Integer
    For x = 0 To administrador.ListView1.Items.Count - 1
        'ADDTitle
        Dim FontTitle = FontFactory.GetFont("Arial", 11)
        Dim Titlechunk As New Chunk(gettitle(administrador.ListView1.Items(x).Text.Substring(4, 2)).ToString, FontTitle)
        Titlechunk.Font.SetStyle(FontStyle.Bold)
        Dim Titlepara As New Paragraph()
        Titlepara.Add(Titlechunk)
        Titlepara.Alignment = Element.ALIGN_LEFT
        PdfDoc.Add(Titlepara)

        'Descrição
        Dim FontDesc = FontFactory.GetFont("Arial", 9)
        Dim phDesc As New Phrase()
        Dim Descchunk As New Chunk("  > " + administrador.ListView1.Items(x).SubItems(1).Text + " COM A QUANTIDADE NECESSÁRIA DE " + administrador.ListView1.Items(x).SubItems(2).Text + "UNIDADE(S)", FontDesc)
        phDesc.Add(Descchunk)
        Dim paraDesc As New Paragraph()
        paraDesc.Add(phDesc)
        PdfDoc.Add(paraDesc)

        PdfDoc.Add(New Paragraph(" "))
    Next

Thanks for the attention: b

    
asked by anonymous 21.03.2018 / 00:56

0 answers