Program.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using DocumentFormat.OpenXml.Drawing;
  2. using HTEXLib;
  3. using HTEXLib.Builders;
  4. using HTEXLib.Controller;
  5. using HTEXLib.Models;
  6. using System;
  7. namespace HTEXTest
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. //<a:schemeClr val="dk1" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" />
  14. // RgbColorModelHex rgbColorModelHex = new RgbColorModelHex(" <a:prstClr val=\"black\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" />");
  15. string path = "F:\\PRD-20191015001-template-math.pptx";
  16. // string path = "F:\\PRD-20191015001.pptx";
  17. var htexBuilder = new HtexBuilder();
  18. var pptSlides = htexBuilder.GetPPTSlides(path);
  19. double width = htexBuilder.getSlideWidth();
  20. double height = htexBuilder.getSlideHeight();
  21. int slideCounter = 1;
  22. Htex htex= htexBuilder.Htex;
  23. htex.page = pptSlides.Count;
  24. htex.size = new HtexSize { width = width, height = height };
  25. foreach (PPTSlide pptSlide in pptSlides)
  26. {
  27. var htexController = new HtexController( pptSlide, slideCounter, pptSlides.Count)
  28. {
  29. SlideWidth = width,
  30. SlideHeight = height
  31. };
  32. htexController.GenerateHtex();
  33. slideCounter++;
  34. }
  35. htexBuilder.presentationDocument.Close();
  36. GC.Collect();
  37. }
  38. }
  39. }