private static void ImageToPPTX(String path, String dest, String temp, Boolean bOpen) { // init List <String> list = new List <String>(); ImageToPPTXTemplateUtils converter = new ImageToPPTXTemplateUtils(); dest = String.IsNullOrEmpty(dest) ? (path + @"\output") : dest; // switch if (File.Exists(path)) { list.Add(path); } else if (Directory.Exists(path)) { foreach (string d in Directory.GetFileSystemEntries(path)) { if (!Directory.Exists(d) && File.Exists(d)) { list.Add(d); } } } else { throw new Exception("错误的文件路径"); } converter.convert(dest, list, temp); if (bOpen) { System.Diagnostics.Process.Start("explorer.exe", dest.Replace("\\\\", "\\").Replace("/", "\\")); } }
private static void PDFToPPTX() { PDFToPPTXUtils utils = new PDFToPPTXUtils(); ImageToPPTXTemplateUtils converter = new ImageToPPTXTemplateUtils(); string path = @"D:\资料备份\资料\工作\测试\ppt\customer\GMIC\pdf"; utils.convert(path + "\\1-(非公开)-简仁贤-竹间智能.pdf", path + "\\image"); //converter.convert(path + "\\ppt", utils.convert(path + "\\ZMER_BP.pdf", path + "\\image")); //System.Diagnostics.Process.Start("explorer.exe", path + "\\ppt"); }
private static void ImageToPPTX() { List <String> imgList = new List <String>(); ImageToPPTXTemplateUtils converter = new ImageToPPTXTemplateUtils(); string path = @"D:\data\soft\wechat\WeChat Files\yqjdcyy\Files\dpi-96-jpeg"; foreach (string d in Directory.GetFileSystemEntries(path)) { if (!Directory.Exists(d) && File.Exists(d)) { imgList.Add(d); } } converter.convert(path + @"\output", imgList); System.Diagnostics.Process.Start("explorer.exe", path + "\\output"); }
private static void PDFToPPTX_FromJava() { ImageToPPTXTemplateUtils converter = new ImageToPPTXTemplateUtils(); List <PPTPage> pageList = new List <PPTPage>(); string path = @"D:\资料备份\资料\工作\测试\pdf\ppt"; pageList.Add(new PPTPage() { Cover = @"D:\资料备份\资料\工作\测试\pdf\image\ZMER_BP.pdf_java\dpi-96-jpeg\0014.jpeg", PageUrlList = new List <PageUrl>() }); pageList.ForEach(p => { p.PageUrlList.Add(new PageUrl() { url = "http://www.sina.com", angle = 0, origin = new System.Drawing.Size() { Width = 0, Height = 0 }, size = new System.Drawing.Size() { Width = 100, Height = 50 } }); p.PageUrlList.Add(new PageUrl() { url = "http://www.google.com", angle = 0, origin = new System.Drawing.Size() { Width = 100, Height = 100 }, size = new System.Drawing.Size() { Width = 100, Height = 100 } }); }); converter.convert(path, pageList); }