I have added a .png file…
I want to the same thing using aspose pdf .
How to do this…
Hi Som,
Hi,
These are not the hardcoded values.(3,0,0,3).
I have to get these values from c# and show these values as upper diagram in the top of pdf…
Hi Som,
Document doc = new
Document(myDir + “HelloWorld.pdf”);<o:p></o:p>
Aspose.Pdf.HeaderFooter header = new Aspose.Pdf.HeaderFooter();
header.Margin.Top = 20;
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
//table.ColumnAdjustment = ColumnAdjustment.AutoFitToContent;
//table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Box, 0.5F);
//table.DefaultCellPadding = new Aspose.Pdf.MarginInfo() { Left = 2, Top = 2, Bottom = 2, Right = 2 };
table.ColumnWidths = "25 25 25 25";
Aspose.Pdf.Row row = table.Rows.Add();
Aspose.Pdf.Cell cell= new Aspose.Pdf.Cell();
cell.DefaultCellTextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
cell = row.Cells.Add("3", new TextState() { HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center });
cell.BackgroundColor = Aspose.Pdf.Color.Gray;
cell = row.Cells.Add("0", new TextState() { HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center });
cell.BackgroundColor = Aspose.Pdf.Color.Green;
cell = row.Cells.Add("0", new TextState() { HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center });
cell.BackgroundColor = Aspose.Pdf.Color.Red;
cell = row.Cells.Add("3", new TextState() { HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center });
cell.BackgroundColor = Aspose.Pdf.Color.LightGray;
header.Paragraphs.Add(table);
for (int cnt = 1; cnt <= doc.Pages.Count; cnt++)
{
doc.Pages[cnt].Header = header;
}
doc.Save(myDir + "Output_DOMheaderfooter.pdf");
Please feel free to contact us for any further assistance.
Best Regards,