HTML JPG CAD XML DXF
  Product Family
PDF

Add a watermark to drawing via C#

Add a watermark without needing AutoCAD® or any other rendering software.

How to add a watermark using C#

In order to add watermark, we’ll use Aspose.CAD for .NET API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C# platform. Open NuGet package manager, search for Aspose.CAD and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command


PM> Install-Package Aspose.CAD

Steps to add watermark using C#

.NET developers can easily download and add a watermark with just a few lines of code.

  1. Load file with Image.Load method
  2. Set an object of CadRasterizationOptions with page height & width
  3. Create an instance of PdfOptions class and set its VectorRasterizationOptions property
  4. Set UserWatermarkText and UserWatermarkColor parameter
  5. Call Image.Save method while passing the resultant file path & object of PdfOptions

System Requirements

Before running the .NET conversion code, make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, and PHP, VBScript, Delphi, C++ via COM Interop.
  • Development environment like Microsoft Visual Studio.
  • Aspose.CAD for .NET DLL referenced in your project.
 

This sample code shows add watermark C#

 

About Aspose.CAD

Aspose.CAD API can be used for CAD or BIM document manipulation within applications. Process & convert CAD drawings to PDF, JPG, PNG & many more shareable file formats. API not only loads main AutoCad formats including DWG, DXF, DGN, IFC, IGES, DWF, DWFx, STL, PLT but also converts to PDF and raster images such as PNG, JPG, BMP, TIFF, and GIF with ease.

Add a watermark via Online App

Add a watermark into file right now by visiting our Live Demos website. The live demo has the following benefits

  No need to download or setup anything.
  No need to write any code.
  Just upload your file and add a watermark.
  You will instantly get the download link for resultant PDF file.