简体   繁体   English

您可以使用 pdftron 从反应应用程序填充单词字段吗?

[英]Can you populate word fields from a react app using pdftron?

I was wondering if anyone could point me towards a solution to my issue with pdftron/webviewer.我想知道是否有人可以指出我的 pdftron/webviewer 问题的解决方案。 I am building a MERN app and one of the projected feature is contracts generation.我正在构建 MERN 应用程序,其中一项预期功能是合同生成。 I created my fields in.docx file, loaded it in with webviewer.我在 .docx 文件中创建了我的字段,并使用 webviewer 将其加载。

I tried: having my data collecting form on the same page with webviewer and passing data via state. (...yeah)我尝试过:将我的数据收集表单与 webviewer 放在同一页面上,并通过 state 传递数据。(...是的)

Tried to separate contract generation page and display (webviewer) page and use localStorage/redux.试图分离合同生成页面和显示(webviewer)页面并使用 localStorage/redux。

Lastly I tried to take advantage of my database, so I created new model/schema and set up the collections that on the form page the contract data gets POSTed into database and then fetches from the webview page.最后我尝试利用我的数据库,所以我创建了新的模型/模式并设置了 collections,在表单页面上合同数据被发布到数据库中,然后从 webview 页面获取。 Mongo has a TTL flag to remove every record after 1 minute. Mongo 有一个 TTL 标志,可以在 1 分钟后删除每条记录。

I can console.log(contract.name) but it just won't consistently show as {{NAME}} (consistently because on several ocassions it works..)我可以 console.log(contract.name) 但它不会始终如一地显示为 {{NAME}} (始终如一,因为在几个场合它有效..)

Any help is greatly appreciated.任何帮助是极大的赞赏。 Can't provide console errors log.network dont show any.无法提供控制台错误日志。网络不显示任何内容。

It seems like you are trying to fill forms with data.似乎您正在尝试用数据填充 forms。 You could check out this guide for form filling.您可以查看此表单填写指南。 PDFTron JavaScript PDF form filling library PDFTron JavaScript PDF填表库

This is an live example showing how it would work.这是一个活生生的例子,展示了它是如何工作的。

Let me know how this works for you.让我知道这对你有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM