dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

ImageProcesseror Loading

Open splitbrain opened this issue 1 month ago • 0 comments

We use our own ImageProcessor

In the past we passed it as a config value to MPDF:

https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/blob/5da2fd39d25f9489291fdfeb61686f4613d5cbaa/DokuPDF.class.php#L55-L62

Unfortunately this seems no longer be supported in MPDF (I'm not sure if this was ever supported or if we monkey patched our MPDF version).

The proper way would be to pass a custom $container to the constructor which would then be used by the internal ServiceFactory to load our class.

Unfortunately it seems the ImageDecorator is not loaded through that Factory.

So going forward I see two options:

  1. Monkey patch our MPDF library in the vendor directory (probably using a simple setImageDecorator() method)
  2. Use reflection to set the private property in our sub class

The second method would probably more future proof as there would be no need to reapply the patch on updates.

Any opinions?

PS: I will also open an issue upstream.

splitbrain avatar Nov 24 '25 14:11 splitbrain