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

Development: Fix pdf export for communication diagrams #46

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mertyldrr
Copy link
Contributor

Checklist

  • I added multiple screenshots/screencasts of my UI changes

Motivation and Context

This PR fixes arrows not appearing correctly in the communication link messages on pdf export

Steps for Testing

Test Server

  • Goto test server
  • Create a new communication diagram
  • Create multiple objects with links between them
  • Place objects to see each arrow type (up, down, right, left)
  • Observe that the arrows are correctly displayed on pdf export.

Screenshots

Before

before

After

after

@mertyldrr mertyldrr added the bug Something isn't working label Dec 4, 2022
@mertyldrr mertyldrr self-assigned this Dec 4, 2022
@mertyldrr mertyldrr changed the title Development : Fix pdf export for communication diagrams Development: Fix pdf export for communication diagrams Dec 4, 2022
Copy link
Contributor

@minrows minrows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on the test server. Code changes look good and so does the functionality. 👍

Copy link
Member

@Mtze Mtze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export is working for me

@mertyldrr mertyldrr added the ready for merge PR is ready to be merged label Dec 6, 2022
pdfMake.vfs = pdfFonts.pdfMake.vfs;
pdfMake.vfs = dejavuSans;
pdfMake.fonts = {
DejaVuSans: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we need a custom font here? is it not possible to solve the issue without a custom fonts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case I would prefer something closer to the default fonts of operating systems such as Helvetica or Arial (in case we can force this, potentially without adding them to the repo)

Copy link
Contributor Author

@mertyldrr mertyldrr Dec 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we need a custom font here? is it not possible to solve the issue without a custom fonts?

Apparently, PDF files have 14 standard fonts; Acrobat Reader Base Fonts

These fonts do not support unicode characters, arrows for our case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case I would prefer something closer to the default fonts of operating systems such as Helvetica or Arial (in case we can force this, potentially without adding them to the repo)

We are using normal arrows for up and down, but long arrows for left and right. If we replace long arrows with normal ones, we can use Arial which supports normal arrows. Since Arial is also not supported in pdf, we have to use it as a custom font.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example: Standardized arrows & Arial font

arial

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no other default PDF font which supports the arrow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried all of them, but no luck...

List of fonts supporting arrows

There is a library called pdfmake-unicode that provides Aerial GEO font that supports arrows but this library is not maintained anymore.

@mertyldrr mertyldrr removed the ready for merge PR is ready to be merged label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants