开发者

How to disable header on frontpage of rst2pdf document?

开发者 https://www.devze.com 2023-01-08 04:50 出处:网络
I am generating some PDF\'s and I would like to disable the header on the frontpage. I know there are built-in templates in rst2pdf and one template is called coverPage but I don\'t seem to be able to

I am generating some PDF's and I would like to disable the header on the frontpage. I know there are built-in templates in rst2pdf and one template is called coverPage but I don't seem to be able to get it to work.

开发者_运维知识库

The manual is saying you should use a

..raw:: pdf  
  PageBreak coverPage

statement but that will insert a empty before the coverpage, so how can I have a coverpage without a header and without using the oddeven directive (I want to use the same header on all remaining pages).

Thanks for your suggestions!


That's how you change the stylesheet after the cover page. You'll need to create a custom stylesheet that specifies what is the format of the first page and then change the style for the rest of document. Have a look at chapter 15 of the manual.


Note: current accepted answer contains broken link (linked website has gone).

The correct answer is simple:

1) In you style-file define:

pageSetup:
  firstTemplate: coverPage

2) Then in your template, when you want to start using header/footer add:

..raw:: pdf
  PageBreak cutePage

Make sure cutePage has set header/footer to true.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号