We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Edit WMF file with Aspose.imaging and C#

Hi,

We have a form in wmf.

It has few line fields to add text to it.

for example, if there is a line in existing wmf file above that line we need to add some text.

We are using aspose.imaging and c#.

Please help.

@svkrishnagavva

Can you please share the details of the requirements in the form os sample image that what actually you want to achieve using API. We will try to help you further based on shared information.

0W36BQ01.zip (2.3 KB)

Hi,

I have attached the sample wmf file.

I need to fill those fields in wmf programmatically with some data.

Please help

@svkrishnagavva

Thank you for sharing the information. We need to investigate the requirement further on our end. A ticket with ID IMAGINGNET-4782 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Hi,

Please help to understand if there is any update on this.

@svkrishnagavva

Can you please try using following sample code on your end. I hope this will be helpful.

        using (WmfImage image = (WmfImage)Image.Load(@"D:\0W36BQ01.WMF"))
        {
            image.CacheData();
            var records = image.Records.Cast<WmfObject>().Where(o => o is WmfExtTextOut);
            var i = 0;
            foreach (var record in records)
            {
                var wmfText = (WmfExtTextOut)record;
                if (wmfText.Text == "City:")
                {
                    wmfText.Text += " New York";
                }
            }

            image.Save(@"D:\0W36BQ01_Edited.WMF");
        }