将wordfile另存为PDF [英] Saving wordfile as PDF

查看:107
本文介绍了将wordfile另存为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有一个问题如下.

我在MSWord中制作了一个模板,用于显示一些数据.之后,我将其与代码集成在一起.它运行良好,并保存为doc文件.现在的问题是我想将此文件另存为PDF文件.那时我遇到错误命令失败".

这是示例代码.

Hello All,

There is one problem that is as follows.

I have made a template in MSWord for displaying some data.after that i integrated with my code. it is running good and getting saved as doc file. Now problem is that i want save this file as PDF file. that time i am getting error "Command Fail".

here is sample code.

object fileFormat = WdSaveFormat.wdFormatPDF;

 Object oSaveAsFile = System.Configuration.ConfigurationManager.AppSettings.Get("AddressProofDirectory") + temp.Rows[0]["ID"].ToString() + "-" + System.DateTime.Now.ToString("yyyyMMdd");
          oWordDoc.SaveAs(ref oSaveAsFile, ref fileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);




请帮忙
谢谢
sanjeev




Please help
thanks
sanjeev

推荐答案

您是否具有
Do you have SaveAsPDFandXPS[^] installed?
Otherwise it won''t work.


http://aspdotnetcodebook.blogspot.com/2008/07/how-to-export-content-of-gridview-to.html [ http://stackoverflow.com/questions/2822843/itextsharp-html-to-pdf [ ^ ]
http://blog.dmbcllc.com/2009/07/28/itextsharp-html-to-pdf-parsing-html/[^]
http://aspdotnetcodebook.blogspot.com/2008/07/how-to-export-content-of-gridview-to.html[^]
http://stackoverflow.com/questions/2822843/itextsharp-html-to-pdf[^]


这篇关于将wordfile另存为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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