Results 1 to 5 of 5

Thread: how to convert a xml + xsl to PDF in Qt4.4.3

  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default how to convert a xml + xsl to PDF in Qt4.4.3

    Hi,

    My program outputs xml file and xsl file. The xml can be displayed properly in web broswer. I would like to convert xml to PDF sliently without showing in web browser, is it possible to do it with Qt4.4.3?

    If not, do you know any way or other version Qt to do it?

    thank you!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to convert a xml + xsl to PDF in Qt4.4.3

    Yes, it's possible. Take a look at QPrinter docs. Make sure to search for "PDF", there's an example how to print to a PDF file.
    J-P Nurmi

  3. #3
    Join Date
    Dec 2008
    Posts
    68

    Default Re: how to convert a xml + xsl to PDF in Qt4.4.3

    I can understand how to print to a PDF. the difficult part is how to render xml and xsl files and pass the result to QPrinter.

    The webbrowser can do the rendering. Can any class in Qt4.4 or following version do this?

    thank you!

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to convert a xml + xsl to PDF in Qt4.4.3

    You can use QTextDocument. There's a simple XML highlighter example in our wiki: [WIKI]XmlHighlighter[/WIKI].

    EDIT: PS. Notice QTextDocument::print().
    Last edited by jpn; 10th January 2009 at 10:39. Reason: updated contents
    J-P Nurmi

  5. #5
    Join Date
    Dec 2008
    Posts
    68

    Default Re: how to convert a xml + xsl to PDF in Qt4.4.3

    QTextDocument can only manipulate the text in XML file. What I want to do is convert the result of xml/xsl ( as what can be seen in a browser, with tables, images, etc) to a PDF. BTW, can qwebview load xml/xsl file and display it as other web browsers like iexplorer/firefox?

    Thank you!

Similar Threads

  1. Replies: 4
    Last Post: 2nd January 2009, 06:27
  2. How convert my Qt projet in KDE project?
    By alpha_one_x86 in forum KDE Forum
    Replies: 2
    Last Post: 11th August 2008, 07:14
  3. convert ebcdic to ascii
    By jaca in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2008, 20:49
  4. Read binary file and convert to QString
    By jaca in forum Qt Programming
    Replies: 12
    Last Post: 13th June 2008, 23:05
  5. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.