简体   繁体   English

使用AWS S3存储中的Interop库直接加载PPTX文件

[英]Loading a PPTX file directly using Interop Library from AWS S3 storage

My requirement is to load a PPTX file directly from AWS s3 storage. 我的要求是直接从AWS s3存储中加载PPTX文件。 I'm using INTEROP to manipulate with Powerpoint files. 我正在使用INTEROP来处理Powerpoint文件。 So instead of downloading file from S3 to a specified location on server can I directly load the file from S3. 因此,我可以直接从S3加载文件,而不是将文件从S3下载到服务器上的指定位置。

Here is my current code for loading PPTX file. 这是我当前用于加载PPTX文件的代码。

var pptPresentation = pptApplication.Presentations.Open(filePath, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse); 

Any suggestion would be helpful. 任何建议都会有所帮助。 Thanks 谢谢

You have to download the file locally. 您必须在本地下载文件。

Note, the Considerations for server-side Automation of Office article states the following: 注意,“ Office的服务器端自动化注意事项”一文指出:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. Microsoft当前不建议也不支持任何无人参与的非交互客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT Services)中的Microsoft Office应用程序自动化,因为Office可能表现出不稳定的行为和/在此环境中运行Office时出现死锁或死锁。

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. 如果要构建在服务器端上下文中运行的解决方案,则应尝试使用对无人值守执行安全的组件。 Or, you should try to find alternatives that allow at least part of the code to run client-side. 或者,您应该尝试找到允许至少部分代码在客户端运行的替代方法。 If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. 如果您从服务器端解决方案中使用Office应用程序,则该应用程序将缺少许多成功运行所需的功能。 Additionally, you will be taking risks with the stability of your overall solution. 此外,您将承担整体解决方案稳定性的风险。

You may consider using the Open XML SDK for manipulating open xml files. 您可以考虑使用Open XML SDK来处理打开的xml文件。 See Presentations (Open XML SDK) for a sample code. 有关示例代码,请参见演示文稿(Open XML SDK)

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

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