D7949: Allow to print pdf doc directly into a QPrinter

Henrik Fehlauer noreply at phabricator.kde.org
Sat Oct 14 06:27:17 UTC 2017


rkflx added a comment.


  > Implement all of Henrik's suggestions.
  
  Had a final look, looks mostly good to me now – thanks. See below for some minor nits. (Could not mark my old inline comments as done, I guess the original author has to do that…).
  
  > I implemented a longer "What's this" help, but I couldn't make it appear in the GUI. What's the magic button for that?
  
  Normally you can right-click or use the question mark tool in the dialog's title bar. However, this does not seem to work with combobox popups (some focus issue, it does work with normal menu popups, though). The easiest solution for this would be to move all of the text to the tooltip, with `\n` for line breaks. If you want to get fancy, you could switch to radio buttons or add a text area next to the combobox with the explanation (but not sure if worth it).
  
  ---
  
  >> page 21: parts of vector (?) illustration missing
  > 
  > A patch for this can be found at https://bugs.freedesktop.org/show_bug.cgi?id=103118
  
  Amazing :) (but does not apply to Poppler's git master?) Here's another one: shadows on page 39 <http://web.mit.edu/rsi/www/pdfs/beamer-tutorial.pdf>. Currently I don't have time to hunt for more rendering bugs, but is there any way you could do an automated comparison between Arthur and Splash using Albert's PDF collection?
  
  > On the other hand one could argue that this is what "printing to a file" actually means: you lose all semantic information like letters, annotations, tags, etc.
  
  In general "printing" can be used for more, e.g. selecting a subset of pages, creating n-up PDFs or "flattening" filled out PDF forms to read-only PDFs. Preserving fonts is also something you get when printing via CUPS or (similar to QPrinter) via Cairo in Evince. It's a nice-to-have property, but obviously not relevant for this patch.
  
  > QFonts cannot represent fonts that are embedded in a pdf document---you need a QRawFont for that.
  
  Might be worth trying to ask the Qt experts on that, also as a followup to fdo#102290 <https://bugs.freedesktop.org/show_bug.cgi?id=102290>…

INLINE COMMENTS

> generator_pdf.cpp:99
> +#if !defined(Q_OS_WIN)
> +           m_printBackend->insertItem(CUPSBackend, "CUPS", CUPSBackend);
> +           m_printBackend->setItemData(CUPSBackend, i18n("Print with CUPS"), Qt::ToolTipRole);

`i18n` needed here?

> generator_pdf.cpp:101
> +           m_printBackend->setItemData(CUPSBackend, i18n("Print with CUPS"), Qt::ToolTipRole);
> +           m_printBackend->setItemData(CUPSBackend, i18n("Print using the CUPS printing system.  This will convert your pdf file to postscript first, and then send the postscript file to the printer."), Qt::WhatsThisRole);
> +#endif

pdf → PDF
postscript → PostScript

> generator_pdf.cpp:108
> +#if defined(Q_OS_WIN) || HAVE_POPPLER_0_60
> +           m_printBackend->insertItem(QPrinterBackend, "QPrinter (experimental)", QPrinterBackend);
> +           m_printBackend->setItemData(QPrinterBackend, i18n("Print with Qt (experimental, you may see rendering artifacts)"), Qt::ToolTipRole);

definitely `i18n` missing

> generator_pdf.cpp:110
> +           m_printBackend->setItemData(QPrinterBackend, i18n("Print with Qt (experimental, you may see rendering artifacts)"), Qt::ToolTipRole);
> +           m_printBackend->setItemData(QPrinterBackend, i18n("Print by using the platform-independent Qt infrastructure. By necessity, this uses a backend of the Poppler pdf library which is called 'Arthur'.  This Arthur backend is still somewhat immature, and you may see misrenderings of your pdf document. On the positive side, QPrinter printing allows more printing options."), Qt::WhatsThisRole);
> +#endif

pdf → PDF

REVISION DETAIL
  https://phabricator.kde.org/D7949

To: sander, #okular
Cc: ltoscano, rkflx, michaelweghorn, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20171014/50cf9f7e/attachment-0001.html>


More information about the Okular-devel mailing list