- Johannes Wilm(W3C Editing Taskforce Invited Expert)
An interview with myself about the new package Vivliostyle-print
Vivliostyle.js has been with us for a few years already. It can both show paged media in the browser as well as print HTML with extra CSS targeted paged media. What need is there for a Vivliostyle-print then?
A problem with Vivliostyle.js that I have found though has been that it’s a really complex program when it comes to trying to include it in other software and until recently the documentation was not that extensive. Even now in the process of creating this package, I had to spend more than a day with a lot of chatting and trial and error to get it to work.
Why did you decide to start Vivliostyle-print?
I myself have been working on getting it to work with Fidus Writer, the academic text editor I have spent the last few years on. Back in 2012, we had pagination in the editor itself while the user was writing the document, but that was based on the experimental technology “CSS Regions” and when the Chromium team decided to remove those, we have just had a pagination solution that is invoked when the print dialog is invoked. That solution (paginate-for-print) is something I quickly threw together a few years as a replacement. Even though I have been going around promoting Vivliostyle.js, the complexity of it meant that I never had the time to sit down and create a connector for Vivliostyle.js. Now that I did finally find the time, I thought it would be best to share this so others don’t have to spend as much time on doing this.
What kinds of projects would you think could benefit from this?
If you run Vivliostyle.js, doesn’t that mess up the DOM of the page? Will users need to reload the page after printing it?
Vivliostyle-print works slightly differently. It runs Vivliostyle.js in the background (in a hidden iframe) which is removed again once the print dialog has disappeared. That way the original DOM is exactly the same before and after Vivliostyle-print is run.