ByteScout PDF SDK - VB.NET - Add Header And Footer - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF SDK – VB.NET – Add Header And Footer

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Add Header And Footer

How to add header and footer in VB.NET and ByteScout PDF SDK

Write code in VB.NET to add header and footer with this step-by-step tutorial

Every ByteScout tool contains example VB.NET source codes that you can find here or in the folder with installed ByteScout product. Want to add header and footer in your VB.NET app? ByteScout PDF SDK is designed for it. ByteScout PDF SDK is the component to help programmers in generating new pdf files, modifying and updating existing pdf documents or pdf forms. Provides support for auto-filling pdf forms, adding text with adjustable font, style, size, font family, new form fields, vector and raster drawings.

VB.NET code samples for VB.NET developers help to speed up coding of your application when using ByteScout PDF SDK. Just copy and paste the code into your VB.NET application’s code and follow the instruction. This basic programming language sample code for VB.NET will do the whole work for you to add header and footer.

Our website provides trial version of ByteScout PDF SDK for free. It also includes documentation and source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports Bytescout.PDF Imports Font = Bytescout.PDF.Font Imports SolidBrush = Bytescout.PDF.SolidBrush Module Program Sub Main() Try Using doc As Document = New Document() doc.RegistrationName = "demo" doc.RegistrationKey = "demo" doc.Load("sample.pdf") ' Prepare simple template (for example, a logo) And draw it on every page ' Create template of specified size Dim headerTemplate As GraphicsTemplate = New GraphicsTemplate(250, 50) headerTemplate.DrawString("Here is a header text", New Font(StandardFonts.CourierBold, 15), New SolidBrush(), 30, 10) Dim footerTemplate As GraphicsTemplate = New GraphicsTemplate(250, 50) footerTemplate.DrawString("Here is the footer text", New Font(StandardFonts.CourierBold, 15), New SolidBrush(), 30, 10) ' Write template in each pages For i As Integer = 0 To doc.Pages.Count - 1 Dim currentPage As Page = doc.Pages(i) currentPage.Canvas.DrawTemplate(headerTemplate, 40, 10) currentPage.Canvas.DrawTemplate(footerTemplate, 350, (currentPage.Height - 40)) Next ' Save output file doc.Save("result.pdf") End Using ' Open output file Process.Start("result.pdf") Catch ex As Exception Console.WriteLine(ex.Message) End Try Console.WriteLine("Press enter key to exit...") Console.ReadLine() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next