ApryseSDK / webviewer-ui

WebViewer UI built in React
Other
409 stars 353 forks source link

[Bug] CustomStamps exports an invalid textColor in case of the default white text color #1064

Open uwohlfeil opened 4 months ago

uwohlfeil commented 4 months ago

WebViewer version 10.9.0

The current behavior When I export the custom stamps as json and import them again, stamps with the default font colour white lose their font colour.

The expected behavior Exported stamps can be reimported without changes.

Steps to reproduce

Create to Stemps. One with the default white text color and one with another color:

grafik

The JSON looks like this.

[
  {
    "title": "Draft1",
    "subtitle": "[$currentUser] DD/MM/YYYY h:mm A",
    "color": "#4F9964",
    "id": "68a51049-d4c3-2212-ea4f-fe8e4ca6421c",
    "font": "Helvetica",
    "bold": true,
    "italic": false,
    "underline": false,
    "strikeout": false,
    "textColor": { "R": 255, "G": 255, "B": 255, "A": 1 }
  },
  {
    "title": "Draft",
    "subtitle": "[$currentUser] DD/MM/YYYY h:mm A",
    "color": "#2A85D0",
    "id": "06893209-4687-da3b-2713-a53f186d62b8",
    "font": "Helvetica",
    "bold": true,
    "italic": false,
    "underline": false,
    "strikeout": false,
    "textColor": "#ca9999"
  }
]

After I reimport the stamp, the white texted Stamp has an invisible text.

grafik

If I fix the textColor to #FFFFFF, the stamp is correct.

I think, the problem maybe located here: https://github.com/PDFTron/webviewer-ui/blob/28a787e6ba84cce7c2bcb0de978d2ecd5bf58e4e/.storybook/static/assets/customStamps.js#L84C7-L89C8

bollain commented 4 months ago

Hi @uwohlfeil - thanks for the report. When this gets fixed we will let you know so you can pull the latest changes.