CIB webRec technical documentation

CIB webRec GET parameters

These parameters are controlled by query string passed to CIB webRec instance when it is opened, e.g.

    editor.html?reducePageSpace=true&initialFontSize=14

All values passed must be URI and then JSON-encoded, e.g. string example value must be passed as "example%20value", while number 42 is still 42.

If a key is passed that doesn’t exist, or a value’s type is not correct nor can be parsed, it is ignored and a warning is shown in browser console.

You could configure these parameters at back-end too using webrec.json file.

Property

Value

Type

enableFileButtons

Controls if open and save options exist on toolbar and in context menu. If disabled, documents cannot be opened or saved by CIB webRec itself.

default: true

Boolean

enableHeader

Controls if header (containing document name) is visible. Disabling header will reduce screen space used, but will make it impossible for user to rename document.

default: true

Boolean

reducePageSpace

Reduces page margins and minimum space between pages to 2-4 pixels to reduce screen space used.

default: false

Boolean

maxPagesInRow

Controls how many pages at most can be positioned horizontally. Actual positioning depends on CIB webRec frame size and zoom level set in editor.

default: 3

Number

(must be integral and greater than 0)

enableCloseConfirmation

Forces CIB webRec to show a dialog when window is closed or file is opened with unsaved changes.

default: false

Boolean

css

If set, includes CSS from provided link into the editor (see CIB webRec CSS customization).

default: ""

String

onEditorOpen

If set, provided callback name will be run when editor loading is done (see CIB webRec JS API).

default: ""

String

onDocumentLoad

If set, provided callback name will be run when document loading is done.

default: ""

String

onActionExec

If set, provided callback name will be run when an action is done.

default: ""

String

onDataDirty

If set, provided callback name will be run when the document is changed, reverted or saved.

default: ""

String

filterCIBFields

If true, CIB fields will be filtered from editor when RTF document is loaded.

default: false

Boolean

toggleFieldCode

If true, fields will be toggled from result state to code state when RTF document is loaded.

default: false

Boolean

resetLastParagraph

If true, the last pilcrow will be removed. This parameter is used for snippet editing.

default: false

Boolean

initialPageSize.width
initialPageSize.height
initialPageSize.isLandscape

Sets default page size and orientation for new document created in webRec. Also these values are used for all snippets saved with webRec when snippet mode is enabled.

default:

initialPageSize.width = 8.27 inches

initialPageSize.height = 11.69 inches

initialPageSize.isLandscape = true

 

initialPageMargins

Sets default page maergins for new document created in webRec. Also these values are used for all snippets saved with webRec when snippet mode is enabled.

default:

initialPageMargins.left = 1.18 inches

initialPageMargins.right = 0.59 inches

initialPageMargins.top = 0.79 inches

initialPageMargins.bottom = 0.79 inches

Numbers

initialFont

If set, specifies initial font name of the paragraph for the new document being created in CIB webRec.

default: 'Times New Roman'

String

initialFontSize

If set, specifies initial font size of the paragraph for the new document being created in CIB webRec.

default: 11

Number

cursorVisibility

If set to true, the cursor will be visible, elsewhere cursor position will not be visible. Selected content will be highlighted in all cases regardless this option.

default: true

Boolean

hideCursorOnLostFocus

Activates or disables cursor visibility on lost/gain input focus in the webRec frame.

default: false

Boolean

cursorBlinking

If set, the cursor will blink.

default: true

Boolean

readOnlyMode

If set, specifies webRec UI will not allow edit opened document. Also there will be disabled document save possibility.

default: false

Boolean

initialBlockUI

If set, starts webRec with blocked UI. To unblock it integrator should call webRec.blockUI(false)

default: false

Boolean

bullets

Could be set only inside webrec.base.json and/or inside webrec.json configuration files.

If set, specifies font name and character for first 3 bullet levels.

default:

  "bullets": [
    {
      "fontName": "Symbol",
      "character": "\uF0B7"
    },
    {
      "fontName": "Courier New",
      "character": "\u006F"
    },
    {
      "fontName": "Wingdings",
      "character": "\uF0A7"
    }
  ]

JSON

snippetMode

Indicates whether snippet mode (borderless layout) is switched on or off. In snippet mode you will not be able to setup page size, the document will be displayed without distribution on pages, and new documents will contain A4 page definition by default.

default: false

Boolean

enablePageBorderLines

Enables page border line in disaplying of the document. When enableSnippetMode() is called, this parameter by default is set to false.

default: true

Boolean

resizeCanvasOnZoom

When set, the page will be resized to fit actual size of the webRec frame, on any zoom in/out operations. When enableSnippetMode() is called, this parameter by default is set to true.

default: false

Boolean

resizeCanvasOnWindowResize

When set, the page will be resized to fit actual size of the webRec frame. When enableSnippetMode() is called, this parameter by default is set to true.

default: false

Boolean

overridePageColor

Sets background color (for example “#c1c1c1”) of the page for displaying purpose only. If empty, color specified inside the document will be used for page background.

default: ""

String

onlyPresetFontOptions

Disables editing possibility for font and font size combo boxes on webRec toolbar and insde Font properties dialog.

default: false

Boolean

snippetModeMargins

Sets page margins for opened snippet in snippet mode. This value is never saved into the final RTF document and used only for displaying purpose.

default:

snippetModeMargins.left =  0.1 (inches)
snippetModeMargins.right = 0.2 (inches)
snippetModeMargins.top = 0.1 (inches)
snippetModeMargins.bottom = 0 (inches)

Object

snippetModeViewOffsets

Sets grey offsets around document page for opened snippet in snippet mode. This value is never saved into the final RTF document and used only for displaying purpose.

default:

snippetModeViewOffsets.leftOffset = 0 (pixels)
snippetModeViewOffsets.rightOffset = 0 (pixels)
snippetModeViewOffsets.topOffset = 0 (pixels)

Object

pageViewOffsets

Sets grey offsets around document pages and between pages for opened document not in the snippet mode. This value is never saved into the final RTF document and used only for displaying purpose.

default:

pageViewOffsets.leftOffset = 50 (pixels)
pageViewOffsets.rightOffset = 50 (pixels)
pageViewOffsets.topOffset = 50 (pixels)
pageViewOffsets.pageOffset = 50 (pixels)

Object