The code below will help you to implement an VBScript and VB6 app to set transparency for drawing in PDF. What is ByteScout PDF SDK? It 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. It can help you to set transparency for drawing in PDF in your VBScript and VB6 application.
VBScript and VB6 code samples for VBScript and VB6 developers help to speed up coding of your application when using ByteScout PDF SDK. In order to implement the functionality, you should copy and paste this code for VBScript and VB6 below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample VBScript and VB6 codes.
Download free trial version of ByteScout PDF SDK from our website with this and other source code samples for VBScript and VB6.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
' 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
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: