printing of DOCX from C++

Home Forums WordprocessingML printing of DOCX from C++

This topic contains 4 replies, has 3 voices, and was last updated by  arun 3 weeks, 1 day ago.

Viewing 5 posts - 1 through 5 (of 5 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.

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

You must be logged in to reply to this topic.