Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Jan. 24, 2014, 7:32 p.m., Albert Astals Cid wrote: is it crashing for you without the patch? Because if it is not, you know that you are creating some qwidget in a bad thread, use gdb and try to find out where that's happening. Hello? Anyone in there? - Albert --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review48243 --- On Jan. 22, 2014, 7:39 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 22, 2014, 7:39 p.m.) Review request for Okular. 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 - 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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review48243 --- is it crashing for you without the patch? Because if it is not, you know that you are creating some qwidget in a bad thread, use gdb and try to find out where that's happening. - Albert Astals Cid On Jan. 22, 2014, 7:39 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 22, 2014, 7:39 p.m.) Review request for Okular. 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 - 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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- 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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Jan. 13, 2014, 10:48 p.m., Albert Astals Cid wrote: ui/minibar.h, line 130 https://git.reviewboard.kde.org/r/111410/diff/9/?file=233890#file233890line130 I'd appreciate if you did not revert my code. Sorry, that must have been an accidential change. I must have made the patch based on some older master code. I just removed the lines changing minibar and will upload a new patch. - Thomas --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review47351 --- On Jan. 12, 2014, 10:46 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 12, 2014, 10:46 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp fa6345f core/generator.h 3cf40c2 core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 839a324 ui/minibar.h 5654ad8 ui/minibar.cpp 6a501b8 ui/pageview.cpp 65967bf Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 14, 2014, 10:46 a.m.) Review request for Okular. Changes --- Removing patch lines that affect minibar. 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 fa6345f core/generator.h 3cf40c2 core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 839a324 ui/pageview.cpp 65967bf Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review47351 --- ui/minibar.h https://git.reviewboard.kde.org/r/111410/#comment33714 I'd appreciate if you did not revert my code. - Albert Astals Cid On Jan. 12, 2014, 9:46 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 12, 2014, 9:46 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp fa6345f core/generator.h 3cf40c2 core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 839a324 ui/minibar.h 5654ad8 ui/minibar.cpp 6a501b8 ui/pageview.cpp 65967bf Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Oct. 15, 2013, 12:33 a.m., Albert Astals Cid wrote: generators/poppler/generator_pdf.cpp, line 1538 https://git.reviewboard.kde.org/r/111410/diff/8/?file=185148#file185148line1538 This needs to be made async, this will potentiall freeze the UI for a while depending on what we ask pdftocairo to do. That obviously means you can't return a bool, but should probably return something like a KJob. Yes, i know the old export doesn't do that, but the fact that we did it wrong before is not an excuse for doing it wrong now :-) I will upload a new patch soon. It should address the three issues, except for that I have problems linking the code (undefined reference to `vtable for PDFGenerator'). Maybe you can see what the problem is ... - Thomas --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review41759 --- On Aug. 27, 2013, 10:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 10:11 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 12, 2014, 10:46 p.m.) Review request for Okular. Changes --- New patch, addresses the comments up to the introduction of KJob as a return value for exportPageRangeTo and exportSinglePageRegionTo. The code compiles, but linking fails with some cryptic vtable error. 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 fa6345f core/generator.h 3cf40c2 core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 839a324 ui/minibar.h 5654ad8 ui/minibar.cpp 6a501b8 ui/pageview.cpp 65967bf Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Oct. 14, 2013, 10:33 p.m., Albert Astals Cid wrote: generators/poppler/generator_pdf.cpp, line 1538 https://git.reviewboard.kde.org/r/111410/diff/8/?file=185148#file185148line1538 This needs to be made async, this will potentiall freeze the UI for a while depending on what we ask pdftocairo to do. That obviously means you can't return a bool, but should probably return something like a KJob. Yes, i know the old export doesn't do that, but the fact that we did it wrong before is not an excuse for doing it wrong now :-) Thomas Fischer wrote: I will upload a new patch soon. It should address the three issues, except for that I have problems linking the code (undefined reference to `vtable for PDFGenerator'). Maybe you can see what the problem is ... You usually get that where some .moc problem is happening. Make sure you have a clean build. - Albert --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review41759 --- On Jan. 12, 2014, 9:46 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Jan. 12, 2014, 9:46 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp fa6345f core/generator.h 3cf40c2 core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 839a324 ui/minibar.h 5654ad8 ui/minibar.cpp 6a501b8 ui/pageview.cpp 65967bf Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Dec. 29, 2013, 8:49 p.m., Albert Astals Cid wrote: Thomas, did you see my comments? Are you planning to keep working on this? I had started to work on this a few months ago, hit some issues, got occupied with other things, forgot about it. Maybe I can resume during the weekend... - Thomas --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review46409 --- On Aug. 27, 2013, 10:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 10:11 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/#review46409 --- Thomas, did you see my comments? Are you planning to keep working on this? - Albert Astals Cid On Aug. 27, 2013, 8:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 8:11 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: https://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review41759 --- generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment30484 for reading ease i'd appreciate if this was two lines. generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment30485 Does this give you the right info for files opened in http::/ ? generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment30486 This needs to be made async, this will potentiall freeze the UI for a while depending on what we ask pdftocairo to do. That obviously means you can't return a bool, but should probably return something like a KJob. Yes, i know the old export doesn't do that, but the fact that we did it wrong before is not an excuse for doing it wrong now :-) - Albert Astals Cid On Aug. 27, 2013, 8:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 8:11 p.m.) Review request for Okular. 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review38896 --- I'm going to be on holiday most of september, so unless someone else takes care of this review you'll have to wait until I come back. - Albert Astals Cid On Aug. 27, 2013, 8:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 8:11 p.m.) Review request for 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 27, 2013, 8:11 p.m.) Review request for Okular. Changes --- Addressing aacid's comments on diff revision #7 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 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 0d6c567 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review38084 --- generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment28164 Any reason you made m_pdfToCairoSinglePageFormatsAlreadySearched class static while formats is function static? Seems a bit confusing to me - Albert Astals Cid On Aug. 17, 2013, 9:11 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 17, 2013, 9:11 p.m.) Review request for 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 5944072 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On Aug. 16, 2013, 10:18 p.m., Albert Astals Cid wrote: core/generator.h, line 395 http://git.reviewboard.kde.org/r/111410/diff/6/?file=181596#file181596line395 Why are these not const anymore? Constructing an instance of QProcess to run pdftocairo requires passing a non-const QObject pointer and this is used. I changed it to creating the instance without a parent. - Thomas --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review38002 --- On Aug. 16, 2013, 9:17 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 16, 2013, 9:17 p.m.) Review request for 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 5944072 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 17, 2013, 9:11 p.m.) Review request for Okular. Changes --- Addressing recent comments: re-introducing const-ness, making search for pdftocairo binary lazy, ... 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 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 5944072 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 16, 2013, 9:17 p.m.) Review request for Okular. Changes --- Updating the patch according to the comments by Albert Astals Cid. 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 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 5944072 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review38002 --- core/generator.h http://git.reviewboard.kde.org/r/111410/#comment28097 Why are these not const anymore? generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment28098 Not sure how expensive this is, but maybe only search it once in exportFormatsSignlePAgeRegion? You can have a static bool so that you only search it once, and have pdftoCaitoBinary also be static so there's only one in memory even if you have N open pdf files generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment28099 Maybe also a static bool named alreadySearched, just in case the binary is there but none of the options is supported? - Albert Astals Cid On Aug. 16, 2013, 9:17 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated Aug. 16, 2013, 9:17 p.m.) Review request for 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 - core/document.h fe296e0 core/document.cpp 3af92c8 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 1a44523 ui/pageview.cpp 5944072 Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review37809 --- So yes, this is going in the right direction, there's lots of things to do (actually you have a todo). Some comments below core/document.h http://git.reviewboard.kde.org/r/111410/#comment27989 Can you add since markers to the new functions in core/ public header files? New okular version will be 0.18 core/generator.h http://git.reviewboard.kde.org/r/111410/#comment27990 @since markers here too core/generator.cpp http://git.reviewboard.kde.org/r/111410/#comment27991 Is it Joint? generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment27992 Not sure calling this before main and the other KComponent stuff is created is a good idea, i'd prefer if you fill it in the constructor generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment27993 Something's wrong with the indentation generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment27994 You don't need pdftocairo to export to pdf or ps, poppler knows how to do that. generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment27996 This is interesting, since pdftocairo not always support svg, if you look at the code it is surrounded by #if CAIRO_HAS_SVG_SURFACE Maybe you should grep pdftocairo -h (k) output to make sure it supports svg? generators/poppler/generator_pdf.cpp http://git.reviewboard.kde.org/r/111410/#comment27995 indentation is wrong here again - Albert Astals Cid On July 23, 2013, 9:26 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 23, 2013, 9:26 p.m.) Review request for 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 - core/document.h fe296e0 core/document.cpp 6731d87 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 122ece5 ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 23, 2013, 9:24 p.m.) Review request for Okular. Changes --- This patch refactors the export to be inside the generators. The dialog to cancel does not yet exist. This new implementation hooks into the existing selection extract menu actions and uses the generator instead of the existing general implemenation when possible as the generator-based implemenation may offer more features (more file formats or higher resolutions). 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 6731d87 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 122ece5 ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 23, 2013, 9:26 p.m.) Review request for Okular. Changes --- Previous upload had wrong diff. Hopefully more luck this time... 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 6731d87 core/generator.h a5a971b core/generator.cpp 41beb92 generators/poppler/generator_pdf.h 5d5853a generators/poppler/generator_pdf.cpp 122ece5 ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On July 7, 2013, 10:31 p.m., Albert Astals Cid wrote: 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. That is not true, the the extraction of images and text is properly abstracted in the generator class and each file-type backend implements it in its own, or do you see the code that handles pdf text extraction in pageview.cpp? Albert Astals Cid wrote: So at Akademy we did a BoF about Okular, the decision about this feature was: * It is acceptable to call pdftocairo * The current way of organizing the code is not acceptable, it needs to be a generator supported feature, i.e. there needs to be API in generators so that they can say if they support this feature or not and if they do the code has to be in the generator side * The one second time limit needs to be removed and instead a dialog saying Exporting with a cancel button in case the process decides to run forever Do you think you can work in these improvements? Any question on how to proceed? I agree that the current code isn't really well-integrated. I will look into how to refactor the code to follow the generator structure. The exporting dialog can be added in a second step. I haven't looked into the details yet, but I'll contact you if I have problems. - Thomas --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review35702 --- On July 7, 2013, 10:22 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 7, 2013, 10:22 p.m.) Review request for 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 - ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On July 7, 2013, 10:31 p.m., Albert Astals Cid wrote: 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. That is not true, the the extraction of images and text is properly abstracted in the generator class and each file-type backend implements it in its own, or do you see the code that handles pdf text extraction in pageview.cpp? So at Akademy we did a BoF about Okular, the decision about this feature was: * It is acceptable to call pdftocairo * The current way of organizing the code is not acceptable, it needs to be a generator supported feature, i.e. there needs to be API in generators so that they can say if they support this feature or not and if they do the code has to be in the generator side * The one second time limit needs to be removed and instead a dialog saying Exporting with a cancel button in case the process decides to run forever Do you think you can work in these improvements? Any question on how to proceed? - Albert --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review35702 --- On July 7, 2013, 10:22 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 7, 2013, 10:22 p.m.) Review request for 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 - ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
--- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 7, 2013, 10:22 p.m.) Review request for Okular. Changes --- 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. 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) - ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 111410: Selection tool: copy/extract as vector graphic by calling pdftocairo
On July 6, 2013, 6:11 p.m., Albert Astals Cid wrote: Sincerely, i understand you may find this useful, but I am not sure this makes much sense, it's just feature creep, anyway, even if it does make sense, 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, 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 s/it's just feature creep/I think it's a bit of feature creep - Albert --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/#review35667 --- On July 5, 2013, 10:10 p.m., Thomas Fischer wrote: --- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111410/ --- (Updated July 5, 2013, 10:10 p.m.) Review request for 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 - ui/pageview.cpp 16b00ab Diff: http://git.reviewboard.kde.org/r/111410/diff/ Testing --- Thanks, Thomas Fischer ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel