I am new to QT. I have another generic question. Is it necessary to extend the class with QWebPage and also initialize and exec QApplication from calling code?
"Never increase, beyond what is necessary, the number of entities required to explain anything" On Wed, Sep 1, 2010 at 4:20 PM, Shilpi <[email protected]> wrote: > Hi, > > I am using Qt-Jambi4.6.3 windows jars. > > This is what i am trying to do - > > I have written this class - > > public class Doc2PDFDemo2 extends QWebPage > { > QWebPage page ; > public Doc2PDFDemo2() > { > page = new QWebPage(); > } > > public void print() > { > page.loadFinished.connect(this, "loadFinished()"); > page.mainFrame().load(new QNetworkRequest(new QUrl(" > https://xhtmlrenderer.dev.java.net/"))); > } > > public void loadFinished() > { > page.setViewportSize(page.mainFrame().contentsSize()); > > QPrinter printer = new QPrinter(); > printer.setOutputFileName("output-QtWebKit.pdf"); > printer.setOutputFormat(QPrinter.OutputFormat.PdfFormat); > page.mainFrame().print(printer); > System.exit(0); > } > } > > And then in calling class i write this in main method - > > public static void main(String args[]) > { > QApplication.initialize(args); > Doc2PDFDemo2 widget = new Doc2PDFDemo2(); > widget.print(); > > QApplication.exec(); > } > > > The URL I tried is this - https://xhtmlrenderer.dev.java.net/ > > Now if you open this url in browser, and run this code the generated pdf > does not contain the left hand side frame. > > Also links are not working. > > Thanks, > Shilpi > > > > On Wed, Sep 1, 2010 at 3:30 PM, > <[email protected]>wrote: > >> Send Qt-jambi-interest mailing list submissions to >> [email protected] >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest >> or, via email, send a message with subject or body 'help' to >> [email protected] >> >> You can reach the person managing the list at >> [email protected] >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Qt-jambi-interest digest..." >> >> >> Today's Topics: >> >> 1. help on webFrame.print(printer) method (Shilpi) >> 2. Re: help on webFrame.print(printer) method (Helge Fredriksen) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Wed, 1 Sep 2010 12:01:22 +0530 >> From: Shilpi <[email protected]> >> Subject: [Qt-jambi-interest] help on webFrame.print(printer) method >> To: [email protected] >> Message-ID: >> <[email protected]> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi, >> >> I am trying to do use print method from WebFrame. the output pages are >> not >> coming complete. some or the other frames go missing. >> >> Can someone please suggest, what can be wrong? >> >> Thanks >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> http://lists.trolltech.com/pipermail/qt-jambi-interest/attachments/20100901/f7cc0ce6/attachment-0001.html >> >> ------------------------------ >> >> Message: 2 >> Date: Wed, 01 Sep 2010 10:36:53 +0200 >> From: Helge Fredriksen <[email protected]> >> Subject: Re: [Qt-jambi-interest] help on webFrame.print(printer) >> method >> To: [email protected] >> Message-ID: <[email protected]> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Hello! >> >> Could you post a code sample demonstrating the problem? Also, it would >> be useful with some system description / version of QtJambi you're using. >> >> Regards, >> Helge Fredriksen >> >> On 09/01/2010 08:31 AM, Shilpi wrote: >> > Hi, >> > >> > I am trying to do use print method from WebFrame. the output pages >> > are not coming complete. some or the other frames go missing. >> > >> > Can someone please suggest, what can be wrong? >> > >> > Thanks >> > >> > >> > _______________________________________________ >> > Qt-jambi-interest mailing list >> > [email protected] >> > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest >> > >> >> >> >> ------------------------------ >> >> _______________________________________________ >> Qt-jambi-interest mailing list >> [email protected] >> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest >> >> >> End of Qt-jambi-interest Digest, Vol 32, Issue 1 >> ************************************************ >> > >
_______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
