I want to delete header and footer from generated pdf. by using Dynamic PDF dll i'm merginf multiple crystal reports as single pdf but by default header and footer attaching to the created pdf.
Delete Headr and Footer
Re: Delete Headr and Footer
Support · Jun 10, 2014Hello,
It is not possible to remove headers and footers or any contents from the existing PDF documents using our DynamicPDF Merger for .NET product.
If you know the X, Y, width and height of the text which you would like to hide then you can add a Rectangle page element over the text by filling it with the desired color. You can refer to the documentation on Rectangle page element here
. You will need to access the page from MergeDocument object using index and add this Rectangle page element. Below is the code sample for adding rectangle to the existing PDF.
PdfDocument pdf = new PdfDocument(@"C:\Temp\DocumentA.pdf");
MergeDocument document = new MergeDocument();
document.Append(pdf);
//Accessing page from merged document using index.
Page page = document.Pages[0];
//Creating and adding Rectangle to the page by specifying X,Y, width and height.
Rectangle rect = new Rectangle(100, 50, 500, 100);
rect.FillColor = RgbColor.White;
rect.BorderStyle = LineStyle.None;
page.Elements.Add(rect);
document.Draw(@"C:\Temp\MyDocument.pdf");
Thanks,
ceTe Software Support Team.