Document Editor Blob is empty when calling SaveAsBlob()

Title pretty much sums it up. I have a vanilla javascript instance of the DocumentEditor and when I try to save the file I get an empty blob. Not null, undefined or an empty object but a proper blob with no data. This is my script tag (only code interacting with the editor)

    <script>


        // Initialize DocumentEditorContainer component.

        var documenteditorContainer = new ej.documenteditor.DocumentEditorContainer({ enableSfdtExport: true, enableWordExport: true, enableTextExport: true , enableToolbar: true, height: '800px', locale: "es", enableLocalPaste: true });


        ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar);

        ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.WordExport, ej.documenteditor.SfdtExport);

        //documenteditorContainer.documentEditor.open("sfdt")

        //DocumentEditorContainer control rendering starts

        documenteditorContainer.appendTo('#DocumentEditor');

        this.insertarTextoEnCursor = function (texto) {

            //const iframe = document.getElementsByTagName('iframe')[0];

            documenteditorContainer.documentEditor.editor.insertText(texto)

        }


        function getDocument() {


            return documenteditorContainer.documentEditor.saveAsBlob('Sfdt').then((exportedDocument) => {

                console.log(exportedDocument);

                return exportedDocument;

            });

        }




    </script>


1 Reply

DS Dhanush Sekar Syncfusion Team May 3, 2024 05:24 AM UTC

Hi Pablo,


We have tried to replicate the reported issue. we couldn't encounter issue from our end. Please find the below sample and video for your reference.


Sample:  R1a9dw (forked) - StackBlitz


Regards,

Dhanush Sekar


Attachment: media1_a52c4250.zip

Loader.
Up arrow icon