[Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling "pdftocairo"

Thomas Fischer fischer at unix-ag.uni-kl.de
Wed Jan 22 19:39:34 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/111410/
-----------------------------------------------------------

(Updated Jan. 22, 2014, 8:39 p.m.)


Review request for Okular.


Changes
-------

Patch uses a class derived from KJob to encapsulate potentially long-running calls to pdftocairo.

Code compiles and starts, but when opening a .pdf file, Okular crashes with the following output on the command line (program was installed in /tmp/kde-usr):

ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel/qwidget.cpp, line 1301
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = okular path = /tmp/kde-usr/bin pid = 14074
KCrash: Arguments: /tmp/kde-usr/bin/okular --nocrashhandler /home/tf/test.pdf 
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/tf/.kde4/socket-corvus/kdeinit4__0
okular: Fatal IO error: client killed


Repository: okular


Description
-------

This patch implements the feature request of bug 321350: if a PDF file is viewed, the selection tool offers the new extraction method "vector" which allows to save to a file (PDF, SVG, EPS, PostScript). The crop operation is performed by calling "pdftocairo" with matching arguments. The resulting file contains the original PDF file's content without rendering it to a pixmap.

I am not sure if calling an external program is an acceptable solution for this problem. However, it is tested if the program is available before showing the new option. Alternatively, the code of pdftocairo (as part of poppler) would had to be copied and integrated into Okular increasing the solution's complexity. I am not aware of a similar solution available using poppler-qt4 only. Maybe using a QPrinter printing to PDF would have been an alternative, but again this seemed to be too complex.


Diffs (updated)
-----

  core/document.h fe296e0 
  core/document.cpp 19eaa70 
  core/generator.h 19c81d5 
  core/generator.cpp 23b274b 
  generators/poppler/generator_pdf.h eb91f66 
  generators/poppler/generator_pdf.cpp f08a571 
  ui/pageview.cpp 65967bf 

Diff: https://git.reviewboard.kde.org/r/111410/diff/


Testing
-------


Thanks,

Thomas Fischer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20140122/e88d26f7/attachment.html>


More information about the Okular-devel mailing list