diff --git a/Test/Applications/TestDocsWithChart/TestDocsWithChart.sln b/Test/Applications/TestDocsWithChart/TestDocsWithChart.sln new file mode 100644 index 0000000000..b8fac88dc1 --- /dev/null +++ b/Test/Applications/TestDocsWithChart/TestDocsWithChart.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestDocsWithChart", "TestDocsWithChart\TestDocsWithChart.csproj", "{DCA199F3-B71C-4A23-B340-E0CE2C9B2893}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCA199F3-B71C-4A23-B340-E0CE2C9B2893}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCA199F3-B71C-4A23-B340-E0CE2C9B2893}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCA199F3-B71C-4A23-B340-E0CE2C9B2893}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCA199F3-B71C-4A23-B340-E0CE2C9B2893}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Test/Applications/TestDocsWithChart/TestDocsWithChart/App.config b/Test/Applications/TestDocsWithChart/TestDocsWithChart/App.config new file mode 100644 index 0000000000..fad249e406 --- /dev/null +++ b/Test/Applications/TestDocsWithChart/TestDocsWithChart/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test/Applications/TestDocsWithChart/TestDocsWithChart/Program.cs b/Test/Applications/TestDocsWithChart/TestDocsWithChart/Program.cs new file mode 100644 index 0000000000..33f7b47950 --- /dev/null +++ b/Test/Applications/TestDocsWithChart/TestDocsWithChart/Program.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO.Compression; +using System.IO; + +using System.Diagnostics; + +namespace TestDocsWithChart +{ + class Program + { + static void Main(string[] args) + { + //getFiles(); + convertFiles(); + } + static void getFiles() + { + string sDirInput = @"\\192.168.3.208\allusers\Files\PPTX"; + string sDirOutput = @"F:\Files\embedchart"; + String[] allfiles = System.IO.Directory.GetFiles(sDirInput, "*.*", System.IO.SearchOption.AllDirectories); + for (var i = 0; i < allfiles.Length; ++i) + { + string file = allfiles[i]; + try + { + ZipArchive zip = ZipFile.OpenRead(file); + foreach (ZipArchiveEntry entry in zip.Entries) + { + if (entry.FullName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase)) + { + System.IO.File.Copy(file, Path.Combine(sDirOutput, Path.GetFileName(file)), true); + } + } + } + catch { } + + } + } + static void convertFiles() + { + string sPattern = "*.docx"; + int outputformat = 0x41; + + string sDirInput = @"F:\Files\embedchart"; + string sDirOutput = @"F:\Files\embedchartRes"; + string sDirTemp = @"F:\Files\Temp"; + if (Directory.Exists(sDirTemp)) + Directory.Delete(sDirTemp, true); + string paramsXml = "192_168_3_169_0067df00e034b38d42be2cd7b4927430_dae13aaba3b34344836364699c0e2e71_4592{0}{1}{2}falseF:\\Subversion\\trunk\\OfficeWeb\\Fonts\\nativeF:\\Subversion\\trunk\\OfficeWeb\\PowerPoint\\themes2016-01-29T17:08:34.472Z"; + String[] allfiles = System.IO.Directory.GetFiles(sDirInput, sPattern, System.IO.SearchOption.AllDirectories); + for (var i = 0; i < allfiles.Length; ++i) + { + Directory.CreateDirectory(sDirTemp); + string file = allfiles[i]; + try + { + string paramsPath = Path.Combine(sDirTemp, "params.xml"); + string sTempFile = Path.Combine(sDirTemp, "Editor.bin"); + File.WriteAllText(paramsPath, string.Format(paramsXml, file, sTempFile, 0x2000)); + Process process = new Process(); + process.StartInfo.FileName = @"F:\Subversion\trunk\nodeJSProjects\FileConverter\Bin\x2t32.exe"; + process.StartInfo.Arguments = paramsPath; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + process.Start(); + process.WaitForExit(); + File.WriteAllText(paramsPath, string.Format(paramsXml, sTempFile, Path.Combine(sDirOutput, Path.GetFileName(file)), outputformat)); + process = new Process(); + process.StartInfo.FileName = @"F:\Subversion\trunk\nodeJSProjects\FileConverter\Bin\x2t32.exe"; + process.StartInfo.Arguments = paramsPath; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + process.Start(); + process.WaitForExit(); + } + catch + { + } + Directory.Delete(sDirTemp, true); + } + } + } +} diff --git a/Test/Applications/TestDocsWithChart/TestDocsWithChart/Properties/AssemblyInfo.cs b/Test/Applications/TestDocsWithChart/TestDocsWithChart/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..1da876fdbc --- /dev/null +++ b/Test/Applications/TestDocsWithChart/TestDocsWithChart/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TestDocsWithChart")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TestDocsWithChart")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c6998bc1-7662-4482-b844-5d965ba4fd4e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Test/Applications/TestDocsWithChart/TestDocsWithChart/TestDocsWithChart.csproj b/Test/Applications/TestDocsWithChart/TestDocsWithChart/TestDocsWithChart.csproj new file mode 100644 index 0000000000..3d91914bf0 --- /dev/null +++ b/Test/Applications/TestDocsWithChart/TestDocsWithChart/TestDocsWithChart.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {DCA199F3-B71C-4A23-B340-E0CE2C9B2893} + Exe + Properties + TestDocsWithChart + TestDocsWithChart + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file