ByteScout PDF Suite - C# - Set blend mode for drawing in pdf with pdf sdk - ByteScout

ByteScout PDF Suite – C# – Set blend mode for drawing in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – C# – Set blend mode for drawing in pdf with pdf sdk

How to set blend mode for drawing in pdf with pdf sdk in C# and ByteScout PDF Suite

Learn to set blend mode for drawing in pdf with pdf sdk in C#

On this page you will learn from code samples for programming in C#.Writing of the code to set blend mode for drawing in pdf with pdf sdk in C# can be executed by programmers of any level using ByteScout PDF Suite. Want to set blend mode for drawing in pdf with pdf sdk in your C# app? ByteScout PDF Suite is designed for it. 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.

This prolific sample source code in C# for ByteScout PDF Suite contains various functions and other necessary options you should do calling the API to set blend mode for drawing in pdf with pdf sdk. This C# 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! Further improvement of the code will make it more robust.

Our website gives trial version of ByteScout PDF Suite for free. It also includes documentation and source code samples.

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

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

Program.cs
      
using System.Diagnostics; using Bytescout.PDF; namespace BlendModeExample { /// <summary> /// This example demonstrates how to use blend modes - a way how /// intersecting semi-transparent objects will blend on page canvas. /// </summary> class Program { static void Main() { // Create new document Document pdfDocument = new Document(); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // Add page Page page = new Page(PaperFormat.A4); pdfDocument.Pages.Add(page); Canvas canvas = page.Canvas; // Create transparent brushes SolidBrush brushRed = new SolidBrush(new ColorRGB(255, 0, 0)); brushRed.Opacity = 50; SolidBrush brushGreen = new SolidBrush(new ColorRGB(0, 255, 0)); brushGreen.Opacity = 50; SolidBrush brushBlue = new SolidBrush(new ColorRGB(0, 0, 255)); brushBlue.Opacity = 50; // Normal blending canvas.BlendMode = BlendMode.Normal; canvas.DrawCircle(brushRed, 100, 100, 50); canvas.DrawCircle(brushGreen, 100, 150, 50); canvas.DrawCircle(brushBlue, 150, 100, 50); // Darken blending canvas.BlendMode = BlendMode.Darken; canvas.DrawCircle(brushRed, 300, 100, 50); canvas.DrawCircle(brushGreen, 300, 150, 50); canvas.DrawCircle(brushBlue, 350, 100, 50); // Lighten blending canvas.BlendMode = BlendMode.Lighten; canvas.DrawCircle(brushRed, 100, 300, 50); canvas.DrawCircle(brushGreen, 100, 350, 50); canvas.DrawCircle(brushBlue, 150, 300, 50); // Color burn blending canvas.BlendMode = BlendMode.ColorBurn; canvas.DrawCircle(brushRed, 300, 300, 50); canvas.DrawCircle(brushGreen, 300, 350, 50); canvas.DrawCircle(brushBlue, 350, 300, 50); // Save document to file pdfDocument.Save("result.pdf"); // Cleanup pdfDocument.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

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