การทำงานกับลายน้ำ
Contents
[
Hide
]เพิ่มลายน้ำในไฟล์ DWG
บางครั้งคุณอาจต้องการเพิ่มลายน้ำในภาพวาดเพื่อระบุว่าวัตถุประสงค์ของภาพวาดคืออะไรหรือใครเป็นผู้สร้างมัน Aspose.CAD สำหรับ Python ช่วยให้คุณสามารถเพิ่มลายน้ำในไฟล์ DWG ได้
ตัวอย่างโค้ด
โค้ดด้านล่างนี้แสดงวิธีการบรรลุเป้าหมายเดียวกันโดยใช้ Aspose.CAD สำหรับ Python
This file contains hidden or 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) |