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 7 years, 6 months ago.

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

    #4377

    dylancorbyn
    Participant

    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 http://www.digitekprinting.com/poster-prints.

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

You must be logged in to reply to this topic.