Is there a way to intercept the PDF rendering?
Posted by mattwynne on Nov 07, 2018; 4:27pm
URL: https://discuss.asciidoctor.org/Is-there-a-way-to-intercept-the-PDF-rendering-tp6583.html
Hello,
I am trying to produce two copies of a training course workbook: One for delegates and one for the trainer. The trainer one should have additional "secret sauce" notes in it, but I want the page numbers to be consistent across both.
My plan is to add some padding in to the delegate workbook - "this page intentionally left blank" or "write your own notes here" to keep the page numbers the same in both copies. I'll use `ifdef` conditionals to render one or the other.
What I'd like to do is add some kind of check to the CI build for the book so that if this padding, which will have to be done by hand, isn't right, the build will fail. I'd basically like to be able to compare the ToC from each copy and check that the main headings are on the same pages in both workbooks.
Is there a place I can hook into the PDF rendering cycle to do this? Or do I need to write something to read the PDF again afterwards, outside of asciidoctor?