Hi S.Saba,
The following is a sample. Here I only get the previous setting of one page.
public void Test_getAndSetPages()
{
float pageHeight,pageWidth;
int pageRotation;
String thePdf = In_Path+"test.pdf";
PdfFileInfo fileInfo = new PdfFileInfo(thePdf);
//get original info of page 1
pageHeight = fileInfo.GetPageHeight(1);
pageWidth = fileInfo.GetPageWidth(1);
pageRotation = fileInfo.GetPageRotation(1);
//adjust pagesize
PageSize pSize = new PageSize();
pSize.Width = pageWidth+150;
pSize.Height = pageHeight+200;
//adjust rotation
pageRotation =pageRotation+90;
//to reset pages
PdfPageEditor pageEditor = new PdfPageEditor();
pageEditor.BindPdf(thePdf);
pageEditor.Pages=new int[4]{1,3,4,5}; //to reset all pages,just comment this line;
pageEditor.PageSize = pSize;
//pageEditor.Zoom=0.5f; // need zoom?
pageEditor.Rotation=pageRotation;
pageEditor.Save("D:\\pagesSetSample.pdf");
}
Felix Liu
Developer
Aspose Changsha Team
About Us Contact Us