Hi Thomas,
The following code adds a header and a footer to a new pdf document.
I would like to do the same but for an existing pdf document.
Is it possible or not?
Can anyone help me on this?
Thanks
Code:
Try
Dim myDoc As Document = New Document
Dim mySect As Section = myDoc.AddSection()
mySect.AddParagraph("test hello world")
Dim paragrph As Paragraph = mySect.Headers.Primary.AddParagraph()
paragrph.AddText("Label: labelA1" & vbCrLf & "Issue: Issue1")
paragrph.Format.Alignment = ParagraphAlignment.Right
Dim paragrphFooter As Paragraph = mySect.Footers.Primary.AddParagraph()
paragrphFooter.AddText("Footer reference")
paragrphFooter.Format.Alignment = ParagraphAlignment.Right
Dim myRenderer As PdfDocumentRenderer = New PdfDocumentRenderer(True, PdfFontEmbedding.Always)
myRenderer.Document = myDoc
myRenderer.RenderDocument()
Const filename As String = "c://Demo1.pdf"
myRenderer.PdfDocument.Save(filename)
Process.Start(filename)
Catch ex As Exception
Debug.Print(ex.Message)
End Try