1. 21 Oct, 2019 1 commit
    • Harald Sitter's avatar
      don't crash on nullptr pdfOptionsPage · 568f11b0
      Harald Sitter authored
      Summary:
      same as in fbeff5ae there may not be
      a pdfOptionsPage when using print preview.
      
      this fixes an exciting crash on our windows build when trying to print
      preview
      
      Test Plan: can't easily build on windows but the traceback definitely falls over 0x0000 on that line, so given context I am confident this fixes the crash
      
      Reviewers: aacid
      
      Reviewed By: aacid
      
      Subscribers: okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D24696
      568f11b0
  2. 22 Jun, 2019 2 commits
  3. 22 May, 2019 2 commits
  4. 15 Apr, 2019 1 commit
    • Michael Weghorn's avatar
      PDF: Implement scaling options for non-rasterized printing · 748884b4
      Michael Weghorn authored and Nate Graham's avatar Nate Graham committed
      Summary:
      This adds another 'FilePrinter::printFile' method that
      accepts an additional parameter to specify whether or not to
      do scaling and passes the 'fit-to-page' to CUPS dependent
      on what is specified.
      
      If FilePrinter is used, The PDF generator now passes this
      option depending on the scaling mode that was selected in the
      custom print options widget, which is therefore now enabled
      for non-rasterized printing as well.
      
      Test Plan:
      1) open a PDF document in Okular and open the print dialog
      2) go to the "PDF Options" tab
      3) verify that "Force rasterisation" is disabled, but the
        "Scale mode" combobox is active.
      4) test all the three options available in the "Scale mode"
         combobox do what they say
      5) Make sure the three options still work as expected for
         the "Force rasterisation" case.
      
      Reviewers: #okular, ngraham, sander
      
      Reviewed By: ngraham
      
      Subscribers: aacid, fvogt, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D18179
      748884b4
  5. 03 Apr, 2019 1 commit
    • Michael Weghorn's avatar
      Add option to ignore print margins for non-PDF generators · 8bf1a911
      Michael Weghorn authored and Nate Graham's avatar Nate Graham committed
      Summary:
      This adds a combobox in the print dialog of the non-PDF
      generators to allow selecting whether or not to take
      print margins into account.
      
      For the PDF case and rasterized printing, new print otions have
      been implemented in commit 2e97d587
      already, which adds an additional option to do no scaling at all.
      
      For consistency reasons, the same terms also used for the PDF
      case are used in the combobox (i.e. the two of the three that
      apply).
      
      This adds a new abstract class 'PrintOptionsWidget' with a
      'ignorePrintMargins()' method to indicate whether print margins
      should be ignored or not, and a default implementation.
      The existing widget for the PDF generator now derives from this
      class.
      
      In order to avoid an ABI breakage, the return value of
      'Document::printConfigurationWidget' is left as a 'QWidget *'
      and a dynamic_cast is done on use.
      
      FilePrinter is adapted to take into account the value set by
      'QPrinter::setFullPage()' and the margin options
      are now passed accordingly (either the values set in the dialog or '0').
      
      A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
      to extend the initial implementation to cover more generators.
      
      Test Plan:
      1) Open a PostScript file in Okular (using a document size that matches
        a paper size available on the printer used later makes it easier
        to see things behave as expected)
      
      2) open print dialog, go to "Print options" and notice that there is a new
        "Scale mode" combobox whose value is set to "Fit to printable area"
         by default.
      
      3) don't change any options, print to a printer that has hardware margins
      
      Expected result: the document is scaled to the printable area (e.g.
      scaled down so that the printer's hardware margins remain empty) as it
      has been without this change.
      
      4) Set the value of the "Print Options" -> "Scale mode" combobox to
         "Fit to full page" and print again
      
      Expected result: The document is scaled to the full page size, i.e. ignoring
      the printer's hardware margins.
      
      5) Try steps 1-4 with other document formats supported by Okular and
         observe that they behave the same (except for the PDF case, where
         there's a combobox with three options that has been implemented
         independent of this change).
      
      Reviewers: #okular, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D10974
      8bf1a911
  6. 13 Feb, 2019 1 commit
  7. 04 Feb, 2019 1 commit
  8. 10 Jan, 2019 1 commit
    • Chinmoy Pradhan's avatar
      Implement digital signature support for PDF · a234a902
      Chinmoy Pradhan authored and Albert Astals Cid's avatar Albert Astals Cid committed
      This is a squash of the original branch
      
      It also contains fixes/rework from Albert Astals Cid
      
      If you're interested in its history have a look at the
      gsoc2018_digitalsignature branch
      
      The poppler dependency situation is:
       * With 0.51 you get most signature information
       * With 0.68 you also get signature location/reason information
       * With 0.73 you also get signature certificate information
      a234a902
  9. 30 Dec, 2018 1 commit
  10. 23 Dec, 2018 1 commit
  11. 18 Dec, 2018 2 commits
  12. 31 Aug, 2018 1 commit
  13. 26 Aug, 2018 1 commit
    • Albert Astals Cid's avatar
      Fix links being "lost" on save · 0a8d2f7f
      Albert Astals Cid authored
      Summary:
      We need to regenerate the links when switching the file
      since we won't re-render the pages since we already have
      them and link generation is on page render
      
      BUG: 397373
      
      Reviewers: tobiasdeiminger
      
      Reviewed By: tobiasdeiminger
      
      Subscribers: tobiasdeiminger, sander, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D14752
      0a8d2f7f
  14. 17 Aug, 2018 1 commit
  15. 30 Apr, 2018 1 commit
  16. 23 Apr, 2018 1 commit
  17. 14 Feb, 2018 1 commit
  18. 01 Feb, 2018 1 commit
  19. 16 Nov, 2017 1 commit
  20. 15 Nov, 2017 1 commit
  21. 13 Nov, 2017 1 commit
  22. 09 Nov, 2017 1 commit
  23. 26 Oct, 2017 2 commits
    • Albert Astals Cid's avatar
      When saving a file that had password we will reload it · b2673a58
      Albert Astals Cid authored
      Also tweak error messages a bit
      b2673a58
    • Albert Astals Cid's avatar
      Implement swapBackingFile for the PDF backend · ca5422d0
      Albert Astals Cid authored and Albert Astals Cid's avatar Albert Astals Cid committed
      How does it work:
       * What it does is really closing and opening the file again through poppler
       * This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
      	* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
      		* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
      	* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
      	* The annotationmodel needs updating it's pointers
      	* The widgets for the forms are reused and their form* updated
      	* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)
      
      TODO: Make this work for .okular files
      TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
      TODO: autotests
      ca5422d0
  24. 07 Sep, 2017 1 commit
    • Oliver Sander's avatar
      Implement rasterized printing with QPrinter with hidden annotations · 5a716e06
      Oliver Sander authored
      Previously, rasterized printing would use the QPrinter backend whenever
      annotations were to be printed, and fall back to the convert-to-ps
      toolchain otherwise.  Effectively, this meant that printing on
      windows without showing the annotations was not possible (because
      on windows only the QPrinter can be used for printing).
      
      Starting with poppler 0.60, there is a way to disable annotation
      rendering for the renderToImage and renderToPainter methods that
      are used by QPrinter.  This patch makes use of this new option,
      making printing on windows without annotations possible.
      
      Differential Revision: https://phabricator.kde.org/D7688
      5a716e06
  25. 10 Aug, 2017 1 commit
    • Oliver Sander's avatar
      Print via QPrinter when rasterizing and printing annotations · 0c4c2ddb
      Oliver Sander authored
      When the user chooses to print with rasterization and annotations,
      it is easy to print directly to a QPrinter, rather than converting
      to PostScript and then using CUPS tools.  The code for it was
      already there, but it was hidden behind an #ifdef Q_OS_WIN.
      This patch enables it for all plattforms.  If nothing else,
      it will make an interesting debugging tool, because it allows
      to bypass the postscript & CUPS toolchain from the GUI.
      This may allow to track down some of the numerous my-printer-settings-
      are-getting-ignored bugs.
      
      The previously windows-only rasterization code used printer.physicalDpiX()
      as the rasterization resolution.  At least on my machine this resulted
      in a dpi value of 1200, which means quite a lot of memory is used.
      I left the windows code untouched, but on Unix I lowered that value
      to 300dpi, which is what the postscript rasterizer uses.
      
      Incidentally, this patch does fix at least one bug for me:
      Without it, my printer will happily ignore the 'print in grayscale'
      button.  With the patch, that button is suddenly honoured.
      
      REVIEW: 130218
      0c4c2ddb
  26. 03 Mar, 2017 2 commits
  27. 02 Mar, 2017 1 commit
  28. 16 Jan, 2017 1 commit
  29. 22 Dec, 2016 1 commit
  30. 27 Nov, 2016 1 commit
  31. 26 Nov, 2016 3 commits
  32. 29 Oct, 2016 1 commit
  33. 13 Jul, 2016 1 commit