Hi
cshanmugasundaram:
- how to create exact table format
Hi,
Thanks for contacting support.
Please follow the instructions specified over Add Table in Existing PDF Document.
cshanmugasundaram:
- how to use superscript number
In order to render SuperScript text, please try using HTML text inside table cell.
cshanmugasundaram:
- how to display TM like in image
Please use HTML text and place it inside table cell.
[C#]
// Load source PDF document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
doc.Pages.Add();
// Initializes a new instance of the Table
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
// Set the table border color as LightGray
table.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
// Set the border for table cells
table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
HtmlFragment titel = new HtmlFragment("CyflufenamidTM");
// Create a loop to add 10 rows
for (int row_count = 1; row_count < 10; row_count++)
{
// Add row to table
Aspose.Pdf.Row row = table.Rows.Add();
// Add table cells
row.Cells.Add();
row.Cells[0].Paragraphs.Add(titel);
row.Cells[0].BackgroundColor = Aspose.Pdf.Color.Green;
row.Cells.Add("Column (" + row_count + ", 2)");
row.Cells.Add("Column (" + row_count + ", 3)");
}
// Add table object to the first page of the input document
doc.Pages[1].Paragraphs.Add(table);
// Save the updated document containing the table object
doc.Save("c:/pdftest/TableOutput.pdf");
cshanmugasundaram:
4. how to use same font and size, i am using font, but problem in font repository
You may consider either using HTML text where you can specify font name if you do not want to use FontRepository.
cshanmugasundaram:
5. you see the appendix information, user entered just information without line break, how to achieve this onep
The information entered inside table cell is autowrapped to next lines. All you have to do is to specify certain width for cells representing Appendix and in order to represent Appendix, you can have a separate table.
cshanmugasundaram:
6. how to set background color for appendix information
Please try using following code line row.Cells[0].BackgroundColor = Aspose.Pdf.Color.Gray;
In case you have any further query, please feel free to contact.
Hi, thanks for your reply.
Hi There,
Thanks for your inquiry. Please note that the font you want to embed while creating the PDF document, must be installed on the host machine.
Moreover, You can adjust the width of table columns according to page size. This way you can have more columns inside a single page.
“in column they are using something like TM and 1, how to create that 1?”
You can use HTML string to specify that formatting into table cell. Please check the following code snippet.
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
doc.Pages.Add();
// Initializes a new instance of the Table
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
// Set the table border color as LightGray
table.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
// Set the border for table cells
table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
HtmlFragment titel = new HtmlFragment("CyflufenamidTM 1");
// Create a loop to add 10 rows
for (int row_count = 1; row_count < 10; row_count++)
{
// Add row to table
Aspose.Pdf.Row row = table.Rows.Add();
// Add table cells
row.Cells.Add();
row.Cells[0].Paragraphs.Add(titel);
row.Cells[0].BackgroundColor = Aspose.Pdf.Color.Green;
row.Cells.Add("Column (" + row_count + ", 2)");
row.Cells.Add("Column (" + row_count + ", 3)");
}
table.ColumnAdjustment = ColumnAdjustment.AutoFitToWindow;
// Add table object to the first page of the input document
doc.Pages[1].Paragraphs.Add(table);
// Save the updated document containing the table object
doc.Save("TableOutput.pdf");
In case of any further assistance please feel free to contact us.
Best Regards,