public static void Run() { // ExStart:FigureOutTableBreak // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles(); // Instantiate an object PDF class Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); // Add the section to PDF document sections collection Aspose.Pdf.Generator.Section section = pdf.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); table1.Margin.Top = 300; // Add the table in paragraphs collection of the desired section section.Paragraphs.Add(table1); // Set with column widths of the table table1.ColumnWidths = "100 100 100"; // Set default cell border using BorderInfo object table1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object table1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object table1.DefaultCellPadding = margin; // If you increase the counter to 17, table will break // Because it cannot be accommodated any more over this page for (int RowCounter = 0; RowCounter <= 16; RowCounter++) { // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = table1.Rows.Add(); row1.Cells.Add("col " + RowCounter.ToString() + ", 1"); row1.Cells.Add("col " + RowCounter.ToString() + ", 2"); row1.Cells.Add("col " + RowCounter.ToString() + ", 3"); } // Get the Page Height information float PageHeight = pdf.PageSetup.PageHeight; // Get the total height information of Page Top & Bottom margin, table Top margin and table height. float TotalObjectsHeight = section.PageInfo.Margin.Top + section.PageInfo.Margin.Bottom + table1.Margin.Top + table1.GetHeight(pdf); // Display Page Height, Table Height, table Top margin and Page Top and Bottom margin information Console.WriteLine("PDF document Height = " + pdf.PageSetup.PageHeight.ToString() + "\nTop Margin Info = " + section.PageInfo.Margin.Top.ToString() + "\nBottom Margin Info = " + section.PageInfo.Margin.Bottom.ToString() + "\n\nTable-Top Margin Info = " + table1.Margin.Top.ToString() + "\nAverage Row Height = " + table1.Rows[0].GetHeight(pdf).ToString() + " \nTable height " + table1.GetHeight(pdf).ToString() + "\n ----------------------------------------" + "\nTotal Page Height =" + PageHeight.ToString() + "\nCummulative height including Table =" + TotalObjectsHeight.ToString()); // Check if we deduct the sume of Page top margin + Page Bottom margin + Table Top margin and table height from Page height and its less // Than 10 (an average row can be greater than 10) if ((PageHeight - TotalObjectsHeight) <= 10) { // If the value is less than 10, then display the message. // Which shows that another row can not be placed and if we add new // Row, table will break. It depends upon the row height value. Console.WriteLine("Page Height - Objects Height < 10, so table will break"); } // Save the pdf document pdf.Save(dataDir + "FigureOutTableBreak_out.pdf"); // ExEnd:FigureOutTableBreak }
public static void Run() { // ExStart:NonEnglishText // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Tables(); // Instantiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(tab1); // Set with column widths of the table tab1.ColumnWidths = "110 120 50"; // Set default cell border using BorderInfo object tab1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object tab1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object tab1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = tab1.Rows.Add(); row1.DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("Arabic Sample مَرْحَبا بكِ كُلَّ الْتَرْحيبْ"); row1.Cells[0].DefaultCellTextInfo.IsRightToLeft = true; // Row1.Cells[0].DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("Persian alphabet الفبای فارسی"); row1.Cells[1].DefaultCellTextInfo.IsRightToLeft = true; // Row1.Cells[1].DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("English Text"); // Include the subset of Font supporting Non-English text in PDF file pdf1.SetUnicode(); // Save the Pdf pdf1.Save(dataDir + "Arabic_Farsi_Text_in_TableCell_out.pdf"); // ExEnd:NonEnglishText }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Tables(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(tab1); // ExStart:TableRowRepeat tab1.IsFirstRowRepeated = true; // ExEnd:TableRowRepeat // ExStart:TableIsBroken tab1.IsBroken = false; // ExEnd:TableIsBroken // Set with column widths of the table tab1.ColumnWidths = "50 50 50"; // Set default cell border using BorderInfo object tab1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object tab1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object tab1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = tab1.Rows.Add(); row1.Cells.Add("col1"); row1.Cells.Add("col2"); row1.Cells.Add("col3"); Aspose.Pdf.Generator.Row row2 = tab1.Rows.Add(); row2.Cells.Add("item1"); row2.Cells.Add("item2"); row2.Cells.Add("item3"); // Save the Pdf pdf1.Save(dataDir + "TableAndRowSplitting_out.pdf"); }
public static void Run() { // ExStart:FigureOutTableBreak // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles(); // Instantiate an object PDF class Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); // Add the section to PDF document sections collection Aspose.Pdf.Generator.Section section = pdf.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); table1.Margin.Top = 300; // Add the table in paragraphs collection of the desired section section.Paragraphs.Add(table1); // Set with column widths of the table table1.ColumnWidths = "100 100 100"; // Set default cell border using BorderInfo object table1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object table1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object table1.DefaultCellPadding = margin; // If you increase the counter to 17, table will break // Because it cannot be accommodated any more over this page for (int RowCounter = 0; RowCounter <= 16; RowCounter++) { // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = table1.Rows.Add(); row1.Cells.Add("col " + RowCounter.ToString() + ", 1"); row1.Cells.Add("col " + RowCounter.ToString() + ", 2"); row1.Cells.Add("col " + RowCounter.ToString() + ", 3"); } // Get the Page Height information float PageHeight = pdf.PageSetup.PageHeight; // Get the total height information of Page Top & Bottom margin, table Top margin and table height. float TotalObjectsHeight = section.PageInfo.Margin.Top + section.PageInfo.Margin.Bottom + table1.Margin.Top + table1.GetHeight(pdf); // Display Page Height, Table Height, table Top margin and Page Top and Bottom margin information Console.WriteLine("PDF document Height = " + pdf.PageSetup.PageHeight.ToString() + "\nTop Margin Info = " + section.PageInfo.Margin.Top.ToString() + "\nBottom Margin Info = " + section.PageInfo.Margin.Bottom.ToString() + "\n\nTable-Top Margin Info = " + table1.Margin.Top.ToString() + "\nAverage Row Height = " + table1.Rows[0].GetHeight(pdf).ToString() + " \nTable height " + table1.GetHeight(pdf).ToString() + "\n ----------------------------------------" + "\nTotal Page Height =" + PageHeight.ToString() + "\nCummulative height including Table =" + TotalObjectsHeight.ToString()); // Check if we deduct the sume of Page top margin + Page Bottom margin + Table Top margin and table height from Page height and its less // Than 10 (an average row can be greater than 10) if ((PageHeight - TotalObjectsHeight) <= 10) // If the value is less than 10, then display the message. // Which shows that another row can not be placed and if we add new // Row, table will break. It depends upon the row height value. Console.WriteLine("Page Height - Objects Height < 10, so table will break"); // Save the pdf document pdf.Save(dataDir + "FigureOutTableBreak_out.pdf"); // ExEnd:FigureOutTableBreak }
public static void Run() { // ExStart:NonEnglishText // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Tables(); // Instantiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(tab1); // Set with column widths of the table tab1.ColumnWidths = "110 120 50"; // Set default cell border using BorderInfo object tab1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object tab1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object tab1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = tab1.Rows.Add(); row1.DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("Arabic Sample مَرْحَبا بكِ كُلَّ الْتَرْحيبْ"); row1.Cells[0].DefaultCellTextInfo.IsRightToLeft = true; // Row1.Cells[0].DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("Persian alphabet الفبای فارسی"); row1.Cells[1].DefaultCellTextInfo.IsRightToLeft = true; // Row1.Cells[1].DefaultCellTextInfo.FontName = "Arial Unicode MS"; row1.Cells.Add("English Text"); // Include the subset of Font supporting Non-English text in PDF file pdf1.SetUnicode(); // Save the Pdf pdf1.Save(dataDir + "Arabic_Farsi_Text_in_TableCell_out.pdf"); // ExEnd:NonEnglishText }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Tables(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(tab1); //ExStart:TableRowRepeat tab1.IsFirstRowRepeated = true; //ExEnd:TableRowRepeat //ExStart:TableIsBroken tab1.IsBroken = false; //ExEnd:TableIsBroken // Set with column widths of the table tab1.ColumnWidths = "50 50 50"; // Set default cell border using BorderInfo object tab1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F); // Set table border using another customized BorderInfo object tab1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F); // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object tab1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = tab1.Rows.Add(); row1.Cells.Add("col1"); row1.Cells.Add("col2"); row1.Cells.Add("col3"); Aspose.Pdf.Generator.Row row2 = tab1.Rows.Add(); row2.Cells.Add("item1"); row2.Cells.Add("item2"); row2.Cells.Add("item3"); // Save the Pdf pdf1.Save(dataDir + "TableAndRowSplitting_out_.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Sections(); // Instantiate a PDF Object Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); // Add a section into the pdf document Aspose.Pdf.Generator.Section section1 = pdf.Sections.Add(); // ExStart:SetPageMargin // Instantiate the MarginInfo instance Aspose.Pdf.Generator.MarginInfo marginInfo = new Aspose.Pdf.Generator.MarginInfo(); // Set the margin Top. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Top = 72; // Set the margin Bottom. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Bottom = 72; // Set the margin Left. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Left = 90; // Set the margin Right. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Right = 90; // Assign the marginInfo instance to Margin property of sec1.PageInfo section1.PageInfo.Margin = marginInfo; // ExEnd:SetPageMargin dataDir = dataDir + "SetPageMargin_out.pdf"; // Save Pdf Document pdf.Save(dataDir); Console.WriteLine("\nPage margin setup successfully.\nFile saved at " + dataDir); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Sections(); // Instantiate a PDF Object Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); // Add a section into the pdf document Aspose.Pdf.Generator.Section section1 = pdf.Sections.Add(); // ExStart:SetPageMargin // Instantiate the MarginInfo instance Aspose.Pdf.Generator.MarginInfo marginInfo = new Aspose.Pdf.Generator.MarginInfo(); // Set the margin Top. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Top = 72; // Set the margin Bottom. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Bottom = 72; // Set the margin Left. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Left = 90; // Set the margin Right. This value is in points but other units like // Inches and centi meters can also be used as 12inch or 12cm marginInfo.Right = 90; // Assign the marginInfo instance to Margin property of sec1.PageInfo section1.PageInfo.Margin = marginInfo; // ExEnd:SetPageMargin dataDir = dataDir + "SetPageMargin_out.pdf"; // Save Pdf Document pdf.Save(dataDir); Console.WriteLine("\nPage margin setup successfully.\nFile saved at " + dataDir); }
public static void Run() { // ExStart:PlacingTextAroundImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles(); // Instantiate Pdf document object Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create a section in the Pdf Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(table1); // Set with column widths of the table table1.ColumnWidths = "120 270"; // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object table1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = table1.Rows.Add(); // Create an image object Aspose.Pdf.Generator.Image logo = new Aspose.Pdf.Generator.Image(); // Specify the image file path logo.ImageInfo.File = dataDir + "aspose-logo.jpg"; // Specify the image Fixed Height logo.ImageInfo.FixHeight = 120; // Specify the image Fixed Width logo.ImageInfo.FixWidth = 110; row1.Cells.Add(); // Add the image to paragraphs collection of the table cell row1.Cells[0].Paragraphs.Add(logo); // Create string variables with text containing html tags string TitleString = "<font face=\"Arial\" size=6 color=\"#101090\"><b> Aspose.Pdf for .NET</b></font>"; // Create a text object to be added to the right of image Aspose.Pdf.Generator.Text TitleText = new Aspose.Pdf.Generator.Text(TitleString); TitleText.IsHtmlTagSupported = true; row1.Cells.Add(); // Add the text paragraphs containing HTML text to the table cell row1.Cells[1].Paragraphs.Add(TitleText); // Set the vertical alignment of the row contents as Top row1.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Top; string BodyString1 = "<font face=\"Arial\" size=2><br/>Aspose.Pdf for .NET is a non-graphical PDF® document reporting component that enables .NET applications to <b> create PDF documents from scratch </b> without utilizing Adobe Acrobat®. Aspose.Pdf for .NET is very affordably priced and offers a wealth of strong features including: compression, tables, graphs, images, hyperlinks, security and custom fonts. </font>"; // Add a text segment to segments collection of the text object TitleText.Segments.Add(BodyString1); // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row SecondRow = table1.Rows.Add(); SecondRow.Cells.Add(); // Set the row span value for Second row as 2 SecondRow.Cells[0].ColumnsSpan = 2; // Set the vertical alignment of the second row as Top SecondRow.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Top; string SecondRowString = "<font face=\"Arial\" size=2>Aspose.Pdf for .NET supports the creation of PDF files through API and XML or XSL-FO templates. Aspose.Pdf for .NET is very easy to use and is provided with 14 fully featured demos written in both C# and Visual Basic.</font>"; Aspose.Pdf.Generator.Text SecondRowText = new Aspose.Pdf.Generator.Text(SecondRowString); SecondRowText.IsHtmlTagSupported = true; // Add the text paragraphs containing HTML text to the table cell SecondRow.Cells[0].Paragraphs.Add(SecondRowText); // Save the Pdf file pdf1.Save(dataDir + "PlacingTextAroundImage_out.pdf"); // ExEnd:PlacingTextAroundImage }
public static void Run() { // ExStart:PlacingTextAroundImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles(); // Instantiate Pdf document object Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create a section in the Pdf Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Instantiate a table object Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); // Add the table in paragraphs collection of the desired section sec1.Paragraphs.Add(table1); // Set with column widths of the table table1.ColumnWidths = "120 270"; // Create MarginInfo object and set its left, bottom, right and top margins Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.MarginInfo(); margin.Top = 5f; margin.Left = 5f; margin.Right = 5f; margin.Bottom = 5f; // Set the default cell padding to the MarginInfo object table1.DefaultCellPadding = margin; // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row row1 = table1.Rows.Add(); // Create an image object Aspose.Pdf.Generator.Image logo = new Aspose.Pdf.Generator.Image(); // Specify the image file path logo.ImageInfo.File = dataDir + "aspose-logo.jpg"; // Specify the image Fixed Height logo.ImageInfo.FixHeight = 120; // Specify the image Fixed Width logo.ImageInfo.FixWidth = 110; row1.Cells.Add(); // Add the image to paragraphs collection of the table cell row1.Cells[0].Paragraphs.Add(logo); // Create string variables with text containing html tags string TitleString = "<font face=\"Arial\" size=6 color=\"#101090\"><b> Aspose.Pdf for .NET</b></font>"; // Create a text object to be added to the right of image Aspose.Pdf.Generator.Text TitleText = new Aspose.Pdf.Generator.Text(TitleString); TitleText.IsHtmlTagSupported = true; row1.Cells.Add(); // Add the text paragraphs containing HTML text to the table cell row1.Cells[1].Paragraphs.Add(TitleText); // Set the vertical alignment of the row contents as Top row1.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Top; string BodyString1 = "<font face=\"Arial\" size=2><br/>Aspose.Pdf for .NET is a non-graphical PDF® document reporting component that enables .NET applications to <b> create PDF documents from scratch </b> without utilizing Adobe Acrobat®. Aspose.Pdf for .NET is very affordably priced and offers a wealth of strong features including: compression, tables, graphs, images, hyperlinks, security and custom fonts. </font>"; // Add a text segment to segments collection of the text object TitleText.Segments.Add(BodyString1); // Create rows in the table and then cells in the rows Aspose.Pdf.Generator.Row SecondRow = table1.Rows.Add(); SecondRow.Cells.Add(); // Set the row span value for Second row as 2 SecondRow.Cells[0].ColumnsSpan = 2; // Set the vertical alignment of the second row as Top SecondRow.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Top; string SecondRowString = "<font face=\"Arial\" size=2>Aspose.Pdf for .NET supports the creation of PDF files through API and XML or XSL-FO templates. Aspose.Pdf for .NET is very easy to use and is provided with 14 fully featured demos written in both C# and Visual Basic.</font>"; Aspose.Pdf.Generator.Text SecondRowText = new Aspose.Pdf.Generator.Text(SecondRowString); SecondRowText.IsHtmlTagSupported = true; // Add the text paragraphs containing HTML text to the table cell SecondRow.Cells[0].Paragraphs.Add(SecondRowText); // Save the Pdf file pdf1.Save(dataDir + "PlacingTextAroundImage_out.pdf"); // ExEnd:PlacingTextAroundImage }