Skip to content

sjefvanleeuwen/openxml-document-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenXML Document Generator

travis build

Generates documents from html into openxml standard.

The goal of this generator is to improve efficiency in the UX process.

  • Use an open standard XML
  • Use open standard HTML/CSS
  • Generate all document types from one central point
    • Web site
    • Print formats
  • Databind from one central point to generate these documents
  • Showcase the document process flow in BPMN Camunda tooling using ZDS.

More information on ZDS can be found at: https://github.com/VNG-Realisatie/gemma-zaken

Status of this project

The openAPI has a create document function and an /enqueue function, which uses hangfire for queing jobs in case you need to asynchronously generate documents. https://www.hangfire.io/

The default implementation is currently set to : LiteDB. LiteDB can be found at: https://github.com/mbdavid/LiteDB

more about hangfire can be found at:

Currently there's a "unit" test in place which generates a docx openxml document and showes that images are resolved in that document.

        public void can_convert_html_to_openxml_document()
        {
            var doc = File.ReadAllText(@".\data\letter.html");
            using (MemoryStream generatedDocument = new MemoryStream())
            {
                using (WordprocessingDocument package = WordprocessingDocument.Create(generatedDocument, WordprocessingDocumentType.Document))
                {
                    MainDocumentPart mainPart = package.MainDocumentPart;
                    if (mainPart == null)
                    {
                            mainPart = package.AddMainDocumentPart();
                            new Document(new Body()).Save(mainPart);
                    }
                    HtmlConverter converter = new HtmlConverter(mainPart);
                    converter.ParseHtml(doc);
                    mainPart.Document.Save();
                }
                // visually test this.
                File.WriteAllBytes(@".\test.docx", generatedDocument.ToArray());
            }
        }    
    }

More information on the camunda bpmn project (samples) can be found at: https://github.com/sjefvanleeuwen/camunda-process-examples

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Building Docker Images

docker-compose up --build -d

The API should now be reachable from:

  • SWAGGER - Swagger API documentation page
  • REDOC - Redoc API documentation page

Built With

  • VSCODE - The IDE used
  • DOCKER - Build, Ship, and Run Any App, Anywhere

Contributing

Pull requests are accepted

Authors

  • Sjef van Leeuwen - Initial work - github

License

This project is licensed under the GPL-V3 License - see the LICENSE.md file for details