Image file extensions which support watermark

I’ve tried out that jpg, png,gif,tif support watermark. Does dwg or psd files support watermark?

Hi Louis,

Image.Load method allows you to load DWG and PSD files also, so you can insert the watermark in these formats also. Please let us know if you see any issue.

Best Regards,

Hi Muhammad,

Thanks for your reply, I have tried to add watermark to a dwg file, the Image.Load method works fine, but the graphics.DrawString method throw an exception.

The attached files are the screen shot and dwg sample file.

Hi Louis,

We are investigating the issue and will update you shortly.

Best Regards,

Hi Louis,

DWG and DXF formats are now supported by Aspose.CAD API. Support for these formats will be removed from Aspose.Imaging in a couple of months. You can use Aspose.Imaging license with Aspose.CAD as well.

As far as adding a watermark to DWG is concerned, it is not supported and a feature request to support this feature has been logged into our issue tracking system as CADNET-116. We will keep you updated on this issue in this thread.

Best Regards,

Hi Louis,

In the meantime, you can use the following code as a workaround.

// … loading image here …

// add new MTEXT

CadMText
watermark = new CadMText();

watermark.Text
= “Watermark message”;

watermark.InitialTextHeight
= 40;

watermark.InsertionPoint
= new Cad3DPoint(300, 40);

watermark.LayerName
= “0”;

cadImage.BlockEntities["*Model_Space"].AddEntity(watermark);

// or add more simple entity like Text

CadText
text = new CadText();

text.DefaultValue
= “Watermark text”;

text.TextHeight
= 40;

text.FirstAlignment
= new Cad3DPoint(300, 40);

text.LayerName
= “0”;

cadImage.BlockEntities["*Model_Space"].AddEntity(text);

// export to pdf

CadRasterizationOptions
rasterizationOptions = new
CadRasterizationOptions();

rasterizationOptions.PageWidth
= 1600;

rasterizationOptions.PageHeight
= 1600;

rasterizationOptions.CenterDrawing
= true;

rasterizationOptions.Layouts
= new[] { “Model”
};

PdfOptions
pdfOptions = new PdfOptions();

pdfOptions.VectorRasterizationOptions
= rasterizationOptions;

cadImage.Save(outPath, pdfOptions);


Best Regards,

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.