Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for choosing between SVG-based and image-based PDF export per diagram #102

Closed
mflorea opened this issue Jan 8, 2020 · 3 comments · Fixed by #126
Closed

Add support for choosing between SVG-based and image-based PDF export per diagram #102

mflorea opened this issue Jan 8, 2020 · 3 comments · Fixed by #126

Comments

@mflorea
Copy link
Collaborator

@mflorea mflorea commented Jan 8, 2020

We recently dropped image-based PDF diagram export (when exporting a wiki page to PDF) in favor of SVG-based PDF export. While this has improved the PDF export quality in general, there are still some issues coming from the fact that we use Apache FOP for server-side PDF export which doesn't support HTML inside SVG (foreign objects) and the layout is not all the time 100% the same as what you see in the browser.

Image based PDF export on the other hand is not interactive (you can't click on the links for instance) and the quality depends on the image resolution, but at least you have the guarantee that it will look the same.

Best would be to have support for both options (SVG and image based PDF export) and to let the user decide which one to use.

@mflorea
Copy link
Collaborator Author

@mflorea mflorea commented Jan 8, 2020

One solution that @oanalavinia and I discussed is to add a new boolean property exportUsingSVG to the DiagramClass. We don't foresee adding a new type of PDF export besides image and SVG so in order to keep thinks simple a boolean flag should be enough. DiagramViewSheet and DiagramMacro would take this property into account when the diagram is exported to PDF. Of course, DiagramEditSheet needs to be modified to generate the diagram image and attach it along with the diagram SVG to the diagram page.

@mflorea
Copy link
Collaborator Author

@mflorea mflorea commented Jan 8, 2020

Note that for IE11 only SVG-based PDF export will be available. This means that both DiagramViewSheet and DiagramMacro have to fallback on SVG PDF export if exportUsingSVG is false and the diagram image is missing.

@oanalavinia oanalavinia self-assigned this Mar 18, 2020
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Mar 20, 2020
… per diagram xwikisas#102

* added exportUsingSVG class property so that the user can export the desired format, defaulting to svg
* upload png version of the diagram at save step
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Mar 24, 2020
oanalavinia added a commit that referenced this issue Mar 24, 2020
#126)

.. per diagram #102
* added exportUsingSVG class property so that the user can export the desired format, defaulting to svg
* upload png version of the diagram at save step
@oanalavinia oanalavinia added this to the 1.13 milestone Mar 27, 2020
@oanalavinia
Copy link

@oanalavinia oanalavinia commented Apr 10, 2020

As a conclusion, to choose between SVG-based and image-based XWiki PDF export, a diagram must be edited in object mode for modifying exportUsingSVG property.
By default, the property is set to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants