Hi,
Thanks for your interest in Aspose.
You can use PageInfo property of Section class to specify the PageHeight and PageWidth. Please try using the following code snippet.
[C#]
//Instantiate a Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();
//Create a section in the Pdf object
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1);
//Set the path of image file
image1.ImageInfo.File = "d:/pdftest/calendar_transparent_300dpi.tif";
//Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = ImageFileType.Tiff;
pdf1.Sections[0].PageInfo.PageHeight = 846; // where 1 inch = 72 Points. 11.75*72=846
pdf1.Sections[0].PageInfo.PageHeight = 576;
//Save the Pdf
pdf1.Save("d:\\pdftest\\tiffsize_issue3.pdf");
For more related information please visit Set Page Size and Margins.
In case of any further query, please feel free to share.
Nayyer Shahbaz
Support Developer, Aspose Sialkot Team
About Us Contact UsKeep in touch! We're on
Twitter and
Facebook