Results 1 to 3 of 3

Thread: QPrinter::PdfFormat html format && Link

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QPrinter::PdfFormat html format && Link

    I search a way to make link active on pdf export from qt.... && on future to make textinput field , combobox like latex
    \usepackage[bookmarks=false]{hyperref} to send and validate data to db or email...

    Now if i must make a link enable pdf ( manual how-to ecc.. ) i export html file with my qt apps
    svn co https://qt-webdav.svn.sourceforge.ne...v/html_editor/ html_editor
    && open html file on openoffice && export to pdf ...

    Is here a way to subclass QPrinter and make link active?

    The only way i know is xslt html2fop (apache fop processor) to make link ... and now fop can parse xforms standard to make input field...

    But i am sure QPrinter not required java to make the same job....


    Qt Code:
    1. void Edit_html::MakefilePrintPdf()
    2. {
    3. QString fileName = QFileDialog::getSaveFileName(this, "Export PDF",QString(setter.value("LastDir").toString()), "*.pdf");
    4. if (fileName.size() > 1) {
    5. QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    6. QPrinter printer(QPrinter::HighResolution);
    7. printer.setOutputFormat(QPrinter::PdfFormat);
    8. if (!fileName.endsWith(".pdf")) {
    9. fileName = fileName+".pdf";
    10. }
    11. QString ultimacartellaaperta = fileName.left(fileName.lastIndexOf("/"))+"/";
    12. setter.setValue("LastDir",ultimacartellaaperta);
    13. printer.setOutputFileName(fileName);
    14. wtext->document()->print(&printer); /* wtext qtextedit */
    15. if (is_file(fileName)) {
    16. QApplication::restoreOverrideCursor();
    17. OpenDesktop(QUrl(fileName));
    18. }
    19. }
    20. QApplication::restoreOverrideCursor();
    21. }
    To copy to clipboard, switch view to plain text mode 

    on openoffice 2 pdf export link show like this here....

    5 0 obj
    <</Type/Annot/Subtype/Link/Border[0 0 0]/Rect[69.5 766 376.4 784.5]/A<</Type/Action/S/URI/URI(http://www.qtcentre.org/component/option,com_weblinks/task,view/catid,14/id,27/)>>
    >>
    endobj
    On latex pdflatex textinput field look like this here....


    37 0 obj <<
    /Type /Annot
    /Rect [567.0667 284.7431 724.9647 298.6908]
    /Subtype /Widget /F 4 /T (FIELDNAME) /Q 0 /FT /Tx /BS << /W 1 /S /S >> /MK << /BC [0.85 0.85 0.85] /BG [0.89 0.94 0.95] >> /DA (/Helv 11 Tf 0 0 0 rg ) /DV () /V (VALUEDATAHUMAN) /AA << >>
    >> endobj
    on attachment the qt pdf output from copy & paste link section qtcentre.org
    and same from openoffice
    Attached Files Attached Files
    Last edited by jacek; 8th April 2007 at 14:11. Reason: changed [code] to [quote]

Similar Threads

  1. Html link color
    By sreedhar in forum Qt Programming
    Replies: 9
    Last Post: 5th September 2008, 14:36

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
  •  
Qt is a trademark of The Qt Company.