Difference between revisions of "Research/Web-to-print/WeasyPrint"

From Publication Station
(wrote options)
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Print in hybrid publishing workflows=
<slidy theme="a" />
Print products = bottleneck in hybrid publishing workflows
 
==Print in hybrid publishing workflows==
'''Print products = bottleneck in hybrid publishing workflows'''


Screens in pages represent different paradigms
Screens in pages represent different paradigms
Line 6: Line 8:
* Page: a fixed space
* Page: a fixed space


The translation of layouts for screen to page layouts, within  is '''not trivial'''.  
The translation of layouts for screen to page layouts, within  is '''not trivial'''.


=HTML-to-print Tools=
==HTML-to-print Tools==
* LaTex
* Browser built-in PDF rendering
* Desktop publishing software
* Weasy Print.


==LaTex==
==LaTex==
Line 17: Line 23:
* Pandoc converts seamlessly to LaTex.
* Pandoc converts seamlessly to LaTex.
* Supports page numbers, hyphenation, bibliography, references, hyperlinks, etc, etc...
* Supports page numbers, hyphenation, bibliography, references, hyperlinks, etc, etc...
* Can produce more experimental and generative outputs. <ref name="lakfon">See works by [http://research.lafkon.net/ Lafkon studio] for an idea of the possibilities.
* Can produce more experimental and generative outputs. <ref name="lakfon">See works by [http://research.lafkon.net/ Lafkon studio] for an idea of the possibilities</ref>.


===negative aspects===
===negative aspects===
Line 37: Line 43:
* works poorly and inconsistently
* works poorly and inconsistently
* requires a lot of trial-and-error to achieve the desired output, with results differing widely across browsers and versions
* requires a lot of trial-and-error to achieve the desired output, with results differing widely across browsers and versions
<s>* difficult to avoid page breaks breaking and hiding content.  
 
: show example  </s>
===OSP===
[http://osp.kitchen/ OSP] is making a lot of efforts in this area.
 
html2print tool (recently developed)
http://lurk.org/groups/80c/messages/topic/4CIuW3jpiAFLwllZN3itFV/


==Desktop publishing software==
==Desktop publishing software==
Line 54: Line 64:
* to keep the content updatable operations (in inDesign) interventions on content are not possible
* to keep the content updatable operations (in inDesign) interventions on content are not possible
* complex structures, like large tables, are difficult to handle, while keeping content updatable (in inDesign)
* complex structures, like large tables, are difficult to handle, while keeping content updatable (in inDesign)




==Weasy Print==
==Weasy Print==
Weasy Print (WP) <ref name="weasyprint1">“WeasyPrint Documentation” http://weasyprint.org/docs/.</ref>
[[Weasy_Print]] (WP)<ref name="weasyprint1">“WeasyPrint Documentation” http://weasyprint.org/docs/.</ref> is a visual rendering engine for HTML to PDF, that uses CSS.  
is a visual rendering engine for HTML and CSS that can export to PDF.
 
Its CSS layout engine is written in Python, but employs several libraries.


Its CSS layout engine is written in Python, but employs several libraries to render the PDF.


===positive aspects===
===positive aspects===
* Uses HTML and CSS to layout the PDF
* Uses HTML and CSS to layout the PDF
* Supports features like page size, page numbering, hyphenation in several languages <ref name="hyp">With the [http://pyphen.org/ pyphen library])</re>
* Supports features like page size, page numbering, hyphenation in several languages<ref name="hyp">With the [http://pyphen.org/ pyphen library]</ref>
* Resulting PDFs can achieve high level of complexity, with simple instructions
* Resulting PDFs can achieve high level of complexity, with simple instructions
* Simple and easy to use
* Simple and easy to use
* Can be used as a Python library or as a standalone program
* Can be used as a Python library or as a standalone program
* Free software (BSD license)
* Free software (BSD license)
* Cleal documentation


===negative aspects===
===negative aspects===
* Can be difficult to install, due to its dependencies
* Can be difficult to install, due to its dependencies
* It does not support CSS custom fonts
* It does not support CSS custom fonts - uses [http://www.pango.org/ Pango library] to manage fonts
* No support for folded formats, such as booklets: no mechanism for imposition
* No support for folded formats, such as booklets: no mechanism for imposition




 
[[Category:Research]]
 
----
 
 
=What is Weasy Print=
Weasy Print (WP) is
 
 
 
=Testing Weasy Print=
 
 
=references=
<references/>

Latest revision as of 16:24, 17 April 2016

<slidy theme="a" />

Print in hybrid publishing workflows

Print products = bottleneck in hybrid publishing workflows

Screens in pages represent different paradigms

  • Instead of reflowable text, continuous space, variable screen size
  • Page: a fixed space

The translation of layouts for screen to page layouts, within is not trivial.

HTML-to-print Tools

  • LaTex
  • Browser built-in PDF rendering
  • Desktop publishing software
  • Weasy Print.

LaTex

A type-setting/document preparation language, focused on producing typographicaly correct PDFs.

positive aspects

  • LaTex is a markup language;
  • Pandoc converts seamlessly to LaTex.
  • Supports page numbers, hyphenation, bibliography, references, hyperlinks, etc, etc...
  • Can produce more experimental and generative outputs. [1].

negative aspects

  • Outputs are by default look academic, although this can be changed
  • Use is outmoded
  • Styling is defined by packages imported into the document, which is very different and incompatible with CSS.
  • A difficult tool to work with, let alone to teach.


Browser built-in pdf rendering

Current browsers have built-in pdf rendering engines. By using the browser function «Print to file» and CSS rules for print, print layouts can be created from HTML files.

positive aspects

  • relies on the same set of technologies - HTML, CSS and JS - as other hybrid publishing formats: webpages, ePubs, apps
  • it is simple, easily to teach
  • CSS includes page specific options: @media page rule, and the pseudo-classes :first :left :right @bottom-left

negative aspects

  • works poorly and inconsistently
  • requires a lot of trial-and-error to achieve the desired output, with results differing widely across browsers and versions

OSP

OSP is making a lot of efforts in this area.

html2print tool (recently developed) http://lurk.org/groups/80c/messages/topic/4CIuW3jpiAFLwllZN3itFV/

Desktop publishing software

Software such as Scribus and inDesign can be incorporated into an HP workflow.

Scribus can import HTML files and inDesign ICML(XML)files. Both formats keep their structure when imported and can remain updatable.

positive aspects

  • allows direct feedback between operations and their effects
  • graphic designers are familiar their workflows
  • can produce complex PDFs with impositions, hyphenation, page numbers. etc
  • can intervene in almost all aspects of the document

negative aspects

  • to keep the content updatable operations (in inDesign) interventions on content are not possible
  • complex structures, like large tables, are difficult to handle, while keeping content updatable (in inDesign)



Weasy Print

Weasy_Print (WP)[2] is a visual rendering engine for HTML to PDF, that uses CSS.

Its CSS layout engine is written in Python, but employs several libraries to render the PDF.

positive aspects

  • Uses HTML and CSS to layout the PDF
  • Supports features like page size, page numbering, hyphenation in several languages[3]
  • Resulting PDFs can achieve high level of complexity, with simple instructions
  • Simple and easy to use
  • Can be used as a Python library or as a standalone program
  • Free software (BSD license)
  • Cleal documentation

negative aspects

  • Can be difficult to install, due to its dependencies
  • It does not support CSS custom fonts - uses Pango library to manage fonts
  • No support for folded formats, such as booklets: no mechanism for imposition
  1. See works by Lafkon studio for an idea of the possibilities
  2. “WeasyPrint Documentation” http://weasyprint.org/docs/.
  3. With the pyphen library