# Colours on Drawn Signatures not saving

**URL:** <https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [October 20, 2025, 11:41am UTC](https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804 "2025-10-20T11:41:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://pdfjs.community/u/tomc)\
**Post date:** [October 20, 2025, 11:41am UTC](https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804/1 "2025-10-20T11:41:21Z")

</div>

**Which product are you using?**

PDF.js Express Plus

**PDF.js Express Version**

UI version ‘8.7.0’  
Core version ‘8.7.5’

**Detailed description of issue**  
I’m saving signatures that the user draws. If the user creates a signature using first the blue colour and then a second using red, then the signatures will be shown in the drop down using the correct colour.

However, if I save the signatures and then try to import the signatures again then both of the signatures in the drop down will be red instead of blue and red.

You can see in the example below that the Blue signature was originally saved as blue and added to the PDF. When I opened the editor later the signature was still blue in the PDF but it had changed to red in the drop down menu.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/0/0005a2f18c7785956ddf27abfeb68a79cd1f8b88.png)

**Expected behaviour**  
I would expect the colour of the signature to be saved with each entry in the drop down.

Is this a bug or expected behaviour?

**Does your issue happen with every document, or just one?**  
Every document

**Link to document**  
N/A

**Code snippet**

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [October 27, 2025, 6:01pm UTC](https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804/3 "2025-10-27T18:01:39Z")

</div>

Hello tomc,

How are you importing and exporting the signatures for the tool?

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://pdfjs.community/u/tomc)\
**Post date:** [October 28, 2025, 11:16am UTC](https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804/4 "2025-10-28T11:16:22Z")

</div>

@tgordon

We save the signatures as a string and use the string to import them later on.

**Export Signatures**

```javascript
function sendSignaturesToTheApp(typeName) {
    signatureTool.exportSignatures().then((signatures) => {
        if (signatures === null || signatures === undefined) {
            writeErrorMessage('Signatures JSON is null or undefined');
            return;
        }

        const stringValue = JSON.stringify(signatures);
        const jsonValue = JSON.parse(stringValue);
        const deepClonedSignatures = JSON.parse(JSON.stringify(signatures));
        const valToSend = JSON.stringify(deepClonedSignatures);

        window.top.postMessage({
            type: typeName,
            signatures: JSON.parse(valToSend)
        }, getUrl());

    });
}

```

**Import Signatures**

```javascript
const parsedString = JSON.parse(signatureString);
signatureTool.importSignatures(parsedString).then(() => { });

```

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [October 28, 2025, 6:22pm UTC](https://pdfjs.community/t/colours-on-drawn-signatures-not-saving/3804/5 "2025-10-28T18:22:08Z")

</div>

Hello tomc,

exportSignatures only exports the freehand paths, a list of points. The colour is tied to the annotation or tool, which is not included with the path data. So when you import the paths for the signatures it defaults to the tool’s current colour.

I would instead use _saveSignatures()_ and _getSavedSignatures()_ which returns the annotation data in XFDF which will save the colour.

Let me know if that works for you!

Best regards,  
Tyler
