marc0l92 / joplin-plugin-plantUML

Render PlantUML diagram inside your Joplin notes.
MIT License
47 stars 8 forks source link

PDF export displays "Rendering plantuml diagram..." #2

Closed jonas-klein closed 2 years ago

jonas-klein commented 2 years ago

When i export my Joplin notebook, containing PlantUML diagrams, to PDF, the exported PDF shows "Rendering plantuml diagram...". The Notebook displays the UML diagram correctly in its view. I used the following graph for testing the export, i don't tried other UML types.

```plantuml
@startuml
graph foo {
    A, B, C, D, E [shape=circle]
    rankdir=LR
  E -- {B D}
  A -- {D E}
  B -- D
  C -- {B E}
}
@enduml
```

Environment

Joplin version: 2.4.12 Platform: Windows OS specifics: Windows 10 Enterprise, Version 21H1, Build 19043.1237

Steps to reproduce

  1. Install the PlantUML-Plugin v1.4.1 (Tools>>Options>>Plugins>>Search for PlantUML>>Install>>Restart now)
  2. Create a note and insert the abovementioned code
  3. Export the Note to a PDF-file (File>>Export All>>PDF>>Save)

What i've expected

The diagram should be exported to the PDF-file.

edit1: declared plugin version

marc0l92 commented 2 years ago

That is a limitation of the current design. It is not possible to read the settings from a markdown-it plugin, so I have to render the diagram using a javascript call to joplin to get the settings.

With this design you are able to set in the settings the format and rendering server. On the other hand, the WYSIWYG and the pdf are not working.

I will try to cache the diagram URL in the markdown-it so that it works with the PDF export... even if I don't really know how to do it now.

... I will try to find a soution.

Thanks for your feedback

marc0l92 commented 2 years ago

Please, try to update the plugin to v1.5.0 and let me know if you are now able to export in PDF with the diagrams pictures.

jahoyne commented 2 years ago

All good here with version 1.5.1. Diagrams show fine in exported PDF. 👍

Joplin 2.5.8 (prod, linux) appimage.

jonas-klein commented 2 years ago

yep, works like expected 👍 Thanks! works with Plugin v1.5.1 in Joplin v2.4.12(prod, win32) and v2.5.8(prod, win23)

marc0l92 commented 2 years ago

Thanks for your feedbacks

zzFluke commented 2 years ago

Unfortunately it doesn't work for me on MacOs BigSur 11.6 (20G165) Joplin 2.5.10 (prod, darwin) PlantUML2 v1.5.1

Exported PDF looks like this

image

marc0l92 commented 2 years ago

Thanks for letting me know,

unfortunatelly this fix uses some operating system dependent function and I was not able to test it on a mac.

I will try to find a mac to che why it is not working, otherwise I may need your help to debug this issue.

marc0l92 commented 2 years ago

I tested on Mac the plugin and it works.

Schermata 2021-11-07 alle 11 28 34 Schermata 2021-11-07 alle 11 27 15 Schermata 2021-11-07 alle 11 27 57

Since is not possible to execute the plugin Javascript while exporting the PDF, the plugin stores on disk a cache of the diagram that will be then used while creating the PDF. The cache is deleted every time Joplin starts. The cache is created when you open the note for the first time. The cache is located in $TMPDIR/joplin-plantUml2-plugin

Try to follow those steps:

Let me know if you manage to find what is not working.