Working with Watermark
Contents
[
Hide
]Add Watermark in a DWG
Sometimes you want to add some watermarks to drawings to indicate what purpose of the drawings or who created them. Aspose.CAD for Python allows you to add a watermark in a DWG file.
Sample Code
The code below shows how to achieve the same goal using Aspose.CAD for Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.cad as cad; | |
cadImage = cad.Image.load("file.dwg"); | |
rasterizationOptions = cad.imageoptions.CadRasterizationOptions(); | |
rasterizationOptions.page_width = 1200 | |
rasterizationOptions.page_height = 1200 | |
pdfOptions = cad.imageoptions.PdfOptions() | |
pdfOptions.vector_rasterization_options = rasterizationOptions | |
pdfOptions.user_watermark_text = "text"; | |
cadImage.save("result.pdf", pdfOptions) |