Headers and Footers added using Aspose.PDF are not recognized as Headers and Footers by PDF Editors

Aspose.Pdf Version : 22.5

Background:

PDF Editors like Acrobat Reader, Nitro, Foxit, pdfDocs, etc allow users to:

  1. Remove/replace headers (and footers) from a pdf page.

  2. Hide headers (and footers) when viewing/printing/exporting.

These features require that they can correctly identify the Header elements within a page. However, when we add headers using Aspose PDF, these applications do not recognize them as a Header.

We tried adding headers using the following classes exposed by Aspose PDF (version 22.5):

  1. HeaderArtifact
  2. TextStamp
  3. PdfFileStamp
  4. HeaderFooter

Findings:

All of these applications depend on an entry in the PieceInfo dictionary within the Form XObject.

Additionally, they also add an entry specifying the Optional Content Group (or Layer) to which these object belongs to. This is needed for Feature 2 (hiding headers and footers when printing/viewing/exporting).

We found that Aspose.PDF does not add these entries when adding Headers and Footers. This causes the authoring apps to treat these as normal content, leading to these features not working.

Queries:

  1. Are there other classes that we can try to get the headers recognized by Authoring Apps?

  2. Does Aspose plan to apply the necessary PDF entries when utilising the mentioned types to insert a Header/Footer, such that the Headers/Footers are recognised?

  3. Does Aspose plan to expose and allow consumers of Aspose.PDF to edit the following:

  4. PieceInfo (pieceinfo (pdflib.com))

  5. Optional Content Group Membership in the form object. (Aspose allows creating OCGs using the Layer class, however its very limited and does not appear to allow us to specify usage or add pageElement entries).

I have attached:

  1. Sample header added using the HeaderArtifact class in Aspose.Pdf for reference.

  2. Sample header added using Acrobat Pro 10.1

References:
Left_header_using_acrobat_pro.pdf (27.2 KB)
Left_header_using_Aspose_header_artifacts.pdf (74.6 KB)

form_contents_when_header_is_added_by_acrobat.png (46.2 KB)
form_contents_when_header_is_added_by_aspose.png (31.2 KB)

I am also referencing a similar case which has been raised: Header & Footer are not getting recognized by Acrobat Reader

C# Code used to generate the attached header footer using Aspose.Pdf

c# code sample.png (46.1 KB)

@dcdeveloper

We are working over your query and will get back to you soon.

@dcdeveloper

A ticket PDFNET-52942 has been logged for your requirement in our issue tracking system. We will inform you once there is an update available on it. We apologize for your inconvenience.