Multiple pages

A book has multiple pages, so has PDF. We will extend the rpnPDFdevice to support multiple pages. PostScript already provides multi page support through the showpage operator. Each time showpage renders the page, initatiates the graphics and starts a new page. However, our main loop must tell all the devices to clean up when we are at the end of the code. But this should happen only on the main loop, not when rpn is called inside the context. rpn will delegate this to context so it does not have to know about the devices.

Javascript Editor

We add functions to the devices to test if it works. For raw, canvas and SVG we add an interval property to device. By default, the frames are shown immediately, but you can delay them by a certain number of microseconds. However, everything is first calculated and then rendered. We will fix that later.

Javascript Editor

And we add now a code for 3 pages and look what happens

Javascript Editor

ps20250127.js 3806 lines 137 KB

My Journey to PostScript