Skip to content

Codeuctivity/OpenXmlPowerTools

 
 

Repository files navigation

OpenXmlPowerTools

.NET build and test Nuget

Focus of this fork

  • Linux, Windows and MacOs support was added by this fork
  • Conversion of DOCX to HTML/CSS

Known missing features - Conversion of DOCX to HTML/CSS

Example - Convert DOCX to HTML

var sourceDocxFileContent = File.ReadAllBytes("./source.docx");
using var memoryStream = new MemoryStream();
await memoryStream.WriteAsync(sourceDocxFileContent, 0, sourceDocxFileContent.Length);
using var wordProcessingDocument = WordprocessingDocument.Open(memoryStream, true);
var settings = new WmlToHtmlConverterSettings("htmlPageTitle");
var html = WmlToHtmlConverter.ConvertToHtml(wordProcessingDocument, settings);
var htmlString = html.ToString(SaveOptions.DisableFormatting);
File.WriteAllText("./target.html", htmlString, Encoding.UTF8);

Other features

  • Splitting DOCX/PPTX files into multiple files.
  • Combining multiple DOCX files into a single file.
  • Populating content in template DOCX files with data from XML.
  • Conversion of HTML/CSS to DOCX.
  • Searching and replacing content in DOCX/PPTX using regular expressions.
  • Managing tracked-revisions, including detecting tracked revisions, and accepting tracked revisions.
  • Updating Charts in DOCX/PPTX files, including updating cached data, as well as the embedded XLSX.
  • Retrieving metrics from DOCX files, including the hierarchy of styles used, the languages used, and the fonts used.
  • Writing XLSX files using far simpler code than directly writing the markup, including a streaming approach that enables writing XLSX files with millions of rows.
  • Extracting data (along with formatting) from spreadsheets.

Development

  • Run dotnet build OpenXmlPowerTools.sln

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 68.7%
  • HTML 31.1%
  • PowerShell 0.2%