1

I need to implement the below functionality,

  1. Open multiple files (doc, pdf) in an editor.
  2. Edit functionality in the editor.
  3. Download ability of the edited files in any format (doc, pdf etc), keeping the text formatting as it is.

I was looking out for tinymce and ckeditor. But Could find any solution for opening multiple files and the download ability. Any starting points would help.

Below is some sample code from tinymce, here how can I populate the textarea content dynamically onclick of the custom Import button?

HTML Code:

<textarea>
    <h1 style="text-align: center;">Welcome to the WYSIWYG editor demo!</h1>
    <p>Right now import button does not work</p>
</textarea>

JS Code:

tinymce.init({
    selector: 'textarea',
    height: 500,
    toolbar: 'importbtn',
    menubar: false,
    setup: function (editor) {
      editor.addButton('mybutton', {
        text: 'Import',
        icon: false,
        onclick: function () {
          editor.insertContent('&nbsp;<b>This is suppose to import a file</b>&nbsp;');
        }
      });
    }
});

Thanks in advance

rockyPeoplesChamp
  • 581
  • 2
  • 6
  • 23
  • 1
    I honestly have not heard of a JS editor that supports doc/pdf that isn't propitiatory. You might have better luck embedding a Google Doc.. – PaulBGD Oct 27 '16 at 05:38
  • I was looking out for customization of tinymice or ckeditor. They allow custom button, will it be possible or rather feasible to implement a custom button that will import/upload files and another button for export / download – rockyPeoplesChamp Oct 27 '16 at 05:41
  • 1
    This is going to be one hell of a task. You'll need to parse the data from docs/pdf format through a module, make sure this doesn't completely destroy the format, edit the text in the file using `fs` (http://stackoverflow.com/questions/14177087/replace-a-string-in-a-file-with-nodejs), then parse the data back into docx/pdf, which I bet will be really ugly. – Dandy Oct 27 '16 at 05:55
  • 1
    Yeah this is literally the work of an entire Google/Microsoft/libreoffice team. You really can't implement this without a sound amount of engineers behind it. – PaulBGD Oct 27 '16 at 06:20

0 Answers0