TX Text Control DS Server Document Viewer for React.
npm install @txtextcontrol/tx-react-ds-document-viewerReact 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 Viewer:
`sh
npm i @txtextcontrol/tx-react-ds-document-viewer
`
4. In your App.jsx file, import the DocumentViewer component and add it to the render method (the only mandatory attributes are width, height and serviceURL):
`jsx
import DocumentViewer from '@txtextcontrol/tx-react-ds-document-viewer'
function App() {
return (
<>
width="1280px"
height="1024px"
serviceURL="https://your.server.com/documentservices"
documentData="SGVsbG8gdGhlcmU="
clientId="dsserver.PdRpDAnzGLRrTPhRnYBU2UAEkzyB4PQ1"
clientSecret="HgpGyqoFQOVkrzk6ukHtSxUS6XdU39LP">
>
);
}
`
5. Start the application:
`sh
npm run dev
`
$3
- accessToken (_string_) - The OAuth Access Token.
- clientID (_string_) - The OAuth client ID.
- clientSecret (_string_) - The OAuth client secret.
- documentData (_string_) - Base64 encoded document data.
- documentPath (_string_) - The displayed document name.
- width (_string_) - The width of the component (e. g. "1280px").
- height (_string_) - The height of the component (e. g. "1024px").
- serviceURL (_string_) - The server which is hosting your installation of Text Control DS Server.
- userNames (_string[]_) - An array of names specifying users who have access to editable regions.
- isSelectionActivated (_boolean_) - Specifies whether text can be selected and copied.
- dock (_string_) - Specifies how the control is docked. Possible values are 'Fill' and 'Window'.
- toolbarDocked (_boolean_) - Specifies whether the toolbar is docked or floating.
- resources (_Object._) - Specifies resources for the displayed strings.
- signatureSettings (object) - The signature settings. See below.
- customQueryParams (_Object._) - Specifies user-definable query parameters which are
added to the query string of each HTTP request.
- onLoad (_function_) - Is executed as soon as the main 'TXDocumentViewer' object is loaded.
#### Signature settings
The signature settings object has the following properties:
- ownerName (_string_) - The owner name.
- signatureBoxName (_string_) - The id of the signature box element
- signerName (_string_) - The signer name.
- signerInitials (_string_) - The signer initials.
- showSignatureBar (_boolean_) - Specifies whether to show the signature bar.
- uniqueId (_string_) - The unique signature id.
- redirectUrlAfterSignature (_string_) - The URL to redirect to after a signature.
- customSigning (_boolean_) - Specifies whether the signing process is handled within custom code.
- signatureBoxes (_object[]_) - Boxes for signing (see below). Property _signatureBoxName_ has no effect if this array is not empty.
#### Signature boxes
A signature box object has the following properties:
- style (_string_) - The signature box style. Possible values are "Signature" and "Initials". The default value is "Signature".
- signingRequired (_boolean_) - Specifies whether signing is required. The default value is true`.