Config

Description

The config base section allows to change the platform type used, document display size (width and height) and type of the document opened.

Parameters

NameDescriptionTypeExample
documentTypeDefines the document type to be opened:
  • word - text document (.doc, .docm, .docx, .docxf, .dot, .dotm, .dotx, .epub, .fodt, .fb2, .htm, .html, .mht, .odt, .oform, .ott, .oxps, .pdf, .rtf, .txt, .djvu, .xml, .xps),
  • cell - spreadsheet (.csv, .fods, .ods, .ots, .xls, .xlsb, .xlsm, .xlsx, .xlt, .xltm, .xltx),
  • slide - presentation (.fodp, .odp, .otp, .pot, .potm, .potx, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx).
string“cell”
text, spreadsheet and presentation values are deprecated since version 6.1. Please use new values instead.
heightDefines the document height (100% by default) in the browser window.string“100%”
tokenDefines the encrypted signature added to the Document Server config in the form of a token.string“eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.LwimMJA3puF3ioGeS-tfczR3370GXBZMIL-bdpu4hOU”
typeDefines the platform type used to access the document. Can be: optimized to access the document from a desktop or laptop computer - desktop, optimized to access the document from a tablet or a smartphone - mobile, specifically formed to be easily embedded into a web page - embedded. The default value is “desktop”.string“desktop”
widthDefines the document width (100% by default) in the browser window.string“100%”

Example

  1. var docEditor = new DocsAPI.DocEditor("placeholder", {
  2. "documentType": "word",
  3. "height": "100%",
  4. "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.LwimMJA3puF3ioGeS-tfczR3370GXBZMIL-bdpu4hOU",
  5. "type": "desktop",
  6. "width": "100%",
  7. ...
  8. });