private string OfficeToPdf(string fullPathName, string destPath) { string fileNameWithoutEx = Path.GetFileNameWithoutExtension(fullPathName); string extendName = Path.GetExtension(fullPathName).ToLower(); string saveName = destPath + fileNameWithoutEx + ".pdf"; string returnValue = fileNameWithoutEx + ".pdf"; switch (extendName) { case ".doc": case ".docx": PreviewDocumetHelper.WordToPDF(fullPathName, saveName); break; case ".ppt": case ".pptx": PreviewDocumetHelper.PowerPointToPDF(fullPathName, saveName); break; case ".xls": case ".xlsx": PreviewDocumetHelper.ExcelToPDF(fullPathName, saveName); break; default: returnValue = ""; break; } return(returnValue); }
private string PictureToSwf(string toolpath, string fullPathName, string destPath) { string fileNameWithoutEx = Path.GetFileNameWithoutExtension(fullPathName); string extendName = Path.GetExtension(fullPathName).ToLower(); string saveName = destPath + fileNameWithoutEx + ".swf"; string returnValue = fileNameWithoutEx + ".swf"; if (extendName == ".gif") { PreviewDocumetHelper.GifPicturesToSwf(toolpath, fullPathName, saveName); } else { PreviewDocumetHelper.PicturesToSwf(toolpath, fullPathName, saveName); } return(returnValue); }
private string PdfToSwf(string pdf2swfPath, string PdfPath, string PdfName, string destPath) { string fullPathName = PdfPath + PdfName; string fileNameWithoutEx = Path.GetFileNameWithoutExtension(fullPathName); string extendName = Path.GetExtension(fullPathName).ToLower(); string saveName = destPath + fileNameWithoutEx + ".swf"; string returnValue = fileNameWithoutEx + ".swf";; if (extendName != ".pdf") { returnValue = ""; } else { PreviewDocumetHelper.PDFToSWF(pdf2swfPath, fullPathName, saveName); } return(returnValue); }