I appear to have found a bug when aligning a table cell right after having aligned a paragraph. The following code produces the attached PDF. Notice that the paragraph isn't right-aligned as it should be. If you change the Table1.DefaultCellTextInfo.Alignment to Right and regenerate the PDF you'll see they both go right-aligned.
Dim license As Aspose.Pdf.License = New Aspose.Pdf.License
license.SetLicense("Aspose.Custom.lic")
Dim FontName As String = "Verdana"
Dim FontSize As Integer = 10
Dim PointsPerInch As Integer = 72
Dim ThisPdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf
ThisPdf.PageSetup.Margin.Top = 36
ThisPdf.PageSetup.Margin.Right = 36
ThisPdf.PageSetup.Margin.Bottom = 36
ThisPdf.PageSetup.Margin.Left = 36
ThisPdf.IsLandscape = False
ThisPdf.PageSetup.PageHeight = 11 * PointsPerInch
ThisPdf.PageSetup.PageWidth = 8.5 * PointsPerInch
ThisPdf.TextInfo.FontName = FontName
ThisPdf.TextInfo.FontSize = FontSize
ThisPdf.PageNumberFormat = Aspose.Pdf.PageNumberFormatType.Arab
Dim DefaultTI As Aspose.Pdf.TextInfo = New Aspose.Pdf.TextInfo
DefaultTI.FontName = FontName
DefaultTI.FontSize = FontSize
DefaultTI.Alignment = Aspose.Pdf.AlignmentType.Left
Dim Section1 As Aspose.Pdf.Section = ThisPdf.Sections.Add
Section1.TextInfo.FontName = FontName
Section1.TextInfo.FontSize = FontSize
Dim Text1 As Aspose.Pdf.Text = New Aspose.Pdf.Text("Paragraph 1 is right aligned")
Section1.Paragraphs.Add(Text1)
Text1.TextInfo = DefaultTI
Text1.Margin.Top = 0.25 * PointsPerInch
Text1.TextInfo.Alignment = Aspose.Pdf.AlignmentType.Right
Dim Table1 As Aspose.Pdf.Table = New Aspose.Pdf.Table(Section1)
Section1.Paragraphs.Add(Table1)
Table1.DefaultCellTextInfo = DefaultTI
Table1.DefaultCellTextInfo.Alignment = Aspose.Pdf.AlignmentType.Left 'This appears to override the Text1.TextInfo.Alignment line above
Table1.Margin.Top = 0.25 * PointsPerInch
Table1.ColumnWidths = "200"
Dim Table1Row1 As Aspose.Pdf.Row = Table1.Rows.Add
Dim Table1Row1Cell1 As Aspose.Pdf.Cell = Table1Row1.Cells.Add("Cell 1 is left aligned")
ThisPdf.Save("test.pdf", Aspose.Pdf.SaveType.OpenInBrowser, System.Web.HttpContext.Current.Response)
-David
Apparently I can't attach the PDF! When I click the "Add/Update" button I get "500 - Internal server error." Nice!