ByteScout PDF Suite - VBScript - Set transparency for drawing in pdf with pdf sdk - ByteScout

ByteScout PDF Suite – VBScript – Set transparency for drawing in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VBScript – Set transparency for drawing in pdf with pdf sdk

How to set transparency for drawing in pdf with pdf sdk in VBScript using ByteScout PDF Suite

Learn to set transparency for drawing in pdf with pdf sdk in VBScript

An easy to understand sample source code to learn how to set transparency for drawing in pdf with pdf sdk in VBScript Want to set transparency for drawing in pdf with pdf sdk in your VBScript app? ByteScout PDF Suite is designed for it. ByteScout PDF Suite is the set that includes 6 SDK products 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.

Want to quickly learn? This fast application programming interfaces of ByteScout PDF Suite for VBScript plus the guidelines and the code below will help you quickly learn how to set transparency for drawing in pdf with pdf sdk. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample VBScript codes.

ByteScout PDF Suite free trial version is available on our website. VBScript and other programming languages are supported.

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

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

Transparency.vbs
      
' This example demonstrates how to draw transparent objects. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add page Set page1 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page1) Set canvas = page1.Canvas ' Prepare pens and brushes Set borderPen = comHelpers.CreateSolidPen(comHelpers.CreateColorGray(0), 2.0) Set brush1 = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(255, 0, 0)) Set brush2 = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(0, 0, 255)) borderPen.Opacity = 50 brush1.Opacity = 30 brush2.Opacity = 60 ' Draw normal rectangles canvas.DrawRectangle_2 (brush1), 100, 100, 100, 100 canvas.DrawRectangle_3 (borderPen), (brush2), 150, 150, 100, 100 borderPen.Opacity = 80 brush1.Opacity = 60 brush2.Opacity = 30 ' Draw rounded rectangles canvas.DrawRoundedRectangle_2 (brush1), 220, 100, 100, 100, 10 canvas.DrawRoundedRectangle_3 (borderPen), (brush2), 270, 150, 100, 100, 10 ' 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

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