日期:2014-05-16  浏览次数:20879 次

asp.net 或者C#.net 中用flashprinter将pdf转换成SWF的问题
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Drawing;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication1{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void Form1_Load(object sender, EventArgs e)        {            ConvertPdfToSwf(@"pdf\2010xrss.pdf", @"swf\temp.swf");            convertPDFToSwf(@"pdf\2010xrss.pdf", @"swf\temp.swf");            ConvertPdfToSwf(@"pdf\2010xrss.pdf", @"swf\temp.swf");        }        public void ConvertPdfToSwf(string inFilename, string swfFilename)        {            try            {                string flashPrinter = string.Concat(AppDomain.CurrentDomain.BaseDirectory, @"FlashPaper2.2\FlashPrinter.exe");                ProcessStartInfo startInfo = new ProcessStartInfo(flashPrinter);                startInfo.Arguments = string.Concat(AppDomain.CurrentDomain.BaseDirectory + inFilename, " -o ", AppDomain.CurrentDomain.BaseDirectory+swfFilename);                Process process = new Process();                process.StartInfo = startInfo;                bool isStart = process.Start();                process.WaitForExit();                process.Close();            }            catch (Exception ex)            {                            }        }        public static void convertPDFToSwf(string PDFPath, string SWFPath)        {            string exe = string.Concat(AppDomain.CurrentDomain.BaseDirectory, @"FlashPaper2.2\FlashPrinter.exe");            if (!File.Exists(ex