Printing with web technologies
In the publishing field, we can observe today
a convergence between web and print technologies.
The World Wide Web is a document publishing system
rooted in the Internet.
It allows you to consult, with a browser, public pages on websites
linked together by hyperlinks.
The Web relies on two primary languages.
Firstly, HTML,
is a hypertext markup language employing specific tags
to denote the semantic attributes of text and elements.
Secondly, CSS, or Cascading Style Sheets,
is a language for the graphical presentation of these elements.
CSS is used to describe colors, text size and fonts
or the layout of elements on the screen.
This approach facilitates the adaptation of web page graphic compositions
based on the viewing device,
particularly the width of the user's browser window
To do this, we use media queries,
which specify CSS rules according to display conditions.
One of this query, "@media print" is primarily dedicated to paginated rendering for printing.
The CSS rules within this media query
apply when the browser's printing options are utilized.
All these languages, rules and conventions
are defined by W3C, the standards organization
responsible for maintaining web technologies.
Among all CSS properties,
the W3C has also considered various properties dedicated to printed page layout,
such as page numbering, page breaks
or the layout of elements based on the page size.
However, as of now, web browsers do not interpret these lines of code.
To address this limitation, Paged.js was developed.
Paged.js is a free, open-source JavaScript library
that enables the utilization of CSS functionality for printing.
When the Paged.js script is added into HTML and CSS code,
the CSS rules created by graphic designers for print
are transformed into code readable by browsers.
Subsequently, the content flow is composed into pages in the desired format.
Paged.js allows for the design of printed books
using web technologies.