Search results

Supported platforms for server-side dependencies

21 Oct 2021 / 3 minutes to read

You can deploy web APIs for server-side dependencies of Document Editor component in the following platforms.

Which operations require server-side interaction

Operations When client-server communication will be triggered? What type of data will be transferred between client and server?
Open file formats other than SFDT When opening the document other than SFDT (Syncfusion Document Editor’s native file format), the server-side web API is invoked from client-side script. Client: Sends the input file.
Server: Receives the input file and sends the converted SFDT back to the client.

The server-side web API internally extracts the content from the document (DOCX, DOC, WordML, RTF, HTML) using Syncfusion Word library (DocIO) and converts it into SFDT for opening the document in Document Editor.
Paste with formatting When pasting the formatted content (HTML/RTF) received from system clipboard. For converting HTML/RTF to SFDT format.

Note: Whereas plain text received from system clipboard will be pasted directly in the client-side.
Client: Sends the input Html or Rtf string.
Server: Receives the input Html or Rtf string and sends the converted SFDT back to the client.
Restrict editing When protecting the document, for generating hash. Client: Sends the input data for hashing algorithm.
Server: Receives the input data for hashing algorithm and sends the result hash information back to the client.
Spellcheck When the spellchecker is enabled on client-side Document Editor, and it performs the spell check validation for words in the document. Client: Sends the words (string) with their language for spelling validation.
Server: Receives the words (string) with their language for spelling validation and sends the validation result as JSON back to the client.
Save as file formats other than SFDT and DOCX (optional API) You can configure this API, if you want to save the document in file format other than DOCX and SFDT.

For saving the files as WordML, DOC, RTF, HTML, ODT, Text using Syncfusion Word library (DocIO) and PDF using Syncfusion Word (DocIO) and PDF libraries.
You can transfer document from client to server either as SFDT or DOCX format.

First option (SFDT):
Client: Sends the SFDT.
Server: Receives the SFDT and saves the converted document as any file format supported by Syncfusion Word library (DocIO) in server or sends the saved file to the client browser.

Second option (DOCX):
Client: Sends the DOCX file.
Server: Receives the DOCX file and saves the converted document as any file format supported by Syncfusion Word library (DocIO) in server or sends the saved file to the client browser.

Note: If you don’t require the above functionalities then you can deploy as pure client-side component without any server-side interactions.

Please refer the example from GitHub to configure the web service and set the serviceUrl.

Required Web API structure

Please check below table for expected web API structure.

Expected Web API URL Method name Parameters Return type
../api/documenteditor/Import Import Files(IFormCollection) json(sfdt format)
../api/documenteditor/SystemClipboard SystemClipboard CustomerParameter: content(type string either rtf or html) and type(either .rtf or .html) json(sfdt format)
../api/documenteditor/RestrictEditing RestrictEditing Parameter of type CustomRestrictParameter
public class CustomRestrictParameter
{
public string passwordBase64 { get; set; }
public string saltBase64 { get; set; }
public int spinCount { get; set; }
}
result hash information
../api/documenteditor/SpellCheck SpellCheck Parameter: SpellCheckJsonData
public class SpellCheckJsonData
{
public int LanguageID { get; set; }
public string TexttoCheck { get; set; }
public bool CheckSpelling { get; set; }
public bool CheckSuggestion { get; set; }
public bool AddWord { get; set; }
}
Json type of Spellcheck containing details of spell checked word
../api/documenteditor/Save Save Sfdt void