Visio服务器端自动化的替代方法 [英] Alternative for visio server-side automation

查看:116
本文介绍了Visio服务器端自动化的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mircosoft建议不要使用Office工具进行服务器端自动化(注意事项用于Office的服务器端自动化) 但是,我没有其他选择.我想做的是将vsd文件转换为html(超链接的图像+映射).在 Aspose.Diagram中,这尚不可能,此处引用了类似问题的答案.在LibreOffice 3.5中使用的 LibVisio 尚未完成,也没有完成支持超链接.

Mircosoft recommends against server-side automation of office tools (Considerations for server-side Automation of Office) However, I see no other options. What I'm trying to do, is convert vsd files to html (image+map for hyperlinks). This is not yet possible in Aspose.Diagram, which was quoted in answers to similar questions here. LibVisio which is/will be used in LibreOffice 3.5 is not finished and also doesn't support hyperlinks.

还有什么我可以尝试的吗? 如果不是这样:希望获得有关如何为ASP.NET Web服务设置访问权限的任何提示,以便它可以访问visio而不会造成重大安全风险. (一个教程只是将其设置为模拟系统管理员帐户,这对我来说有点危险)

Is there anything else I can try? If not: any hints of how to setup access rights for a ASP.NET webservice so it can access visio without being a major security risk would be appreciated. (One tutorial just set it up to impersonate the system admin account which sounds a bit dangerous to me)

推荐答案

办公自动化和Web应用程序的主要问题很简单,就是办公程序没有设计为可以同时执行多个副本.如果立即从Web请求中执行Visio或其他Office程序,则不会告诉您可能遇到哪种类型的共享内存问题.这些应用程序的内存占用量不适合处理10个甚至100个同时连接.此外,发出请求的浏览器可能会由于多种原因而消失,实际上没有停止应用程序执行的好方法.

The main problem with office automation and web apps is simply that the office programs were not designed to have multiple copies executing at the same time. There's no telling what type of shared memory issues you might run into if executing Visio or another office program immediately off of a web request. The memory footprints of those applications don't lend themselves to handling 10's or even 100's of simultaneous connections. Further, the requesting browser might just go away for any number of reasons and there is really no good way of stopping the app from executing.

考虑到这一点,只要您限制应用程序,您就可以成功.一种方法是使用Web服务设置一种排队系统,这样就不会在服务器上多次实例化Visio.

With that in mind, you can be successful as long as you throttle the application. One way is to set up a type of queuing system with a web service such that Visio isn't being instantiated multiple times on the server.

我要做的是设置一个"visio服务器".表示安装了visio的另一台计算机.然后,我将编写一个控制器应用程序,其目的是从队列堆栈中拉出单个作业,运行该作业,然后保存结果.这样,您可以确保一次仅运行一项作业,因此一次仅运行一份Visio副本.请注意,这可以很好地处理一些许可问题.

What I would do is set up a "visio server". Meaning a separate machine that has visio installed. I would then write a controller app whose purpose is to pull a single job off of a queue stack, run the job, and save the results. This way you can ensure that only one job at a time, and therefore only one copy of Visio at a time, is being run. Note, this neatly handles some licensing issues.

因此,Web应用程序会将作业发布到数据库队列中.控制器将轮询这些作业,并在找到作业后执行该作业并存储结果.冲洗并重复.

So, the web app would post a job to a database queue. The controller would poll for those jobs and, upon finding one, would execute it and store the results. Rinse and repeat.

Web应用程序可以轮询数据库以查看结果何时准备好并将其提供给用户.大概某种类型的Ajax页面每15秒左右检查一次.或者,可以仅通过电子邮件向用户发送结果,也可以稍后再检查" ...

The web app could poll the database to see when the results are ready and give them to the user. Probably some type of Ajax page that checks every 15 seconds or so. Or, the user could just be sent the results in an email or they could "check back later"...

请注意,由于控制器和visio将在单独的计算机上运行,​​因此可以避免任何类型的安全风险.除了仅执行visio并从数据库中提取作业信息外,这台单独的计算机不需要任何其他权限.因此,即使您遇到了某种流氓visio事情,损坏也仅限于一台机器.

As a side note, this sidesteps any type of security risk as the controller and visio would be running on a separate machine. This separate machine wouldn't need any other rights than to simply execute visio and pull the job info from your database. So, even if you had some type of rogue visio thing going the damage is limited to just that one machine.

这篇关于Visio服务器端自动化的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆