RobertWeinmeister / dokuwiki-mermaid

A plugin for DokuWiki to support Mermaid.
GNU General Public License v2.0
3 stars 0 forks source link

Diagrams don't print on export to pdf using dw2pdf plugin #25

Open macin opened 2 months ago

macin commented 2 months ago

Description We are using dw2pdf plugin for exporting content to pdf. We started using the mermaid plugin for the diagrams and ufortunately they don't appear on the resulting pdf. Is this something that could be fixed?

Mermaid code

<mermaid>
stateDiagram-v2
state "Request upgrade package" as rupgrade
state "Make sure that\nDEV is similar to PROD" as devrebase
state "Perform Export of the model\nand system configuration packages\nsave them for later" as devexport
state "Perform upgrade on DEV" as devupgrade
state "Correct the errors in configurations on DEV" as devcorrect
state "Do UAT on DEV" as devapps
state "Generate new app.state and configuration\nmover packages for upgraded environment" as scm
state if_devupgrade <<choice>>
state if_devupgrade_uat <<choice>>
state if_model_ok <<choice>>
[*] --> rupgrade
rupgrade --> devrebase
devrebase --> devexport
devexport --> if_model_ok
if_model_ok --> devcorrect: Model CANNOT be exported
if_model_ok --> devupgrade: Model exported OK
devupgrade --> if_devupgrade
if_devupgrade --> devcorrect: Upgrade was not succesfull
if_devupgrade --> devapps: Upgrade was successfull
devcorrect --> devexport
devapps --> if_devupgrade_uat
if_devupgrade_uat --> devcorrect: UATs BAD
if_devupgrade_uat --> scm: UATs OK
</mermaid>

Actual behaviour On the page it displays perfectly fine. On pdf its an unconverted mermaid script. Expected behaviour I`d like it to be visible in pdf file

Versions DokuWiki: Kaos-6a Plugin: dw2pdf 2024-02-15 Mermaid: 2024-02-15

RobertWeinmeister commented 2 months ago

Unfortunately, this is no bug. The diagrams are rendered client-side. It is a limitation of dw2pdf, as it renders server-side. Compare this with a page you try to print, which works.

Nonetheless, it would be useful to allow mermaid diagrams to be properly handled by dw2pdf. I will have look if there is some way to incorporate this.

RobertWeinmeister commented 2 weeks ago

Diagrams can now be embedded as SVGs in the wiki page. They are then included by dw2pdf. Unfortunately, they are not rendered properly there. I need to look into this before this feature works properly.