TX Text Control DS Server Document Editor for React.
npm install @txtextcontrol/tx-react-ds-document-editorReact as the framework and JavaScript as the language):
sh
npm create vite@latest test-app
`
2. Change into the new directory:
`sh
cd test-app
`
3. Install the TX Text Control DS Server Document Editor:
`sh
npm i @txtextcontrol/tx-react-ds-document-editor
`
4. In your App.jsx file, import the DocumentEditor component and add it to the render method (the only mandatory attributes are width, height and serviceURL):
`jsx
import DocumentEditor from '@txtextcontrol/tx-react-ds-document-editor'
function App() {
return (
<>
style={{width:"1280px", height:"1024px" }}
serviceURL="https://your.server.com/documentservices"
authSettings={{clientId:"dsserver.u5NQQHkgjmCRAOeChUVc19zNFJ9aivKz", clientSecret:"tPGgkutg8oYuSHPbfuRfE5DMf9arUCEg"}}>
>
);
}
`
5. Start the application:
`sh
npm run dev
`
$3
- style (_object_)
- width (_string_) - The width of the Document Editor in pixel 'px' or in percentage '%' relative to the container's width.
- height (_string_) - The height of the Document Editor in pixel 'px' or in percentage '%' relative to the container's height.
- serviceURL (_string_) - The server which is hosting your installation of Text Control DS Server.
- authSettings (_object_)
- clientId (_string_) - The OAuth client ID.
- clientSecret (_string_) - The OAuth client secret.
- accessToken (_string_) - The OAuth Access Token.
- editMode (_string_) - Sets whether the document's text is read-only, can be selected or is editable. Possible values are 'Edit', 'ReadAndSelect', 'ReadOnly' and 'UsePassword'.
- contextMenusEnabled (_boolean_) - Sets whether a right click opens a context menu or not.
- formattingPrinter (_string_) - The name of a printer the text dimensions and capabilities of which are used to format the document.
- culture (_string_) - The culture (e. g. 'de-DE'). Affects date and time string formats, for example.
- uiCulture (_string_) - The user interface culture (e. g. 'en-US'`). Affects the string resource language.