Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Dec 23, 2011 6:53 am

Hi,
I am able to convert word to images, but I wants to be able to make the exported image size larger so that it can be viewed without being pixilated on large screens. Can you please tell me how I can do this by using your component?

Thanks
Abdullah Atta

abdullah
 
Posts: 2
Joined: Wed Nov 30, 2011 8:59 am

Mon Dec 26, 2011 8:56 am

Dear Abdullah,

Thanks for your inquiry.
I suggest you:
    1. Save word as images with Metafile format
    2. Scale the Metafile format images

please see the demo below:
Code: Select all
public static IEnumerable<Image> ExportDocToImages(FileInfo docFile, float pageSizeScale)
{
    Document doc = new Document(docFile.FullName);
    Image[] imgs = doc.SaveToImages(Spire.Doc.Documents.ImageType.Metafile);
    Image[] scaledImages = new Image[imgs.Length];
    for(int i = 0; i < imgs.Length; i++)
    {
        Size newSize
            = new Size((int)(imgs[i].Width * pageSizeScale), (int)(imgs[i].Height * pageSizeScale));
        scaledImages[i] = new Bitmap(imgs[i], newSize);
    }

    return scaledImages;
}
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar

harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Mon Dec 26, 2011 12:51 pm

Hi harry,

It seems that your code has fixed my problem
Your component is excellent.


Thanks.

abdullah
 
Posts: 2
Joined: Wed Nov 30, 2011 8:59 am

Tue Dec 27, 2011 2:20 am

Hi Abdullah,

It's great.
If you have any other question, please feel free to contact us.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar

harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Return to Spire.Doc