This library provides a document viewer compatible with TX Text Control and documents created using the editor and API of TX Text Control.
sh
ng add @txtextcontrol/tx-ng-document-viewer
`
Important notice: From Angular v17 onwards, "standalone" apps are the new default for the CLI. If you want DocumentEditorModule
to be added to your app.module.ts automatically, you have to use the --no-standalone flag when creating a new Angular project with ng new.
Usage
Your component.html could look like this, for example (the only mandatory attributes are width, height and basePath):
`html
width="1000px"
height="800px"
basePath="https://www.server.com:5000"
dock="Window"
[toolbarDocked]="true"
documentPath="test.docx"
[isSelectionActivated]="true"
[showThumbnailPane]="true"
[userNames]="['qa@textcontrol.com']">
`
$3
- width (_string_) - The width of the component (e. g. "1000px").
- height (_string_) - The height of the component (e. g. "800px").
- basePath (_string_) - The backend URL.
- toolbarDocked (_boolean_) - Specifies whether the toolbar is docked or floating.
- documentPath (_string_) - Specified the displayed document name.
- documentData (_string_) - Sets the document data encoded as a Base64 string. Supported formats are HTML, RTF, DOC, DOCX, PDF and TX.
- documentLoadSettings (_DocumentLoadSettings_) - Additional settings for loading the passed document.
- isSelectionActivated (_boolean_) - Specifies whether text can be selected and copied.
- signatureSettings (_SignatureSettings_) - Specifies the signature settings.
- showThumbnailPane (_boolean_) - Specifies whether the thumbnail sidebar is visible or not.
- 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.
- userNames (_string[]_) - An array of names specifying users who can sign the document.
#### DocumentLoadSettings Object
The DocumentLoadSettings object has the following properties:
- loadEmbeddedComments (_boolean_) - Specifies whether comments from the document should be loaded as annotations.
- pdfjs (_PDFJSSettings_) - Specifies whether comments from the document should be loaded as annotations.
#### PDFJSSettings Object
The PDFJSSettings object has the following properties:
- workerSourcePath (_string_) - Specifies the worker source path.
- librarySourcePath (_string_) - Specifies the libraray source path.
#### SignatureSettings Object
The SignatureSettings object has the following properties:
- defaultSignatureFont (_SignatureFontSettings_) -
- 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.
- signatureBoxes (_SignatureBox[]_) - Signature boxes.
#### SignatureFontSettings Object
The SignatureFontSettings object has the following properties:
- family (_string_) - Specifies the default font-family for creating a new text-based signature.
#### SignatureBox Object
The SignatureBox object has the following properties:
- name (_string_) - The name of the signature box.
- signingRequired (_boolean_) - Specifies whether signing is required.
- style (_SignatureBoxStyle_) - The signature box style.
#### SignatureBoxStyle Enumeration
The SignatureBoxStyle enumeration has the following values:
- SignatureBoxStyle.Signature - The signature box is a signature box.
- SignatureBoxStyle.Initials - The signature box is an initials box.
Environment Support
- Angular ^15.0.0
- NuGet package TXTextControl.Web.DocumentViewer 31.0.500.500` and newer.