ByteScout PDF SDK - VBScript and VB6 - Add Watermarks in PDF - ByteScout

ByteScout PDF SDK – VBScript and VB6 – Add Watermarks in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VBScript and VB6 – Add Watermarks in PDF

How to add watermarks in PDF in VBScript and VB6 with ByteScout PDF SDK

This code in VBScript and VB6 shows how to add watermarks in PDF with this how to tutorial

Add watermarks in PDF is easy to implement in VBScript and VB6 if you use these source codes below. ByteScout PDF SDK: the library for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings. It can add watermarks in PDF in VBScript and VB6.

This code snippet below for ByteScout PDF SDK works best when you need to quickly add watermarks in PDF in your VBScript and VB6 application. In your VBScript and VB6 project or application you may simply copy & paste the code and then run your app! Enjoy writing a code with ready-to-use sample VBScript and VB6 codes.

Free trial version of ByteScout PDF SDK is available for download from our website. Get it to try other source code samples for VBScript and VB6.

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Watermarks.vbs
      
' This example demonstrates how to change the word spacing. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add pages pdfDocument.Pages.Add(comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4)) pdfDocument.Pages.Add(comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4)) pdfDocument.Pages.Add(comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4)) Set font1 = comHelpers.CreateSystemFont("Times New Roman", 16) Set font2 = comHelpers.CreateStandardFont(comHelpers.STANDARDFONTS_HELVETICABOLD, 24) Set semitransparentRedBrush = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(255, 0, 0)) semitransparentRedBrush.Opacity = 50 ' make the brush semitransparent Set greenBrush = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(0, 128, 0)) Set semitransparentBlueBrush = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(0, 0, 255)) semitransparentBlueBrush.Opacity = 50 ' make the brush semitransparent Set redPen = comHelpers.CreateSolidPen(comHelpers.CreateColorRGB(255, 0, 0), 1) ' Add tiling watermark Set watermark1 = comHelpers.CreateTextWatermark("Tiling Watermark") watermark1.WatermarkLocation = comHelpers.TEXTWATERMARKLOCATION_TILED watermark1.Angle = 30 watermark1.Brush = semitransparentBlueBrush pdfDocument.Watermarks.Add(watermark1) ' Add autosized watermark to every page of the document Set watermark2 = comHelpers.CreateTextWatermark("Center Watermark") watermark2.WatermarkLocation = comHelpers.TEXTWATERMARKLOCATION_DIAGONALFROMBOTTOMLEFTTOTOPRIGHT watermark2.Font = font1 watermark2.Brush = semitransparentRedBrush watermark2.Pen = redPen pdfDocument.Watermarks.Add(watermark2) ' Add watermark of custom size and location to the first page only Set watermark3 = comHelpers.CreateTextWatermark("Simple Watermark") watermark3.Font = font2 watermark3.Brush = greenBrush watermark3.Left = 350 watermark3.Top = 800 pdfDocument.Pages.Item(0).Watermarks.Add(watermark3) ' Save document to file pdfDocument.Save("result.pdf") ' Open document in default PDF viewer app Set shell = CreateObject("WScript.Shell") shell.Run "result.pdf", 1, false

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Get ByteScout PDF SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next