`import { DocumentEditor } from "@onlyoffice/document-editor-react";
import React from "react";
function DocumentViewer() {
const onDocumentReady = () => {
console.log("Document is ready to view");
};
const onLoadComponentError = function (errorCode, errorDescription) {
switch (errorCode) {
case -1: // Unknown error loading component
console.log(errorDescription);
break;
case -2: // Error load DocsAPI from http://documentserver/
console.log(errorDescription);
break;
case -3: // DocsAPI is not defined
console.log(errorDescription);
break;
}
};
debugger;
return (
<>
<DocumentEditor
id="docxEditor"
documentServerUrl="http://confidential.com/example/"
config={{
document: {
fileType: "pdf",
key: "my_only_office_jwt_secret",
title:
"Screenshot and Functionalities od e-Tappal and e-File(SRS).pdf",
url: "http://122.176.109.190:8080/server/api/core/bitstreams/10e76505-5ebb-4812-933d-36ddf82798b0/content",
},
documentType: "word",
editorConfig: {
callbackUrl: "http://localhost:3000/",
},
}}
events_onDocumentReady={onDocumentReady}
onLoadComponentError={onLoadComponentError}
/>
</>
);
}
export default DocumentViewer;
`