Word转PDF及SWF在线浏览(.net)——Flash Paper

斯鹭说过:之前在项目中研究使用了一套word转PDF,然后将PDF转成SWF的方法,最终实现SWF的在线浏览。自己还有些洋洋得意,昨晚在浏览网页搜集资料时发现:原来在2004年左右就有Flash Paper,已经很容易地实现上面的过程。

     Flash Paper支持Office文档(.doc,.xls,.ppt)直接转换为PDF或SWF,速度很快,效果较好。可惜,Flash Paper V2.2后没有再更新了。安装Flash Paper后,可以直接使用命令调用FlashPrinter.exe,实现批量转换。

     例如:C:/FlashPaper2.2/FlashPrinter.exe C:/Flex技术简介.ppt -o C:/Flex技术简介.pdf

public static void ConvertPdfToSwf(HttpRequest reqeust, String styFileName, String[] dataFileNames, String outputFileFullName)
{
try
{ String flashPrinter
= String.Concat(AppDomain.CurrentDomain.BaseDirectory, " FlashPrinter.exe " ); // FlashPrinter.exe System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter);
if (String.IsNullOrEmpty(outputFileFullName))
{
return ; }
Int32 intLastDot
= outputFileFullName.LastIndexOf( " . " );
// *********Temp Programming****************************************
Int32 intLast = outputFileFullName.LastIndexOf( " // " );
String path
= outputFileFullName.Substring( 0 , intLast);
String tempFileName
= path + " //PdfToSwf20080923.pdf " ;
// *****************************************************************
String swfFileName = String.Concat(path, " //PdfToSwf20080923.swf " );
startInfo.Arguments
= String.Concat(tempFileName, " -o " , swfFileName);
System.Diagnostics.Process process
= new System.Diagnostics.Process();
process.StartInfo
= startInfo;
Boolean isStart
= process.Start();
process.WaitForExit();
process.Close();
}
catch (Exception ex) { throw ex; }
}
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值