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.
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.
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 http://api.libreoffice.org/docs/cpp/ref/index.html
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.
You must be logged in to reply to this topic.