单击“另存为pdf附件”时,CkEditor RichTextEditor显示{“ pdfUrl”:null}

时间:2019-05-16 18:21:47

标签: jquery ckeditor4.x

我正在使用CkEditor,在这里我还使用另存为Pdf和占位符插件,我遇到的问题是,当我尝试将文本区域保存为PDF时,会在控制台上出现此错误。

https://jsfiddle.net/Codecody/xy5p1wzb/

测试代码控制台错误

  

{“ pdfUrl”:null}

<!DOCTYPE html>
    <html>
    <head>
        <script src="https://cdn.ckeditor.com/4.11.4/standard-all/ckeditor.js"></script>

        <script>
            CKEDITOR.plugins.addExternal('save-to-pdf', 'https://rawgit.com/Api2Pdf/api2pdf.ckeditor4/master/plugins/save-to-pdf/', 'plugin.js');
        </script>
    </head>
    <body>
        <textarea name="editor1"></textarea>
        <script>
            CKEDITOR.replace('editor1',
                {
                    extraPlugins: 'save-to-pdf,placeholder',
                   //   extraPlugins: 'placeholder',

                    pdfHandler: '/savetopdf/handle'
                });



               CKEDITOR.on('dialogDefinition', function (event) {
                if ('placeholder' == event.data.name) {
                    var input = event.data.definition.getContents('info').get('name');
                    input.type = 'select';
                    input.items = [['Company'], ['Email'], ['First Name'], ['Last Name']];
                    input.setup = function () {
                        this.setValue('Company');
                    };
                }
            });
        </script>
    </body>
    </html>

0 个答案:

没有答案