基本信息
源码名称:在线查看pdf文件例子源码(FlexPaper实现)
源码大小:0.88M
文件格式:.rar
开发语言:C#
更新时间:2016-01-27
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
同时含(doc转swf代码)
同时含(doc转swf代码)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;
using System.IO;
public partial class Pdf2Swf : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string sWebPath = Request.MapPath("");
string sFile = sWebPath "\\" TextBox1.Text;
string dFile = sFile.Replace(".pdf", ".swf");
if (!File.Exists(dFile))
{
if (!Doc2Swf("c:\\swftools\\pdf2swf.exe", sFile, dFile))
{
Response.Write("该文档被加密,不能转换!");
}
}
}
/// <summary>
/// 将pdf等转换为swf文件
/// </summary>
/// <param name="appPath">转换程序路径</param>
/// <param name="Source">源文件</param>
/// <param name="Des">目标文件</param>
/// <returns></returns>
private Boolean Doc2Swf(string appPath, string Source, string Des)
{
Process pc = new Process();
ProcessStartInfo psi = new ProcessStartInfo(appPath, Source " " Des);
try
{
pc.StartInfo = psi;
pc.Start();
pc.WaitForExit();
}
catch
{
return false;
throw;
}
finally
{
pc.Close();
}
return File.Exists(Des);
}
}