webviewer-ui icon indicating copy to clipboard operation
webviewer-ui copied to clipboard

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

Open uwohlfeil opened this issue 1 year ago • 6 comments

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

uwohlfeil avatar Jun 04 '24 12:06 uwohlfeil

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

bollain avatar Jun 19 '24 17:06 bollain

Hello @uwohlfeil, this issue is fixed in our latest version 11.5. Please try it out and let us know if there's any issues.

darianchen avatar Jul 04 '25 19:07 darianchen

Hello @uwohlfeil, this issue is fixed in our latest version 11.5. Please try it out and let us know if there's any issues.

Hello @bollain, I just test it, and it seems to be the same problem. But I do not have the latest 11.5.0 version. Image

Image

Do I have to update to the latest 11.5.0 version?

uwohlfeil avatar Jul 07 '25 06:07 uwohlfeil

Hello @uwohlfeil,

We weren't able to reproduce this issue on 11.5. There is only one version of 11.5. Can you try testing with the following code to get and set the stamps?

 const stampTool = WebViewer.getInstance().Core.documentViewer.getTool(WebViewer.getInstance().Core.Tools.ToolNames.RUBBER_STAMP);
  const stamps = stampTool.getCustomStamps();
stampTool.setCustomStamps(stamps);

darianchen avatar Jul 07 '25 18:07 darianchen

https://github.com/user-attachments/assets/847c4898-d4ef-4019-a16c-ce0144b4fa32

bollain avatar Jul 07 '25 18:07 bollain

https://github.com/user-attachments/assets/5fb09f86-4fb4-4d7a-a295-0abe52a18b60

bollain avatar Jul 07 '25 18:07 bollain