如何使用 Javascript 在 Unity/C# 中将 pdf 转换为图像?
我正在开发一个 Unity 项目,该项目需要我在项目中显示 PDF。为此,我需要先将其转换为图像,然后显示该图像(显示 PDF 的唯一方法似乎是在商店购买资产)。然而,这在 C# 中似乎很难做到。我尝试过很多图书馆,但都没有成功。然而,这种转换在 Javascript 中似乎非常容易完成。有没有办法在 C# 程序中执行 Javascript 代码? 例如,我通过 C# 程序上的 API 调用下载 PDF,然后执行一些 Javascript 代码在后台打开 PDF,并将画布元素保存为 png/jpeg 以便我在 C# 程序中使用?
I'm working on a Unity project which requires me to show PDFs within the project. To do this I need to convert it to an image first and then display that (the only way to show a PDF is to buy an asset on the store it seems). However, this seems quite difficult to do in C#. I've tried a number of libraries but have had no luck. However this conversion seems extremely easy to do in Javascript. Is there any way to execute Javascript code from within a C# program?
So for example, I download my PDF with an API call on my C# program, then execute some Javascript code to open up the PDF in the background and save the canvas element as a png/jpeg for me to use back in my C# program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于你的问题“在 Unity 中使用 javascript”
您可以查看此页面
但是有一种方法要查看我很久以前使用过的 pdf 文件,套餐
For your question "Using javascript inside Unity"
You can review this page
But there is a way to view pdf files that I used from a long time ago and it was fine the package