printing of DOCX from C++

Home Forums WordprocessingML printing of DOCX from C++

This topic contains 5 replies, has 4 voices, and was last updated by  dylancorbyn 11 months, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #4183



    can you please provide me the sample code to print docx via C++ code or any API which can be used to do this task.

    thank you


    Eric White


    As far as I know, there is no open source API to do this.

    You could use the WmlToHtmlConverter module in Open-Xml-PowerTools to convert DOCX to HTML/CSS, and then use some API to print it. I have no experience with using any APIs to print HTML/CSS, but I am certain it is possible. This would have the restrictions of WmlToHtmlConverter, in that it does not display page headers/footers.

    Best, Eric



    If this helps, I use a copy of LibreOffice to do the printing because I can call it from the command line.

    soffice.exe –headless –pt LaserJet1320 “C:\temp\filetoprint.docx”

    the headless option runs LibreOffice without the user interface. In LibreOffice 5.3 there is documentation for the C++ API here

    Regards Mark



    it seems hard to read in my previous post but the syntax is “dash dash headless” (–headless) “dash dash pt” (–pt). Alternatively a dash p (-p) prints the the default printer.



    Thank you, will check this option.



    I am also in need of this, I really appreciate that I found it here. Thanks and hopefully I can use this stuff for all my business printing needs, which now I have this print at

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.