本文介绍了使用VB.NET为每个页面itextsharp pdf文件插入页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 Imports System.IO 
Imports System.Data
Imports System.Reflection
Imports iTextSharp.text
Imports iTextSharp.text.pdf

公共类Form1

Public Sub New()
InitializeComponent()
Me.BindDataGridView()
End Sub

Private Sub BindDataGridView()
Dim dt As New DataTable()
dt.Columns.AddRange(New DataColumn(){New DataColumn(Id,GetType(Integer)),
New DataColumn(Name,GetType(String)),
New DataColumn(Country,GetType(String))})
For i As Integer = 0 To 7 Step 1
dt。 Rows.Add(1,John,United States)
dt.Rows.Add(2,kumar,India)
dt.Rows.Add(3,Mathews) ,France)
dt.Rows.Add(4,Robert,Russia)
Next
Me.dataGridView1.DataSource = dt
End Sub

Private Sub btnExportPDF_Click(sender As System.Object,e As System.EventArgs)处理btnExportPDF.Click
'从DataTable数据创建iTextSharp表
Dim pdfTable As New PdfPTable(3 )
pdfTable.DefaultCell.Padding = 3
pdfTable.WidthPercentage = 30
pdfTable.Horizo​​ntalAlignment = Element.ALIGN_CENTER
pdfTable.DefaultCell.BorderWidth = 0

'添加标题行
For Each列As DataGridViewColumn in dataGridView1.Columns
Dim cell As New PdfPCell(New Phrase(column.HeaderText))
cell.BackgroundColor = New iTextSharp.text.Color (240,240,240)
pdfTable.AddCell(cell)
Next

'添加DataRow
For Each row As DataGridViewRow in dataGridView1.Rows
For Each cell As DataGridViewCell In row.Cells
pdfTable.AddCell(cell.Value.ToString())
下一个
下一个

'导出为PDF
Dim folderPath As String =C:\PDFs \

如果不是Directory.Exists( folderPath)然后
Directory.CreateDirectory(folderPath)
结束如果

'文档itextDoc = New Document();
'pdfWriter pdfDoc = PdfWriter.GetInstance(itextDoc,Response.OutputStream);
'pdfDoc.PageEvent =新的itextEvents();

'Dim pdfDoc As New Document()
'Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc,New FileStream(tryme2.pdf,FileMode.Create))

'分配pdf文件名
Dim myUniqueFileName As String = String.Format(_ {0} .pdf,DateTime.Now。[Date] .Day.ToString()+ - & DateTime.Now。[Date] .Month.ToString()+ - & DateTime.Now。[Date] .Year.ToString()+@& DateTime.Now.TimeOfDay.Hours.ToString()+ msgstr使用stream As New FileStream(folderPath&Invoice& myUniqueFileName,FileMode.Create)
Dim pdfDoc As New Document(PageSize.A4,10.0F,10.0F,10.0F,0.0F)
Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc,stream)
Dim ev As New itextEvents
pdfWrite.PageEvent = ev
pdfDoc.Open()

'pdfDoc.AddHeader()

Dim PdfTable2 As New PdfPTable(2)
Dim Header As New PdfPCell(FormatHeader1(Trident Express Courier Service))
Header.Colspan = 2
Header.Horizo​​ntalAlignment = 1
Header.Border = 0
PdfTable2.AddCell(Header)
pdfDoc.Add(PdfTable2)

Dim PdfTable3 As New PdfPTable(2)
Dim address As New PdfPCell(FormatHeader2(No。 1,虚拟房子,1,虚拟道路))
address.Colspan = 2
address.Horizo​​ntalAlignment = 1
address.Border = 0
PdfTable3.AddCell(address)
pdfDoc.Add(PdfTable3)

Dim PdfCity As New PdfPTable(2)
Dim CityValue As New PdfPCell(FormatHeader2(dummycity - 100000,Ph:000-0000000))
CityValue.Colspan = 2
CityValue.Horizo​​ntalAlignment = 1
CityValue.BorderWidthLeft = 0
CityValue.BorderWidthRight = 0
CityValue.BorderWidthTop = 0
CityValue .BorderWidthBottom = 2
CityValue.PaddingBottom = 20
PdfCity.AddCell(CityValue)
pdfDoc.Add(PdfCity)


Dim Pdfhearedline As New PdfPTable (2)
Dim headerline As New PdfPCell(New Phrase())
headerline.Colspan = 2
headerlin e.Horizo​​ntalAlignment = 1
headerline.Border = 0
headerline.Padding = 4
Pdfhearedline.AddCell(headerline)
pdfDoc.Add(Pdfhearedline)

'第一行创建
Dim customerDetailsRow1 As New PdfPTable(8)
Dim CustomerAddress1 As New PdfPCell(NormalText(ADDRESS 1:))
CustomerAddress1.VerticalAlignment = 2
CustomerAddress1 .Horizo​​ntalAlignment = 0'// 0 =左,1 =居中,2 =右
CustomerAddress1.Colspan = 4
customerDetailsRow1.ExtendLastRow.ToString()

Dim CustomerGstNo As New PdfPCell(NormalText(GST NO:))
CustomerGstNo.Horizo​​ntalAlignment = 0'// 0 = Left,1 = Center,2 = Right
CustomerGstNo.Colspan = 4


customerDetailsRow1.AddCell(CustomerAddress1)
customerDetailsRow1.AddCell(CustomerGstNo)
pdfDoc.Add(customerDetailsRow1)

'第二行创建
Dim customerDetailsrow2 As New PdfPTable(8)
Dim CustomerAddress2 As New PdfPCell(NormalText(ADDRESS 2:))
CustomerAddress2.Horizo​​ntalAlignment = 0'// 0 = Left,1 = Center,2 = Right
CustomerAddress2.Colspan = 4

Dim CustomerPan As New PdfPCell(NormalText(PAN NO) :))
CustomerPan.Horizo​​ntalAlignment = 0'// 0 =左,1 =中心,2 =右
CustomerPan.Colspan = 4

customerDetailsrow2.AddCell(CustomerAddress2)
customerDetailsrow2.AddCell(CustomerPan)

pdfDoc.Add(customerDetailsrow2)

'3RD ROW CREATION
Dim customerDetailsrow3 As New PdfPTable(8)

Dim CustomerAddress3 As New PdfPCell(NormalText(ADDRESS 3:))
CustomerAddress3.Horizo​​ntalAlignment = 0'// 0 = Le ft,1 = Center,2 = Right
CustomerAddress3.Colspan = 4

Dim vendaorCode As New PdfPCell(NormalText(VENDOR CODE:))
vendaorCode.Horizo​​ntalAlignment = 0 '// 0 =左,1 =中心,2 =右
vendaorCode.Colspan = 4

customerDetailsrow3.AddCell(CustomerAddress3)
customerDetailsrow3.AddCell(vendaorCode)

pdfDoc.Add(customerDetailsrow3)

'4TH ROW CREATION
Dim customerDetailsrow4 As New PdfPTable(8)

Dim CustomerADDempty1 As New PdfPCell(NormalText ())
CustomerADDempty1.Horizo​​ntalAlignment = 0'// 0 =左,1 =中,2 =右
CustomerADDempty1.Colspan = 4

Dim contractno As New PdfPCell (NormalText(dummy NO:))
contractno.Horizo​​ntalAlignment = 0'// 0 = Left,1 = Center,2 = Right
contractno.Colspan = 4

customerDetailsrow4.AddCell(CustomerADDempty1)
customerDetailsrow4.AddCell(contractno)

pdfDoc.Add(customerDetailsrow4)

'5TH ROW CREATION
Dim customerDetailsrow5 As New PdfPTable(4)

Dim CustomerADDempty2 As New PdfPCell(NormalText())
CustomerADDempty2.Horizo​​ntalAlignment = 0'// 0 = Left,1 = Center,2 = Right
CustomerADDempty2.Colspan = 4

Dim invoiceNo As New PdfPCell(NormalText(INVOICE NO:))
invoiceNo.Horizo​​ntalAlignment = 0'// 0 = Left,1 = Center,2 =正确
invoiceNo.Colspan = 4


customerDetailsrow5.AddCell(CustomerADDempty2)
customerDetailsrow5.AddCell(invoiceNo)

pdfDoc.Add (customerDetailsrow5)

'6TH ROW CREATION



'footer





pdfDoc.Add(New Phrase(address1.Text.Trim()))
pdfDoc.Add(New Phrase(TextBox1.Text.Trim()))

pdfDoc.Add(New Paragraph (address1.Text.Trim()))
pdfDoc.Add(新词组(TextBox2.Text.Trim()))

pdfDoc.Add(pdfTable)

pdfDoc.Close()
stream.Close()
MessageBox.Show(PDF Flie Saved)

结束使用
结束子

Private Sub dataGridView1_CellContentClick(sender As Object,e As DataGridViewCellEventArgs)处理dataGridView1.CellContentClick

End Sub

私有函数NormalText(value As String)As Phrase
返回新词组(值,FontFactory.GetFont(FontFactory.TIMES_ROMAN,10))
结束函数
私函数FormatHeader1(值为字符串)作为短语
返回新短语(value,FontFactory .GetFont(FontFactory.TIMES_BOLD,15))
结束函数
Priva te函数FormatHeader2(值为字符串)作为短语
返回新短语(值,FontFactory.GetFont(FontFactory.TIMES_BOLD,13))
结束函数

私有子TextBox1_TextChanged(发送者) As Object,e As EventArgs)处理TextBox1.TextChanged

End Sub
End Class


公共类itextEvents
实现IPdfPageEvent

Public Sub OnChapter(作者为PdfWriter,文档为文档,paragraphPosition为单一,标题为段落)实现IPdfPageEvent.OnChapter
''抛出新NotImplementedException()
结束Sub

Public Sub OnChapterEnd(writer As PdfWriter,document As Document,paragraphPosition As Single)实现IPdfPageEvent.OnChapterEnd
''抛出新NotImplementedException()
End Sub

Public Sub OnCloseDocument(writer as PdfWriter,document as Document)实现IPdfPageEvent.OnCloseDocument
''抛出新的NotImplementedException()
End Sub

Public Sub OnEndPage(writer as PdfWriter,document As Document)Implements IPdfPageEvent.OnEndPage
''抛出新的NotImplementedException()
Dim pdfEndOfPageTable As New PdfPTable(2)
Dim Customerfooter As New PdfPCell(NormalText(footer content bottom))
Customerfooter.Horizo​​ntalAlignment = 1'// 0 = Left,1 = Center,2 = Right
Customerfooter.Colspan = 2
pdfEndOfPageTable.AddCell(Customerfooter)
'document.Add(pdfEndOfPageTable)

End Sub

Public Sub OnGenericTag( writer As PdfWriter,document As Document,rect As Rectangle,text As String)Implements IPdfPageEvent.OnGenericTag
''抛出新NotImplementedException()
End Sub

Public Sub OnOpenDocument(writer作为PdfWriter,文档为文档)实现IPdfPageEvent.OnOpenDocument
''抛出新的NotImplementedExce ption()
End Sub

Public Sub OnParagraph(writer As PdfWriter,document As Document,paragraphPosition As Single)实现IPdfPageEvent.OnParagraph
'抛出新的NotImplementedException()
End Sub

Public Sub OnParagraphEnd(writer As PdfWriter,document As Document,paragraphPosition As Single)实现IPdfPageEvent.OnParagraphEnd
'抛出新NotImplementedException()
End Sub

Public Sub OnSection(作者为PdfWriter,文档为文档,paragraphPosition为单,深度为整数,标题为段落)实现IPdfPageEvent.OnSection
'抛出新的NotImplementedException()
结束Sub

Public Sub OnSectionEnd(writer As PdfWriter,document As Document,paragraphPosition As Single)实现IPdfPageEvent.OnSectionEnd
'抛出新NotImplementedException()
End Sub

Public Sub OnStartPage(writer As PdfWriter,文档A.文档)实现IPdfPageEvent.OnStartPage
'抛出新的NotImplementedException()
结束Sub
私有函数NormalText(值为字符串)作为短语
返回新短语(value,FontFactory.GetFont (FontFactory.TIMES_ROMAN,10))
结束函数
结束类





我试过的:



请帮帮我,我尝试了很多。

解决方案

Imports System.IO
Imports System.Data
Imports System.Reflection
Imports iTextSharp.text
Imports iTextSharp.text.pdf

Public Class Form1

    Public Sub New()
        InitializeComponent()
        Me.BindDataGridView()
    End Sub

    Private Sub BindDataGridView()
        Dim dt As New DataTable()
        dt.Columns.AddRange(New DataColumn() {New DataColumn("Id", GetType(Integer)),
                                               New DataColumn("Name", GetType(String)),
                                               New DataColumn("Country", GetType(String))})
        For i As Integer = 0 To 7 Step 1
            dt.Rows.Add(1, "John", "United States")
            dt.Rows.Add(2, "kumar", "India")
            dt.Rows.Add(3, "Mathews", "France")
            dt.Rows.Add(4, "Robert", "Russia")
        Next
        Me.dataGridView1.DataSource = dt
    End Sub

    Private Sub btnExportPDF_Click(sender As System.Object, e As System.EventArgs) Handles btnExportPDF.Click
        'Creating iTextSharp Table from the DataTable data
        Dim pdfTable As New PdfPTable(3)
        pdfTable.DefaultCell.Padding = 3
        pdfTable.WidthPercentage = 30
        pdfTable.HorizontalAlignment = Element.ALIGN_CENTER
        pdfTable.DefaultCell.BorderWidth = 0

        'Adding Header row
        For Each column As DataGridViewColumn In dataGridView1.Columns
            Dim cell As New PdfPCell(New Phrase(column.HeaderText))
            cell.BackgroundColor = New iTextSharp.text.Color(240, 240, 240)
            pdfTable.AddCell(cell)
        Next

        'Adding DataRow
        For Each row As DataGridViewRow In dataGridView1.Rows
            For Each cell As DataGridViewCell In row.Cells
                pdfTable.AddCell(cell.Value.ToString())
            Next
        Next

        'Exporting to PDF
        Dim folderPath As String = "C:\PDFs\"

        If Not Directory.Exists(folderPath) Then
            Directory.CreateDirectory(folderPath)
        End If

        'Document itextDoc = New Document();
        'PdfWriter pdfDoc = PdfWriter.GetInstance(itextDoc, Response.OutputStream);
        'pdfDoc.PageEvent = New itextEvents();

        'Dim pdfDoc As New Document()
        'Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc, New FileStream("tryme2.pdf", FileMode.Create))

        'assigning pdf file name
        Dim myUniqueFileName As String = String.Format("_{0}.pdf", DateTime.Now.[Date].Day.ToString() + "-" & DateTime.Now.[Date].Month.ToString() + "-" & DateTime.Now.[Date].Year.ToString() + "@" & DateTime.Now.TimeOfDay.Hours.ToString() + "." & DateTime.Now.TimeOfDay.Minutes.ToString() + "." & DateTime.Now.TimeOfDay.Milliseconds.ToString())


        Using stream As New FileStream(folderPath & "Invoice" & myUniqueFileName, FileMode.Create)
            Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
            Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc, stream)
            Dim ev As New itextEvents
            pdfWrite.PageEvent = ev
            pdfDoc.Open()

            'pdfDoc.AddHeader()

            Dim PdfTable2 As New PdfPTable(2)
            Dim Header As New PdfPCell(FormatHeader1("Trident Express Courier Service"))
            Header.Colspan = 2
            Header.HorizontalAlignment = 1
            Header.Border = 0
            PdfTable2.AddCell(Header)
            pdfDoc.Add(PdfTable2)

            Dim PdfTable3 As New PdfPTable(2)
            Dim address As New PdfPCell(FormatHeader2("No. 1, dummy House, 1, dummy  Road"))
            address.Colspan = 2
            address.HorizontalAlignment = 1
            address.Border = 0
            PdfTable3.AddCell(address)
            pdfDoc.Add(PdfTable3)

            Dim PdfCity As New PdfPTable(2)
            Dim CityValue As New PdfPCell(FormatHeader2("dummycity - 100000, Ph : 000-0000000"))
            CityValue.Colspan = 2
            CityValue.HorizontalAlignment = 1
            CityValue.BorderWidthLeft = 0
            CityValue.BorderWidthRight = 0
            CityValue.BorderWidthTop = 0
            CityValue.BorderWidthBottom = 2
            CityValue.PaddingBottom = 20
            PdfCity.AddCell(CityValue)
            pdfDoc.Add(PdfCity)


            Dim Pdfhearedline As New PdfPTable(2)
            Dim headerline As New PdfPCell(New Phrase(""))
            headerline.Colspan = 2
            headerline.HorizontalAlignment = 1
            headerline.Border = 0
            headerline.Padding = 4
            Pdfhearedline.AddCell(headerline)
            pdfDoc.Add(Pdfhearedline)

            '1st row creation
            Dim customerDetailsRow1 As New PdfPTable(8)
            Dim CustomerAddress1 As New PdfPCell(NormalText("ADDRESS 1 :"))
            CustomerAddress1.VerticalAlignment = 2
            CustomerAddress1.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerAddress1.Colspan = 4
            customerDetailsRow1.ExtendLastRow.ToString()

            Dim CustomerGstNo As New PdfPCell(NormalText("GST NO :"))
            CustomerGstNo.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerGstNo.Colspan = 4


            customerDetailsRow1.AddCell(CustomerAddress1)
            customerDetailsRow1.AddCell(CustomerGstNo)
            pdfDoc.Add(customerDetailsRow1)

            '2nd row creation
            Dim customerDetailsrow2 As New PdfPTable(8)
            Dim CustomerAddress2 As New PdfPCell(NormalText("ADDRESS 2 :"))
            CustomerAddress2.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerAddress2.Colspan = 4

            Dim CustomerPan As New PdfPCell(NormalText("PAN NO :"))
            CustomerPan.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerPan.Colspan = 4

            customerDetailsrow2.AddCell(CustomerAddress2)
            customerDetailsrow2.AddCell(CustomerPan)

            pdfDoc.Add(customerDetailsrow2)

            '3RD ROW CREATION
            Dim customerDetailsrow3 As New PdfPTable(8)

            Dim CustomerAddress3 As New PdfPCell(NormalText("ADDRESS 3 :"))
            CustomerAddress3.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerAddress3.Colspan = 4

            Dim vendaorCode As New PdfPCell(NormalText("VENDOR CODE :"))
            vendaorCode.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            vendaorCode.Colspan = 4

            customerDetailsrow3.AddCell(CustomerAddress3)
            customerDetailsrow3.AddCell(vendaorCode)

            pdfDoc.Add(customerDetailsrow3)

            '4TH ROW CREATION
            Dim customerDetailsrow4 As New PdfPTable(8)

            Dim CustomerADDempty1 As New PdfPCell(NormalText(""))
            CustomerADDempty1.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerADDempty1.Colspan = 4

            Dim contractno As New PdfPCell(NormalText("dummy NO :"))
            contractno.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            contractno.Colspan = 4

            customerDetailsrow4.AddCell(CustomerADDempty1)
            customerDetailsrow4.AddCell(contractno)

            pdfDoc.Add(customerDetailsrow4)

            '5TH ROW CREATION
            Dim customerDetailsrow5 As New PdfPTable(4)

            Dim CustomerADDempty2 As New PdfPCell(NormalText(""))
            CustomerADDempty2.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            CustomerADDempty2.Colspan = 4

            Dim invoiceNo As New PdfPCell(NormalText("INVOICE NO :"))
            invoiceNo.HorizontalAlignment = 0 ' //0=Left, 1=Centre, 2=Right
            invoiceNo.Colspan = 4


            customerDetailsrow5.AddCell(CustomerADDempty2)
            customerDetailsrow5.AddCell(invoiceNo)

            pdfDoc.Add(customerDetailsrow5)

            '6TH ROW CREATION



            'footer





            pdfDoc.Add(New Phrase(address1.Text.Trim()))
            pdfDoc.Add(New Phrase(TextBox1.Text.Trim()))

            pdfDoc.Add(New Paragraph(address1.Text.Trim()))
            pdfDoc.Add(New Phrase(TextBox2.Text.Trim()))

            pdfDoc.Add(pdfTable)

            pdfDoc.Close()
            stream.Close()
            MessageBox.Show("PDF Flie Saved")

        End Using
    End Sub

    Private Sub dataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dataGridView1.CellContentClick

    End Sub

    Private Function NormalText(value As String) As Phrase
        Return New Phrase(value, FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10))
    End Function
    Private Function FormatHeader1(value As String) As Phrase
        Return New Phrase(value, FontFactory.GetFont(FontFactory.TIMES_BOLD, 15))
    End Function
    Private Function FormatHeader2(value As String) As Phrase
        Return New Phrase(value, FontFactory.GetFont(FontFactory.TIMES_BOLD, 13))
    End Function

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    End Sub
End Class


Public Class itextEvents
    Implements IPdfPageEvent

    Public Sub OnChapter(writer As PdfWriter, document As Document, paragraphPosition As Single, title As Paragraph) Implements IPdfPageEvent.OnChapter
        ''Throw New NotImplementedException()
    End Sub

    Public Sub OnChapterEnd(writer As PdfWriter, document As Document, paragraphPosition As Single) Implements IPdfPageEvent.OnChapterEnd
        ' 'Throw New NotImplementedException()
    End Sub

    Public Sub OnCloseDocument(writer As PdfWriter, document As Document) Implements IPdfPageEvent.OnCloseDocument
        ' 'Throw New NotImplementedException()
    End Sub

    Public Sub OnEndPage(writer As PdfWriter, document As Document) Implements IPdfPageEvent.OnEndPage
        ''Throw New NotImplementedException()
        Dim pdfEndOfPageTable As New PdfPTable(2)
        Dim Customerfooter As New PdfPCell(NormalText("footer content bottom"))
        Customerfooter.HorizontalAlignment = 1 ' //0=Left, 1=Centre, 2=Right
        Customerfooter.Colspan = 2
        pdfEndOfPageTable.AddCell(Customerfooter)
        'document.Add(pdfEndOfPageTable)

    End Sub

    Public Sub OnGenericTag(writer As PdfWriter, document As Document, rect As Rectangle, text As String) Implements IPdfPageEvent.OnGenericTag
        ''Throw New NotImplementedException()
    End Sub

    Public Sub OnOpenDocument(writer As PdfWriter, document As Document) Implements IPdfPageEvent.OnOpenDocument
        ''Throw New NotImplementedException()
    End Sub

    Public Sub OnParagraph(writer As PdfWriter, document As Document, paragraphPosition As Single) Implements IPdfPageEvent.OnParagraph
        'Throw New NotImplementedException()
    End Sub

    Public Sub OnParagraphEnd(writer As PdfWriter, document As Document, paragraphPosition As Single) Implements IPdfPageEvent.OnParagraphEnd
        'Throw New NotImplementedException()
    End Sub

    Public Sub OnSection(writer As PdfWriter, document As Document, paragraphPosition As Single, depth As Integer, title As Paragraph) Implements IPdfPageEvent.OnSection
        'Throw New NotImplementedException()
    End Sub

    Public Sub OnSectionEnd(writer As PdfWriter, document As Document, paragraphPosition As Single) Implements IPdfPageEvent.OnSectionEnd
        'Throw New NotImplementedException()
    End Sub

    Public Sub OnStartPage(writer As PdfWriter, document As Document) Implements IPdfPageEvent.OnStartPage
        'Throw New NotImplementedException()
    End Sub
    Private Function NormalText(value As String) As Phrase
        Return New Phrase(value, FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10))
    End Function
End Class



What I have tried:

please help me out,i try many.

解决方案


这篇关于使用VB.NET为每个页面itextsharp pdf文件插入页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 08:06
查看更多