Integrate document editor with JavaScript on linux

Hello I want to integrate DocumentEditor in my project called FioraSoft which is a web application developed in php and hosted on an APACHE server with Linux Operating System. If the integration can be done and what would the process be like?

13 Replies 1 reply marked as answer

KB Kurthis Banu Abdul Majeeth Syncfusion Team April 25, 2021 04:10 PM UTC

Hi Reinaldo,  

We have prepared Document Editor the sample in php in below link. 

Please let us know if you have any questions. 

Regards, 
Kurthis Banu A. 


Marked as answer

RE Reinaldo April 25, 2021 04:34 PM UTC

Hi Kurthis.

Thank you very much for your answer. This example clarifies the issue a bit.
But I see that the hostUrl points to https://ej2services.syncfusion.com/production/web-services/. With this hostUrl I could open and edit documents found on my server. As I mentioned, my web application has a document management module and I want to offer the ease of editing documents in word and excel format from my application. For example, if a client wants to fill out a format, he can do it from my application with ease and then download the result. In other words, the original document should not be modified.


KB Kurthis Banu Abdul Majeeth Syncfusion Team April 26, 2021 08:25 AM UTC

Hi Reinaldo,   

Documenteditor requires a server-side APIs for the following functionalities alone,  
Opening word documents  
For reading the content from Word documents using DocIO and convert it to SFDT.  
Paste with formatting  
For converting the HTML/RTF format (received from system clipboard) to SFDT format content. Whereas plain text received from system clipboard will be pasted directly in client-side.  
Restrict editing  
For performing encryption and decryption logics.  
Spellcheck  
For validating the words and get suggestions for error words.  
Saving documents  
For saving the files as WordML, DOC, RTF, HTML, ODT, Text using DocIO library and PDF using DocIO & PDF libraries.  

Please refer to this link to configure the web service and set the serviceUrl property.  
   
We have server-side libraries in ASP.NET Core, ASP.NET MVC, and Java. But for now we recommend ASP.NET MVC library for server-side web API services which has no limitation at present.  
To achieve your requirement, you can use “Save” API which will directly download the document in browser without server side dependencies. 

documenteditor.save('sample', 'Docx'); 


Kindly please refer below documentation link: 
  

Please let us know if you have any questions.  
Regards,  
Kurthis Banu A.  



RE Reinaldo May 1, 2021 12:19 PM UTC

Hello, thank you very much for your answer. I'm honest with you, I haven't been able to integrate syncfusion into my project. I have the following doubts.
1. Do I download the files of the API mentioned internally and upload them to my Linux server in the directory where my project is?
2. Do I have to make any modifications to the downloaded sample files?
3. If I want to open a document in word and in excel that is stored on my server, edit it and save a copy, how is this process done?

I want to integrate these fantastic tools into my project, but I don't really understand what the process is like. I see that many codes are in ts format. I have to install some necessary library in my project. My project works with php and jquery


SM Suriya Murugan Syncfusion Team May 3, 2021 12:51 PM UTC

Hi Reinaldo, 
 

Syncfusion Greetings! 


For your information, hosted Syncfusion EJ2 services URL https://ej2services.syncfusion.com/production/web-services/ is not advisable for production environment, since it is only for demo purpose. To use server-side web APIs in your project, please create your own web service. 

 If I want to open a document in word and in excel that is stored on my server, edit it and save a copy, how is this process done? 
Please check below KB link for reference, which will load document from server and save it back to server: 

  


Similarly, you can customize the open and save based on your requirement. 
Do I download the files of the API mentioned internally and upload them to my Linux server in the directory where my project is? 
Using saveAsBlob Api in Documenteditor, you will get Docx stream in front end. Pass that stream to backend and save to your server based on your requirement. 

Front end code snippet(you will get base64 string from blob): 

  documenteditor.saveAsBlob("Docx").then(function (blob) { 
            var fileReader = new FileReader(); 
  
            fileReader.onload = function () { 
                var base64Text = ";base64,"; 
                var documentData = { 
                    fileName: documenteditor.documentName + '.docx', 
                    documentData: fileReader.result.substring(fileReader.result.indexOf(base64Text) + base64Text.length) 
                } 
                var httpRequest = new XMLHttpRequest(); 
                httpRequest.open('Post', '/api/DocumentEditor/Save', true); 
                httpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); 
                httpRequest.onreadystatechange = function () { 
                    if (httpRequest.readyState === 4) { 
                        if (httpRequest.status === 200 || httpRequest.status === 304) { 
                            //Sucess 
                        } 
                    } 
                }; 
                httpRequest.send(JSON.stringify(documentData)); 
            }; 
  
            fileReader.readAsDataURL(blob); 
        }); 




Back end code snippet: 

You will get stream from front end Docx stream, by processing like below and use it based on your requirement. 
Byte[] byteArray = Convert.FromBase64String(param.documentData); 
            Stream stream = new MemoryStream(byteArray); 



 
 Do I have to make any modifications to the downloaded sample files? 
Can you please share the details of what kind of modifications you were referring here? If it is saving to linux server, check above provided solution. 



Regards, 
Suriya M. 



RE Reinaldo June 7, 2021 01:59 PM UTC

Hola Suriya.
Estuve ausente y no pude realizar el examen. Descargué uno de los ejemplos que indicaste y lo abrí en Visual Studio, lo compilé y todo funcionó correctamente. Posteriormente, publiqué la aplicación y cargué los archivos en una carpeta llamada core en mi servidor y cuando ingreso la URL https://test.a3fiora.com/core recibo este aviso. Lo lamentamos, pero algo salió mal. ¿Qué puedo hacer o qué estoy haciendo mal? Saludos

Attachment: core_ee2eec4c.zip


KB Kurthis Banu Abdul Majeeth Syncfusion Team June 8, 2021 11:25 AM UTC

Hi Reinaldo, 

Kindly share your Hosting Environment details and share the hosting setup steps also. Thereby, we will proceed further on the reported issue and provide you the appropriate solution at the earliest. 

Regards, 
Kurthis Banu A. 



RE Reinaldo June 8, 2021 11:46 AM UTC

Hello, I share information about my Linux server.
DISTRIB_ID = Ubuntu
DISTRIB_RELEASE = 20.04
DISTRIB_CODENAME = focal
DISTRIB_DESCRIPTION = "Ubuntu 20.04.2 LTS"
NAME = "Ubuntu"
VERSION = "20.04.2 LTS (Focal Fossa)"
ID = ubuntu
ID_LIKE = debian
PRETTY_NAME = "Ubuntu 20.04.2 LTS"
VERSION_ID = "20.04"
VERSION_CODENAME = focal
UBUNTU_CODENAME = focal
18.0.35.2
Plesk Obsidian 18.0


KB Kurthis Banu Abdul Majeeth Syncfusion Team June 9, 2021 10:15 AM UTC

Hi Reinaldo,  

we have created a separate incident under your direct trac account. We have updated details in that incident. Kindly check that incident for further follow-ups. 

Regards,  
Kurthis Banu A.  



MI mistakiesh replied to Kurthis Banu Abdul Majeeth July 7, 2021 10:42 AM UTC

Hey Kurthis, 

As you have mentioned about hosting stuff. Do you think it will be appropriate to give your credentials to the hosting providers? and being in a medium/big business, I'm right now taking a keen assist form the best drupal hosting providers, and so far they are keeping an eye on the obstacles related to server, technical and hosting speed. 



AA Anitha Azhagesan Syncfusion Team July 8, 2021 09:54 AM UTC

Dear Customer, 
  
We requested only the environment details and not the confidential credentials. If the customer need to share confidential information or if we need , we will proceed with that request through his Direct Trac account incidents which is more private and secure. 
  
Regards, 
Anitha 
 



RE Reinaldo July 8, 2021 10:22 PM UTC

Hello. I confirm that the integration was successful with my web application.



KB Kurthis Banu Abdul Majeeth Syncfusion Team July 9, 2021 05:11 AM UTC

Hi Reinaldo,   

Thanks for your update. 

Regards, 
Kurthis Banu A. 


Loader.
Up arrow icon