Hey there again,
I’ve converted an aspose.slides presentation to images using GetThumbnail, then i add these images to an Aspose.PDF object.
The image is rendered, but it does not fit to page but rather is placed and the edge is a bit cut.
Is there a way to centralize the image or fit it to the page?
this is the code I’m using :
//Loop over the worksheets collection
for (int index = 0; index < wrkExcel.Worksheets.Count; index++)
{
MemoryStream ms = new MemoryStream();
Worksheet worksheet = wrkExcel.Worksheets[index];
//Define ImageOrPrintOptions
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
//Specify the image format
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Bmp;
//Only one page for the whole sheet would be rendered
imgOptions.OnePagePerSheet = false;
imgOptions.IsImageFitToPage = false;
//Render the sheet with respect to specified image/print options
SheetRender sr = new SheetRender(worksheet, imgOptions);
for (int j = 0; j < sr.PageCount; j++)
{
//sr.ToImage(0, ms);
//Render the image for the sheet
Bitmap bitmap = sr.ToImage(j);
bitmap.Save(ms, ImageFormat.Bmp);
int newindex = dstWrk.Worksheets.Add();
dstWrk.Worksheets[newindex].Pictures.Add(0, 0, ms);
}
}
How may I go about this ?
Thanks,
Garkler