ByteScout Watermarking SDK - VBScript - Add Annotation Watermarks with Macros - ByteScout

ByteScout Watermarking SDK – VBScript – Add Annotation Watermarks with Macros

  • Home
  • /
  • Articles
  • /
  • ByteScout Watermarking SDK – VBScript – Add Annotation Watermarks with Macros

How to add annotation watermarks with macros in VBScript with ByteScout Watermarking SDK

The tutorial below will demonstrate how to add annotation watermarks with macros in VBScript

On this page you will learn from code samples for programming in VBScript.Writing of the code to add annotation watermarks with macros in VBScript can be done by developers of any level using ByteScout Watermarking SDK. ByteScout Watermarking SDK is the software development kit that helps to quickly implement adding of watermarks on top of PNG, JPG, BMP images as well as on multipaged TIFF files. You may select ready to use presets or create your own preset with semitransparent logo images, text lines with adjustable font size, family, color, rotation. It can add annotation watermarks with macros in VBScript.

You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout Watermarking SDK for add annotation watermarks with macros below and use it in your application. This VBScript sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Use of ByteScout Watermarking SDK in VBScript is also explained in the documentation included along with the product.

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

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

AnnotationWithMacros.vbs
      
' Create Watermarker instance Set watermarker = CreateObject("Bytescout.Watermarking.Watermarker") ' Initialize library watermarker.InitLibrary "demo", "demo" ' Set input file name Dim inputFilePath inputFilePath = "..\sample_image.jpg" ' Set output file title Dim outputFilePath outputFilePath = "result.png" ' Add image to apply watermarks to watermarker.AddInputFile_2 inputFilePath, outputFilePath ' Create new watermark Set preset = CreateObject("Bytescout.Watermarking.Presets.TextAnnotation") ' Set watermark text with macros. ' Complete list of available macros please see in the SDK documentation. preset.Text = "Date Time: {{LOCAL_DATE_LONG}} {{LOCAL_TIME}}" & vbCrLf & _ "Filename: {{FILENAME}}" & vbCrLf & _ "Manufacturer: {{EXIF_EQUIPMENT_MANUFACTURER}}" & vbCrLf & _ "Model: {{EXIF_EQUIPMENT_MODEL}}" & vbCrLf & _ "Software: {{EXIF_SOFTWARE_USED}}" & vbCrLf & _ "Date/Time: {{EXIF_ORIGINAL_DATE}}" & vbCrLf & _ "Exposure Time: {{EXIF_EXPOSURE_TIME}} sec" & vbCrLf & _ "Exposure Program: {{EXIF_EXPOSURE_PROGRAM}}" & vbCrLf & _ "Exposure Bias: {{EXIF_EXPOSURE_BIAS}} EV" & vbCrLf & _ "F Number: F {{EXIF_F_NUMBER}}" & vbCrLf & _ "ISO Speed Rating: ISO {{EXIF_ISO_SPEED}}" & vbCrLf & _ "Flash: {{EXIF_FLASH}}" & vbCrLf & _ "Focal Length: {{EXIF_FOCAL_LENGTH}} mm" & vbCrLf & _ "Metering Mode: {{EXIF_METERING_MODE}}" ' Set watermark font Set font = CreateObject("Bytescout.Watermarking.WatermarkFont") font.Name = "Arial" font.Style = 1 ' Bold font.SizeType = 1 ' Points font.Size = 12 preset.Font = font ' Set text color preset.SetTextColor 255, 255, 255, 255 ' White color in ARGB values ' Add watermark to watermarker waterMarker.AddWatermark(preset) ' Apply watermarks waterMarker.Execute() ' open generated image file in default image viewer installed in Windows Set shell = CreateObject("WScript.Shell") shell.Run outputFilePath, 1, false Set shell = Nothing ' Cleanup Set font = Nothing Set preset = Nothing Set watermarker = Nothing

Try ByteScout Watermarking 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 Watermarking SDK Home Page

Explore ByteScout Watermarking SDK Documentation

Get ByteScout Watermarking SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next