How to increase exported image size

Technical support for Spire.Doc

Moderator: iceblue support

How to increase exported image size

Postby abdullah » 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: 3
Joined: Wed Nov 30, 2011 8:59 am

Re: How to increase exported image size

Postby harry.support » 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

Re: How to increase exported image size

Postby abdullah » 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: 3
Joined: Wed Nov 30, 2011 8:59 am

Re: How to increase exported image size

Postby harry.support » 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

Who is online

Users browsing this forum: No registered users and 0 guests