# Signature component image to Report

**URL:** <https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109>\
**Category:** Ignition Early Access\
**Created:** [May 28, 2020, 11:51am UTC](https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109 "2020-05-28T11:51:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craighunter1986](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Craighunter1986](https://forum.inductiveautomation.com/u/Craighunter1986)\
**Post date:** [May 28, 2020, 11:51am UTC](https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109/1 "2020-05-28T11:51:00Z")

</div>

I am trying to use the image produced from the signature component in a report. the signature component creates a base64 string. Can this be used directly by the key in the report image?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 28, 2020, 3:27pm UTC](https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109/2 "2020-05-28T15:27:34Z")

</div>

No, not directly (although if you wait a few weeks, 8.0.14 will give you direct access to the byte array of the image).

What you need to do is strip the preamble off the data URL, then deserialize the base64-encoded bytes of the actual image:

```auto
    from com.inductiveautomation.ignition.common import Base64
    data = Base64.decode(event.signature.split(',')[1])
    system.db.runNamedQuery("insertImage", {'name': 'signature.png', 'bytes': data}

```

---

<div class="post-metadata">

**Author:** ![Craighunter1986](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Craighunter1986](https://forum.inductiveautomation.com/u/Craighunter1986)\
**Post date:** [May 28, 2020, 9:06pm UTC](https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109/3 "2020-05-28T21:06:01Z")

</div>

thanks for help PGriffith.

I wasn’t able to get it to work with the named query as it gave an error ‘did not return a result set’

but I did managed to get it to work by changing the insert into the script instead.

```auto
from com.inductiveautomation.ignition.common import Base64
data = Base64.decode(event.signature.split(',')[1])
system.db.runPrepUpdate("INSERT into table (name, bytes) VALUES (?,?)", ['signature123.png', data])
```

---

<div class="post-metadata">

**Author:** ![vipo](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@vipo](https://forum.inductiveautomation.com/u/vipo)\
**Post date:** [April 9, 2021, 11:32am UTC](https://forum.inductiveautomation.com/t/signature-component-image-to-report/35109/4 "2021-04-09T11:32:56Z")

</div>

How did you read this back out to the report ?
