Is it possible to remove footers in a pdf document? I have tried using PdfPageEditor, Generator, and Page, yet nothing seems to allow me to identify and remove a footer from a page.
I know that I could try converting it to a word document but would like to try to avoid that if possible as there are issues with tables being displayed correctly. (see: <a href="https://forum.aspose.com/t/22988)
Thanks!
Hi Charles,
[C#]PdfContentEditor contentEditor = new PdfContentEditor();<o:p></o:p>
contentEditor.BindPdf(“file.pdf”);
contentEditor.DeleteStamp(1, new int[] { 2, 3, 5
});contentEditor.Save(“outfile.pdf”);
DeleteStampByIds
[C#]PdfContentEditor contentEditor = new PdfContentEditor();<o:p></o:p>
contentEditor.BindPdf(“file.pdf”);
contentEditor.DeleteStampByIds(1, new int[] { 100, 101
});contentEditor.Save(“outfile.pdf”);
PdfFileStamp pfe = new
PdfFileStamp(TestSettings.GetInputFile(“PdfWithSeveralPages.pdf”),
TestSettings.GetOutputFile(“34634.pdf”));<o:p></o:p>
//100 is stampId for footer
pfe.StampId = 100;
pfe.AddFooter(new FormattedText("Footer"), 10);
//200 is stampId for header
pfe.StampId = 200;
pfe.AddHeader(new FormattedText("Header"), 10);
//300 if stampId for page number
pfe.StampId = 300;
pfe.AddPageNumber(new FormattedText(" Page #", System.Drawing.Color.Red, System.Drawing.Color.Blue));
pfe.Close();
When I try ‘contentEditor.GetStamps(1)’ it returns an empty list. (see attached sample code)
I assume that is because the input file was not build using stamps/stamp ids. Is there still a way for me to edit the footers if they weren’t built with stamps/stamp ids?
Does Aspose support the recognition of headers and footers in PDFs that were not created with Aspose?
I haven’t found a way to modify them in Aspose.PDF and have noticed that they still aren’t recognized when you try to convert a PDF to a word document.
CWilliams-SBS:When I try ‘contentEditor.GetStamps(1)’ it returns an empty list. (see attached sample code)
I assume that is because the input file was not build using stamps/stamp ids. Is there still a way for me to edit the footers if they weren’t built with stamps/stamp ids?
issue as PDFNEWNET-35682 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time. We are sorry
for this inconvenience.
CWilliams-SBS:Does Aspose support the recognition of headers and footers in PDFs that were not created with Aspose?
I haven’t found a way to modify them in Aspose.PDF and have noticed that they still aren’t recognized when you try to convert a PDF to a word document.
The issues you have found earlier (filed as PDFNEWNET-35682) have been fixed in Aspose.Pdf for .NET 8.9.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Charles,
Hi Charles,
Thanks for your patience.
We have further investigated the issue PDFNEWNET-33612 reported earlier and I am afraid we cannot fix this problem. Unfortunately the ordinary pdf format (without tags) doesn’t contain any information that allows to identify text as а header or а footer.
There is no way to determine whether page contains a header or a footer without additional information (like tags -http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf
9.7 Tagged PDF). For example the first line of text can be a part of header or can be a title of page or a simple text. There is no universal solution for solving this problem.
So we need to discuss the possible workarounds for this problem. You should get additional information (like tags) during conversion of pdf documents. We are sorry for this inconvenience.