Free Support Forum - aspose.com

The image file that is generated from DWF is blurry and the font is overlapping

E-1612BE.dwf.zip (43.4 KB)
<a class=“attachment” href="/upE-1612BE.png.zip (316.9 KB)
loads/discourse_instance3/35788">0032-X001-020-02.dwf.zip (68.0 KB)
0032-X001-020-02.png (267.2 KB)

The pipe images are not properly coming the font seems to be distorted and overlapping when we tried converting the DWF to PNG file.

Here is the program we are using

using Aspose.CAD;
using Aspose.CAD.FileFormats.Dwf;
using Aspose.CAD.ImageOptions;
using System;
using System.IO;

namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Hello World!”);
string imgFileName = null;
int pageCount = 0;

    try
    {
        using (Aspose.CAD.Image image = Aspose.CAD.Image.Load("dwftest.dwf"))
        {
            ImageOptionsBase imgOption = new PngOptions();
            pageCount = 1;
            FileStream fileStream = null;
            DwfImage dwfImage = (DwfImage)image;                  
            foreach (var page in dwfImage.Pages)
            {
                imgFileName = "TestDwf"  + "_" + pageCount + ".png";
                Console.WriteLine("Convert>>page>>"+page);
                fileStream = new FileStream(imgFileName, FileMode.Create);
                using (MemoryStream imageStream = new MemoryStream())
                {
                    CadRasterizationOptions options = new CadRasterizationOptions
                    {
                        Layouts = new string[] { page.Name }
                    };

                    options.PageHeight = image.Height * 300;
                    options.PageWidth = image.Width * 300;
                    imgOption.VectorRasterizationOptions = options;

                    image.Save(imageStream, imgOption);
                    Console.WriteLine("Convert>>result file>>" + imgFileName);
                    imageStream.WriteTo(fileStream);

                    // Close stream
                    fileStream.Close();
                    imageStream.Close();
                }

                pageCount++;
            }
        }


    }
    catch (Exception e)
    {

    }
}

}
}

Attached are the DWF and the generated png files

@kutti184,

I have worked with the sample DWF and have observed the issue. An issue with ID CADNET-1034 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.