12345678910111213141516171819202122232425262728293031323334353637383940 |
- using DocumentFormat.OpenXml.Drawing;
- using HTEXLib;
- using HTEXLib.Builders;
- using HTEXLib.Controller;
- using HTEXLib.Models;
- using System;
- namespace HTEXTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- //<a:schemeClr val="dk1" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" />
- // RgbColorModelHex rgbColorModelHex = new RgbColorModelHex(" <a:prstClr val=\"black\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" />");
- string path = "F:\\PRD-20191015001-template-math.pptx";
- // string path = "F:\\PRD-20191015001.pptx";
- var htexBuilder = new HtexBuilder();
- var pptSlides = htexBuilder.GetPPTSlides(path);
- double width = htexBuilder.getSlideWidth();
- double height = htexBuilder.getSlideHeight();
- int slideCounter = 1;
- Htex htex= htexBuilder.Htex;
- htex.page = pptSlides.Count;
- htex.size = new HtexSize { width = width, height = height };
- foreach (PPTSlide pptSlide in pptSlides)
- {
- var htexController = new HtexController( pptSlide, slideCounter, pptSlides.Count)
- {
- SlideWidth = width,
- SlideHeight = height
- };
- htexController.GenerateHtex();
- slideCounter++;
- }
- htexBuilder.presentationDocument.Close();
- GC.Collect();
- }
- }
- }
|