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 2 months, 2 weeks ago.

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

    arun
    Participant

    HI,

    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

    #4194

    Eric White
    Keymaster

    Hi,

    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

    #4211

    Entropy
    Participant

    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

    Regards Mark

    #4212

    Entropy
    Participant

    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.

    #4218

    arun
    Participant

    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.