GithubHelp home page GithubHelp logo

alexleach / dompdfrendererbundle Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 116 KB

A Kimai plugin to use Dompdf as PDF renderer (in place of MPdf)

License: MIT License

PHP 33.04% JavaScript 0.15% SCSS 0.70% Twig 65.42% CSS 0.70%
dompdf kimai kimai-bundle kimai-plugin kimai-timetracking pdf-rendering

dompdfrendererbundle's Introduction

DompdfRendererBundle

A Kimai plugin to use Dompdf as PDF renderer (in place of MPdf)

Requirements

  • Requires Kamai 2

Features

  • PDFs created by dompdf
  • Much smaller PDFs
  • Improved support for CSS 2.1 in templates

Status

The bundle is in early stages, but appears to be working well. Not yet tested on release versions of Kimai.

Issues

Page numbering in templates needs to be positioned manually, with x and y co-ordinates, in an inline php script, due to how Dompdf counts the total number of pages. See the script at the bottom of the provided default template

Installation

First unzip the plugin into to your Kimai plugins directory:

unzip DompdfRendererBundle-x.x.zip -d <kimai path>/var/plugins/

And then reload Kimai:

bin/console kimai:reload

DompdfRendererBundle has one dependency (i.e. dompdf), which I thought should be installed automatically with the above command, but for some reason dompdf wasn't installing automatically for me. So, while in the top level folder, run the following command to install dompdf:

composer require dompdf/dompdf

The plugin should appear, and will now be used as the PDF renderer instead of MPdf.

To disable the dompdf backend, either:-

  • Edit Resources/config/dompdf_config.yaml, changing the renderer value to mpdf (or anything other than dompdf)
  • Set the environment variable KIMAI_PDF_RENDERER to something (anything other than dompdf).

Then, reload Kimai again:

bin/console kimai:reload

Templates

New twig templates can be added to /Resources/invoices. An example is provided, based on Kimai's default template.

dompdfrendererbundle's People

Contributors

alexleach avatar

Stargazers

 avatar

Watchers

 avatar

dompdfrendererbundle's Issues

Dependencies not automatically installed

When running ./bin/console kimai:reload, I'd expect the dependency required in this plugin's composer.json to be automatically installed. Well, I'd expect some command to install the plugin's dependency, but can't figure out an easy command to do so.

Therefore, the current recommendation is to explicitly enter the command composer require dompdf/dompdf, which doesn't seem right. It also then modifies the top-level composer.json file...

How should a Kimai / Symfony plugin's dependencies actually be installed?

Love it!

Can you tag the repository please, so it can be found easier.

You can add them in the "About this repository" scree, where you already added the description.

Now If you could select some tags (Topics), that would make it much easier for others to find it:

Bildschirm­foto 2023-03-04 um 16 12 33

I link these topics e.g. from the Kimai Marketplace. Thanks for sharing your plugin 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.