Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Generate open document from template
Forum Updated to NodeBB v4.3 + New Features

Generate open document from template

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 756 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ckvsoft
    wrote on last edited by
    #1

    Hello

    I would like to generate a new document from an ODT template. To do so, placeholders would have to be filled out.
    Is there perhaps a class that I can use or do I have to write everything myself?

    I find heaps of classes for Java or PHP. If it knows who, tinybutstrong is a PHP class that would do just that. However, an ODT document with tables is enough.

    Does anyone know what?

    Thanks Chris

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      Open Documents are nothing more than zip files with xml and images in them (not sure on images). So if you have an ODT you can get the text out of it just by unzipping it and searching through the xml files. There is probably a spec for them somewhere. Maybe even code snippets.

      They are not complicated documents. I agree that a library is easier sometimes. I used Python to create a bunch of ODS files a while back. Let us know if you find a nice C++ lib. Or if you write a nice lib...

      One possibility is you could use WebEngine to run the PHP code to create documents. Heavy handed, yes, but doable.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      4
      • C Offline
        C Offline
        ckvsoft
        wrote on last edited by
        #3

        Thank you. That it is a zip file was clear to me. I hope that I find such a class. If not I have nothing else to write about myself.

        No, the PHP class was just one example ;-) But the class has a lot of unnecessary code. A port would be too much effort. I can do it myself better.

        lg Chris

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #4

          Hi,

          I think you might be interested by QTextDocumentWriter.

          Sorry, I misread ODT for ODF.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved