我需要在 UI 上渲染我的 Office 文件(docx、excel、pptx),而不使用 Google Viewer 或 Microsoft Document Viewer,因为它们使用一些在线服务器调用来实现这些渲染?
但我想直接从我的前端代码或使用一些不使用任何外部在线 api 调用的库来渲染它。
请帮忙。
我已经尝试过 Aspose.words 库,但是,我认为这也在进行在线 https: 调用来渲染文档。
Aspose.Words 是一个本地 API,可以离线工作:https://docs.aspose.com/words/net/product-overview/
但是,如果您的源文档包含对外部资源的引用,Aspose.Words 可能会发出访问它们的请求。您可以使用 IResourceLoadingCallback 来控制此行为。
此外,还有云版本的 Aspose.Words API: https://docs.aspose.cloud/words/getting-started/overview/
如果可以接受以 PDF 形式呈现 Office 文档,您可以使用 https://github.com/cyntler/react-doc-viewer 和 https://gotenberg.dev/ 来转换 (doc, docx,ppt,pptx,xls,xlsx) 到 PDF 服务器端。