private string SaveSwfFile(string pdfFileName)
        {
            var uploadDateTime = DateTime.Now;

            string webPath = String.Format("~/upload/Swf/{0:yyyyMMdd}", uploadDateTime);
            string path    = Server.MapPath(webPath);

            if (!System.IO.Directory.Exists(path))
            {
                // 目录不存在,则创建.
                System.IO.Directory.CreateDirectory(path);
            }

            string swfFileName = String.Format("{0:yyyyMMdd}/{0:yyyyMMddHHmmss}.swf", uploadDateTime);


            string pdfFilePhysicalPath = Server.MapPath("~/Upload/Pdf/" + pdfFileName);
            string swfFilePhysicalPath = Server.MapPath("~/Upload/Swf/" + swfFileName);


            // Pdf2Swf
            Pdf2SwfConverter converter = new Pdf2SwfConverter();

            bool result = converter.Pdf2Swf(pdfFilePhysicalPath, swfFilePhysicalPath);


            return(swfFileName);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Pdf2SwfConverter converter = new Pdf2SwfConverter();

            bool result = converter.Pdf2Swf("Pdf/django10-cheat-sheet.pdf", "Swf/django10-cheat-sheet.swf");


            Console.WriteLine("Finish! " + result);


            Console.ReadLine();
        }