Hi there,
I need to add header on all the pages of existing pdf. I tried following code but the header overlapped the content of the PDF. Is there any way to shrink original content or any other option such that it is not overlapped with header?
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(dataDir + "input.pdf");
foreach (Page page in pdfDocument.Pages)
{
// Create a Header Section of the PDF file
Aspose.Pdf.HeaderFooter header = new Aspose.Pdf.HeaderFooter();
// Set the Header for the PDF file
page.Header = header;
// Set the top margin for the header section
header.Margin.Top = 20;
...
...
...
...
// Instantiate a table object
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
// Save the Pdf file
pdfDocument.Save(dataDir + "sample.pdf");
}
HI @imran.rafique ,
Thanks for your response. As I mentioned initially that PDF can be a scanned document which means content could start right from the top. In that case, any header will cover the content no matter what margin or row height we give.
Is it possible to shrink the content before adding the header so that whole content of the page from original pdf fit between header and footer instead of starting from the top of the page?