Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 653

iTextSharp Header is merging with document content

$
0
0

I need is header table on all pages and page content/table which will be different every page. I am using PdfPageEventHelper for header. I have below code in OnOpenDocument

 header.WriteSelectedRows(0, -1, document.Left+20, writer.PageSize.GetTop(document.TopMargin + 10), writer.DirectContent); 

In Main I have

 Rectangle r = new Rectangle(PageSize.A4); Document doc = new Document(r); doc.SetMargins(15f, 15f, 35f, 35f); PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(file_name, FileMode.Create)); writer.PageEvent = new PDFHeaderAndFooter(this._configuration, companyViewModel, doctorDetails); doc.Open();

and after this my page table is adding as below

 document.add(table). 

But this is overlapping with my header table. What could be the reason?


Viewing all articles
Browse latest Browse all 653

Trending Articles