rgolubtsov / reporter-multilang

A tool to generate human-readable reports based on data from various sources with the focus on its implementation using a series of programming languages.
The Unlicense
3 stars 2 forks source link

SQL-PDF-Vala/Genie: Set report metadata (after upgrading to Cairo 1.16+). #29

Open rgolubtsov opened 7 years ago

rgolubtsov commented 7 years ago

See subj. This belongs to both Vala and Genie implementations: reporter-cli/sql-pdf/vala/src/reporter_controller.vala and reporter-cli/sql-pdf/genie/src/reporter_controller.gs Look at the following block:

        // --- Report metadata ------------------------------------------------
        /*
         * Note: The possibility to inject PDF metadata entries has appeared
         *       in Cairo 1.16, but even in Arch Linux the "cairo" package
         *       currently is just of version 1.14.8. And, of course, its Vala
         *       bindings are in the same state. After upgrading to Cairo 1.16+
         *       appropriate calls should look something like the given below
         *       (commented out for now).
         *
         * See for reference:
         *   - Cairo sources:
         *       https://cgit.freedesktop.org/cairo/tree/src/cairo-pdf.h
         *       https://cgit.freedesktop.org/cairo/tree/src/
         *                                           cairo-pdf-surface.c
         *
         *   - Cairo Valadoc:
         *       https://valadoc.org/cairo/Cairo.PdfSurface.html
         */
//      _report.set_metadata(PdfMetadata.TITLE,    _REPORT_TITLE   );
//      _report.set_metadata(PdfMetadata.AUTHOR,   _REPORT_AUTHOR  );
//      _report.set_metadata(PdfMetadata.SUBJECT,  _REPORT_SUBJECT );
//      _report.set_metadata(PdfMetadata.KEYWORDS, _REPORT_KEYWORDS);
//      _report.set_metadata(PdfMetadata.CREATOR,  _REPORT_CREATOR );

In Arch Linux still there is Cairo 1.14.8 (as of 2017-02-25): https://www.archlinux.org/packages/extra/x86_64/cairo/

rgolubtsov commented 7 years ago

This also belongs to JavaScript implementation: reporter-cli/sql-pdf/js/src/reporter-primary/reporter-controller.js Look at the following block:

        // --- Report metadata ------------------------------------------------
        /*
         * Note: The possibility to inject PDF metadata entries has appeared
         *       in Cairo 1.16, but even in Arch Linux the "cairo" package
         *       currently is just of version 1.14.8. And, of course,
         *       its Node.js bindings are in the same state. After upgrading
         *       to Cairo 1.16+ appropriate calls should look something
         *       like the given below (commented out for now).
         *       (Also note that the "canvas" npm package used
         *       must explicitly implement it.)
         *
         * See for reference:
         *   - Cairo sources:
         *       https://cgit.freedesktop.org/cairo/tree/src/cairo-pdf.h
         *       https://cgit.freedesktop.org/cairo/tree/src/
         *                                           cairo-pdf-surface.c
         *
         *   - canvas at npm:
         *       https://npmjs.com/package/canvas
         */
//      _report.set_metadata(Canvas.TITLE,    _REPORT_TITLE   );
//      _report.set_metadata(Canvas.AUTHOR,   _REPORT_AUTHOR  );
//      _report.set_metadata(Canvas.SUBJECT,  _REPORT_SUBJECT );
//      _report.set_metadata(Canvas.KEYWORDS, _REPORT_KEYWORDS);
//      _report.set_metadata(Canvas.CREATOR,  _REPORT_CREATOR );

In Arch Linux still there is Cairo 1.14.8 (as of 2017-03-13): https://www.archlinux.org/packages/extra/x86_64/cairo/

rgolubtsov commented 5 years ago

In Arch Linux Cairo is already 1.16.0 (as checked on 2019-06-13): https://www.archlinux.org/packages/extra/x86_64/cairo/

But in Ubuntu Xenial it is 1.14.6 and will be that: https://packages.ubuntu.com/xenial/libcairo2 (Travis CI build is configured against Xenial.)