最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Client-side Microsoft Word to PDF conversion - how to in MVC3? - Stack Overflow

programmeradmin1浏览0评论

I have a file upload control on my page. When a user selects a .DOC/DOCX file in the control, I need to show the selected file on the page but in PDF format.

I can show the PDF using embed tag as usual, but what should be the sequence be that I need to follow here?

I am using ASP.NET MVC3. Can I perform this using javacript?

I have a file upload control on my page. When a user selects a .DOC/DOCX file in the control, I need to show the selected file on the page but in PDF format.

I can show the PDF using embed tag as usual, but what should be the sequence be that I need to follow here?

I am using ASP.NET MVC3. Can I perform this using javacript?

Share Improve this question edited Feb 1, 2012 at 8:41 Stafford Williams 9,8069 gold badges54 silver badges105 bronze badges asked Feb 1, 2012 at 4:33 Red SwanRed Swan 15.6k44 gold badges161 silver badges241 bronze badges 1
  • Are you saying you want the user to upload a .doc/.docx, convert it to pdf, then show the user the pdf? – Stafford Williams Commented Feb 1, 2012 at 4:38
Add a ment  | 

1 Answer 1

Reset to default 4

Converting a DOCX file to PDF using javascript might be a little tough and a territory I wouldn't venture into. So once the file is being uploaded on the server you could use some standard library that will perform the conversion. There are some libraries such as Aspose.Words (mercial but very reliable) or DocX (free) which will allow you to do this. Once the file is converted into a PDF you could store it on the server and return its location so that the client can build an <iframe> or <object> tag dynamically pointing to it and show it inline as a preview.

发布评论

评论列表(0)

  1. 暂无评论