<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/111410/">http://git.reviewboard.kde.org/r/111410/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Okular.</div>
<div>By Thomas Fischer.</div>


<p style="color: grey;"><i>Updated July 7, 2013, 10:22 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">> it's not in the correct place, why is all this exporting
> functionality in pageview.cpp? If at all this should be
> integrated with the File->Export functionality and not be
> coded in pageview.cpp but in the proper appropiate backend
This is a misunderstanding. My code does not export whole pages (which File->Export implies and what pdftocairo supports, too), but only the user's selection just like the existing text and image extraction. I made some screenshots which should clarify the situation: http://imgur.com/iHxAws1,Vgjbb5l,VavhqMv (img #1: new context menu when selecting a region of a PDF page; img #2: bitmap as extract with the current "Image" solution; img #3: PDF file extract using the "Vector" option, opened in Okular)
The location of the code in pageview.cpp is therefore justified as the image and text extract code is located in the same class. However, I agree that pageview.cpp is rather large and should be refactored.

Having a vector graphic extract is an serious feature. As my screenshots document, if you want to extract a tiny piece of a PDF file, the existing bitmap feature gives you an image of the size as you see it. Inserting such bitmaps in other documents or slides results in badly scaled images. Obviously, a vector graphic does not suffer from this problem.

> I don't think calling an external tool is a good idea,
> but it is true it's the only "easy" way to provide the
> functionality
Indeed. As pdftocairo's code is Gtk-based, inserting it into Okular may cause problems on its own. The best solution I would see is if the Qt4 backend would support this feature or if a solution using QPrinter-to-PDF would work. I could investigate those two options, but only if there is a realistic chance that the result will be included in Okular.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>ui/pageview.cpp <span style="color: grey">(16b00ab)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/111410/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>