ByteScout PDF Suite - VB.NET - Set invisible text over image in pdf with pdf sdk - ByteScout

ByteScout PDF Suite – VB.NET – Set invisible text over image in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VB.NET – Set invisible text over image in pdf with pdf sdk

How to set invisible text over image in pdf with pdf sdk in VB.NET with ByteScout PDF Suite

Step-by-step tutorial on how to set invisible text over image in pdf with pdf sdk in VB.NET

An easy to understand guide on how to set invisible text over image in pdf with pdf sdk in VB.NET with this source code sample. ByteScout PDF Suite can set invisible text over image in pdf with pdf sdk. It can be applied from VB.NET. ByteScout PDF Suite is the bundle that provides six different SDK libraries to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.

The following code snippet for ByteScout PDF Suite works best when you need to quickly set invisible text over image in pdf with pdf sdk in your VB.NET application. Just copy and paste the code into your VB.NET application’s code and follow the instructions. Enjoy writing a code with ready-to-use sample codes in VB.NET.

The trial version of ByteScout PDF Suite can be downloaded for free from our website. It also includes source code samples for VB.NET and other programming languages.

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 ''' <summary> ''' This example demonstrates how to create PDF document from scanned document image and add invisible text over it. ''' </summary> Class Program Shared Sub Main() ' Create new PDF document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Load image from file to System.Drawing.Image object (we need it to get the image resolution) Dim sysImage As System.Drawing.Image = System.Drawing.Image.FromFile(".\scanned-invoice.png") ' Compute image size in PDF units (Points) Dim widthInPoints As Single = sysImage.Width / sysImage.HorizontalResolution * 72.0F Dim heightInPoints As Single = sysImage.Height / sysImage.VerticalResolution * 72.0F ' Create page of computed size Dim page = New Page(widthInPoints, heightInPoints) ' Add page to the document pdfDocument.Pages.Add(page) Dim canvas = page.Canvas ' Create Bytescout.PDF.Image object from loaded image Dim pdfImage = New Image(sysImage) ' Draw the image canvas.DrawImage(pdfImage, 0, 0, widthInPoints, heightInPoints) ' Dispose the System.Drawing.Image object to free resources sysImage.Dispose() ' Create brush Dim transparentBrush As SolidBrush = New SolidBrush(New ColorGray(0)) ' ... and make it transparent transparentBrush.Opacity = 0 ' Draw text with transparent brush Dim font16 As Font = New Font(StandardFonts.Helvetica, 16) canvas.DrawString("Your Company Name", font16, transparentBrush, 40, 40) ' Draw another text Dim font10 As Font = New Font(StandardFonts.Helvetica, 10) canvas.DrawString("Your Address", font10, transparentBrush, 40, 80) ' Save document to file pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite 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 Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next