chromic_pdf v0.5.0 Release Notes

Release Date: 2020-07-10 // almost 4 years ago
  • ๐Ÿ”„ Changed

    • โœ‚ Removed the :width and :height options from Template.styles/1 and Template.source_and_options/1 as it turns out that Chrome does not pay attention to @page dimensions and instead still sets the size of the produced PDF to US letter. Since it does not seem possible to the PDF size in Chrome headless besides using the paperWidth and paperHeight options, moved to a :size option instead that accepts names like :a4, :us_letter, and tuples of {<width>, <height>} in inches. These are then passed to paperWidth and paperHeight.
    • Ditched the preferCssPageSize option from Template.source_and_options/1 as it did not seem to have any effect. See above.

    โž• Added

    • โž• Added zoom: 0.75 to both #header and #footer in the template as this seems to be exactly what is needed to reverse the viewport scaling that Chrome uses on them by default. With this, headers & footers and the content can use the same CSS styles.
    • ๐Ÿ–จ Included -webkit-print-color-adjust: exact rule to template so background-color rules are enabled by default.

    ๐Ÿ›  Fixed

    • Make print_to_pdfa/2 actually accept source_and_options() map from Template.