Specify Page Size when Converting to Images

Hi,

How can I specify the page size (A4, Letter, Legal...etc) when converting document pages into images for Excel, PowerPoint, Word, Visio, and MS Project.

Thanks

Hi Scott,

I am representing Aspose.Slides.

Please use the C# code snippet given below to set the slide size and orientation.

PresentationEx pres = new PresentationEx();

pres.SlideSize.Type = SlideSizeTypeEx.A4Paper;
// pres.SlideSize.Type = SlideSizeTypeEx.Ledger ;

pres.SlideSize.Type = SlideSizeTypeEx.Ledger;

pres.Write(@"D:\Aspose Data\Test.pptx");

Many Thanks,

Hi,


Please see the following code segment on how to specify the page size while converting Excel sheet(s) pages to image files using Aspose.Cells product:

Workbook book = new Workbook(“e:\test\testjm.xls”);



ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Png;
Worksheet sheet = book.Worksheets[0];
sheet.PageSetup.PaperSize = PaperSizeType.PaperA4; // You may try other page sizes using PaperSizeType enum.
SheetRender sr = new SheetRender(sheet, imgOptions);
for (int j = 0; j < sr.PageCount; j++)
{

sr.ToImage(j, “e:\test\testimage_” + sheet.Index + j + “.png”);
}

Also check the documents for your further reference:
http://www.aspose.com/docs/display/cellsnet/Setting+Page+Options

http://www.aspose.com/docs/display/cellsnet/Converting+Worksheet+to+Image

Hi Scott,

Thanks for your query. Please use the following code snippet to specify paper size.

Document doc = new Document(MyDir + "input.docx");

foreach (Section section in doc)

section.PageSetup.PaperSize = Aspose.Words.PaperSize.Letter;

doc.Save(MyDir + "Letter.tiff");

Please read following documentation links for your kind reference.

PaperSize Enumeration

Hope this answers your query. Please let us know, If you have any more queries.

Hi Scott,

Aspose.Diagram for .NET allows you set width and height of the page but you cannot use pre-defined page sizes at the moment. A new issue to support this feature has been logged into our issue tracking system as DIAGRAM-33185. We will keep you updated on this issue in this thread. In the meantime, you can use the following code.

diagram.Pages[0].PageSheet.PageProps.PageHeight.Value = 8;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

diagram.Pages[0].PageSheet.PageProps.PageWidth.Value = 11;

Best Regards,

Hi Scott,

At the moment, you can set the width and height of the page in pixels while rendering the project to Gantt chart image. A new issue to support pre-defined page sizes has been logged into our issue tracking system as TASKS-33157. We will keep you updated on this issue in this thread.

Best Regards,

The issues you have found earlier (filed as DIAGRAM-33185) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as TASKS-33157) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.