Exemple #1
0
        public void TestReportFunc()
        {
            ProcessControl processControl = new ConcreteProcessControl();

            processControl.KillWordProcess();
            string      currDir         = AppDomain.CurrentDomain.BaseDirectory;
            string      fileFullName    = $@"{currDir}Demo\pdf导出.docx";
            string      outDirectoryUrl = $@"{currDir}NewFiles";
            FileControl fileControl     = new ConcreteFileControl();

            fileControl.CreateDirectory(outDirectoryUrl);
            string outFileFullName = $@"{currDir}NewFiles\{Guid.NewGuid()}.pdf";

            using (WordUtilExtensions wordUtil = new WordUtilExtensions(outFileFullName, fileFullName))
            {
                //wordUtil.AddTableTest();
            }

            Console.WriteLine("success");
            Console.ReadLine();
        }
Exemple #2
0
        public void conreteOperation()
        {
            ProcessControl processControl = new ConcreteProcessControl();

            processControl.KillWordProcess();
            string      currDir        = AppDomain.CurrentDomain.BaseDirectory;
            string      fileFullName   = string.Format(@"{0}Demo\标准模板(新).docx", currDir);
            string      outDirctoryUrl = string.Format(@"{0}NewFiles", currDir);
            FileControl fileControl    = new ConcreteFileControl();

            fileControl.CreateDirectory(outDirctoryUrl);
            string outFileFullName = string.Format(@"{0}NewFiles\{1}.docx", currDir, Guid.NewGuid().ToString());

            using (WordUtilExtensions wordUtil = new WordUtilExtensions(outFileFullName, fileFullName))
            {
                int result = wordUtil.AddOperation("bgbh");
                //wordUtil.GetBookmarkHeightProportion("bgbh");
            }

            Console.WriteLine("success");
            Console.ReadLine();
        }