I was trying to export some data to PDF .I am using Aspose.words 15 .The page orientation and page size property set during design is not getting applied when exported to pdf.this is my code
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
PageSetup ps = builder.PageSetup;
ps.PaperSize = PaperSize.Legal;
ps.Orientation = Aspose.Words.Orientation.Landscape;
ps.TopMargin = ConvertUtil.InchToPoint(0.5);
ps.BottomMargin = ConvertUtil.InchToPoint(0.69);
ps.LeftMargin = ConvertUtil.InchToPoint(0.44);
ps.RightMargin = ConvertUtil.InchToPoint(0.38);
ps.HeaderDistance = ConvertUtil.InchToPoint(0.2);
ps.FooterDistance = ConvertUtil.InchToPoint(0.002);
builder.Font.ClearFormatting();
builder.Font.Size = 12;
builder.Font.Bold = true;
builder.Font.Color = System.Drawing.Color.Black;
builder.Font.Name = "Times New Roman";
builder.CurrentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;
Aspose.Words.Tables.Table tableMain = builder.StartTable();
BorderCollection borders = builder.CellFormat.Borders;
borders.LineStyle = LineStyle.Single;
borders.LineWidth = 1;
borders.Color = Color.Black;
builder.CurrentParagraph.ParagraphFormat.ClearFormatting();
builder.CellFormat.LeftPadding = 0;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.RowFormat.HeadingFormat = true;
builder.CellFormat.Shading.BackgroundPatternColor = System.Drawing.Color.FromArgb(226, 239, 217);
builder.Font.ClearFormatting();
builder.Font.Size = 9;
builder.Font.Bold = true;
builder.Font.Color = System.Drawing.Color.Black;
builder.Font.Name = "Times New Roman";
builder.InsertCell();
builder.CellFormat.Width = ConvertUtil.InchToPoint(Convert.ToDouble("3.5"));
builder.Writeln("Colummn1");
builder.InsertCell();
builder.CellFormat.Width = ConvertUtil.InchToPoint(Convert.ToDouble("3.5"));
builder.Writeln("Colummn1");
builder.InsertCell();
builder.CellFormat.Width = ConvertUtil.InchToPoint(Convert.ToDouble("3.5"));
builder.Writeln("Colummn1");
builder.EndRow();
builder.RowFormat.HeadingFormat = false;
builder.EndTable();
doc.Save(this.Response, "test.pdf", ContentDisposition.Attachment, Aspose.Words.Saving.DocSaveOptions.CreateSaveOptions(SaveFormat.Pdf));