Expand my Community achievements bar.

SOLVED

AEM Native PDF Page Numbers in Appendices

Avatar

Level 4

Hello!

 

I've been working on a bookmap template and the chapter content is looking good, but when I came across my first appendix I noticed that the footers weren't in the output. I think that makes sense since it isn't technically a <chapter> anymore.

 

I created a page layout (with the footer) and an associated outputclass. I applied it and the output started showing the footer, but it appears to be breaking pages on headers (despite selecting avoiding breaks).

 

What is the best way to get page numbers on appendices without breaking pages?

 

Thanks in advance!

Josh

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Josh,

 

Could you please confirm if 'appendix' page layout was added to class appendix-content (and not to class appendix).

If yes, please also share the page layout you are using for appendix.

 

-Tulika

View solution in original post

8 Replies

Avatar

Employee

Can you try setting the page layout for the Back Matter? If this doesn't work then set the page layout for Common pages.

Avatar

Level 4

Thanks for getting back to me!

 

Unfortunately, this did not add page numbers to the appendices. Any other things I can try?

 

Thanks!

Josh

Avatar

Employee

Hi Josh,

 

Try the following

  • Create a page layout called "appendix"
  • Add the following css to the content.css file in the template

    .appendix-content {

      page: appendix;

    }

  • Save and generate the PDF

Do let us know how it goes.

Thanks,

Vivek

Avatar

Level 4

Thanks again for the response!

 

I feel like that should have worked, but unfortunately that didn't do the trick.

I'd appreciate any other ideas you may have!

 

Thanks again!

Josh

Avatar

Employee

Hi Josh,

 

In addition to the following steps, please ensure following properties are set for the template being used for generating pdf-

a. Page layout 'appendix' has content.css (css to which below mentioned css is added) added under Stylesheets page property.

b. Content.css has appendix page layout entered under Pagination setting. 

 

Please let me know if this works for you.

 

Thanks,

Tulika

 

Avatar

Level 4

Hi, Tulika!

Thanks for your clarification!

 

I had tried something similar before, but I couldn't stop the page breaks.

 

By doing your step b above, the appendix heading pages are now getting footers but it appears as though the pages break after each h1.appendix:

joshm19816095_1-1720727320185.png

The next page has the subtopics on it, but no footer.

The footer does not appear again until another h1.appendix.

 

What should I try next? Is there any way to stop the page breaks? I have tried telling all headings to avoid breaking after, but it didn't seem to matter.

 

Thanks for your help!

Josh

 

Avatar

Correct answer by
Employee

Hi Josh,

 

Could you please confirm if 'appendix' page layout was added to class appendix-content (and not to class appendix).

If yes, please also share the page layout you are using for appendix.

 

-Tulika

Avatar

Level 4

You are a genius!

 

I hadn't added in the correct appendix-content entry. Once I added that in, removed the appendix page layout from appendix and added it to appendix-content the footers show properly with no spacing.

 

Thanks so much in helping me resolve this issue!! 

Josh