Professional PDF Viewer - Load Custom Stamp image from base64 Data URI

Posted by: mark on 31 December 2024, 6:48 pm EST

    • Post Options:
    • Link

    Posted 31 December 2024, 6:48 pm EST

    I need to load custom stamp image data from base64 image data stored in a database. When I try to create the stamp annotation in code I only see the ability to set a fileName property. Setting this to a blob: URI does not seem to work. I see in browser storage that the graphical signature tool is storing the signature image as base64. Surely there is a way for me to create an annotation with base64 image data instead of a file name? Am I missing this in the examples and documentation?

  • Posted 31 December 2024, 7:34 pm EST

    There is a sample under the data storage help: https://developer.mescius.com/document-solutions/javascript-pdf-viewer/api/classes/GcPdfViewer.html#storage

    This describes the process of setting a file in storage as a Uint8Array and referencing it by ID.

    For anyone else with a similar need I am attempting to include a link to convert a Base64 DataUri to binary: https://gist.github.com/borismus/1032746

    Answered my own question after doing enough digging.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels