asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

how to remove page number #1356

Closed mariomuja closed 4 years ago

mariomuja commented 4 years ago

I am creating a letter with asciidoctor-pdf and do not want to see any page numbers in the PDF. How can I remove the default page number from the first page?

mojavelinux commented 4 years ago

You can remove the running content by setting the nofooter attribute.

= Letter
:nofooter:

text

You cannot remove it from only the first page, though.

mariomuja commented 4 years ago

= Letter prints a big text "Letter" on the page - I do not want to add additional space or text on the page. Just remove the page number.

mojavelinux commented 4 years ago

That was just an example. You didn't show me your document, so I could only guess. If you don't have a doctitle, then you'd use:

:nofooter:

text of letter.
mojavelinux commented 4 years ago

You can also disable the running footer using a custom theme.

my-theme.yml

extends: default
footer:
  height: ~

Then run:

asciidoctor-pdf -a pdf-theme=./my-theme.yml letter.adoc

This is all documented in the theming guide. See https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#running-content-header--footer

mariomuja commented 4 years ago

you saved my day - thanks a lot - also in general for your efforts - we can now throw away our expensive report generators and concentrate on creating raw text files :-)

mojavelinux commented 4 years ago

Fantastic! And thanks. I'm really glad to hear it's working out for you. That makes all the efforts worth it.

LIttleAncientForestKami commented 1 year ago

My big thanks for your work on this, Dan and folks.

This comment is just to save others from hours of digging/searching/experimenting, not wishing to reopen or anything. Alternative solution to removing the page numbers BUT KEEPING THE FOOTER is to have a theme with footer being set to one column, have whatever you want in that column (in my case it was a legal clause) and that's it.

Also, if you're looking for a forum to ask user questions, head over to https://chat.asciidoctor.org.