iText PDF-为列表框上的每个选定项目生成新页面

时间:2019-05-14 21:08:14

标签: vb.net itext

我正在尝试为ListBox上的每个选定项目生成PDF文件。

If ListBox1.SelectedValue <> -1 Then
            For Each item In ListBox1.SelectedItems

                doc.Add(gif)

                Dim para1 As New Paragraph("CONTROL - " & CbxMes.Text & "/" & Now.Year.ToString() & " ", fonte2) With {
                    .Alignment = Element.ALIGN_CENTER
                }
                doc.Add(para1)

                doc.Add(New Paragraph(" "))

                Dim frase As New Paragraph("Emp: " & ListBox1.Text & " ", fonte1) With {
                .Alignment = Element.ALIGN_JUSTIFIED
                }
                doc.Add(frase)

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

如果我从列表框中选择5个项目,则生成5个具有相同名称的页面。我需要5个页面,其中包含5个不同的名称。

0 个答案:

没有答案