Login  Register

Re: Is there a way to intercept the PDF rendering?

Posted by mojavelinux on Nov 25, 2018; 7:31pm
URL: https://discuss.asciidoctor.org/Is-there-a-way-to-intercept-the-PDF-rendering-tp6583p6605.html

Asciidoctor PDF is quite complex and intertwined with Prawn, so there's no official way to tap into the lifecycle aside from monkeypatching the converter. You can find a summary of how Matt Raible did this on his blog: https://raibledesigns.com/rd/entry/re_customizing_an_asciidoctor_pdf

If we were to rewrite Asciidoctor PDF as a Prawn view, this might get a bit simpler. See https://github.com/asciidoctor/asciidoctor-pdf/issues/53

Cheers,

-Dan

On Thu, Nov 8, 2018 at 5:25 AM mattwynne [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi Mark,

Yes, I'm using asciidoctor-pdf

Thanks, that's exactly what my plan is. The workbook is under heavy development at the moment, and I'd like to have an automated check that keeps the ToCs consistent between both as we go along.

If there was a way to catch the ToC while it's in a data model, before it's turned into PDF content via prawn, I could say save it off as YAML and diff the two during the build pipeline.

I was just wondering if there was a way to hook into that PDF rendering cycle. I had a bit of a splunk around in the code but couldn't see anywhere obvious.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Is-there-a-way-to-intercept-the-PDF-rendering-tp6583p6585.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux