Bug 480357

Summary: Poppler needs upgrade to fix okular rendering hyperlink bugs
Product: [Fedora] Fedora Reporter: Jeremy Sanders <jss>
Component: popplerAssignee: Rex Dieter <rdieter>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: jnovy, krh, rdieter, rmj
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-06 05:19:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to always tell poppler that the output is being printed if postscript is generated by the qt4 interface none

Description Jeremy Sanders 2009-01-16 16:45:22 UTC
Description of problem:
Okular renders hyperlinks as green boxes when printing. See this kde bug:
https://bugs.kde.org/show_bug.cgi?id=180980

This is fixed in poppler 0.10. Can it be upgraded please?

Version-Release number of selected component (if applicable):
poppler-qt4-0.8.7-1.fc10.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Open http://arxiv.org/pdf/0811.0743v1 in okular
2. Print file
  
Actual results:
Green boxes printed around references.

Expected results:
No green boxes in printout.

Additional info:

Comment 1 Rex Dieter 2009-01-16 17:31:36 UTC
The new poppler-0.10 introduces an abi break, which would require a rebuild of all poppler-consuming applications.

I hope you can understand reservations about doing that in the middle of a release cycle.

Comment 2 Jeremy Sanders 2009-01-16 18:07:39 UTC
Hmmm - looking at the sourcecode and comparing the old 0.8.7 to the new 0.10, I've identified a fix. I've patched qt4/src/poppler-ps-converter.cc to always tell poppler that the output is being printed (not shown on screen) and so not to render hyperlinks. It seems to work for me.

This fix only affects qt4 applications (only poppler as far as I know), and only the postscript generation. People only want to print postscript, so this fix is safe and correct as far as I can see.

Comment 3 Jeremy Sanders 2009-01-16 18:08:36 UTC
Created attachment 329236 [details]
Patch to always tell poppler that the output is being printed if postscript is generated by the qt4 interface

Comment 4 Rex Dieter 2009-01-16 18:31:02 UTC
Is that how the 0.10 branch/fix handles this case too?

Comment 5 Jeremy Sanders 2009-01-16 19:20:07 UTC
More or less.

0.7.8 has this loop to print the pages:
193	 foreach(int page, d->pageList)
194	{
195	d->document->doc->displayPage(psOut, page, d->hDPI, d->vDPI, d->rotate, gFalse, gTrue, gFalse);
196	}

Whereas, 0.10 branch has:
211	 GBool isPrinting = (d->opts & Printing) ? gTrue : gFalse;
212	foreach(int page, d->pageList)
213	{
214	d->document->doc->displayPage(psOut, page, d->hDPI, d->vDPI, d->rotate, gFalse, gTrue, isPrinting);
215	}

d->opts is initialised to Printing by default:
53	PSConverterPrivate::PSConverterPrivate()
54	: BaseConverterPrivate(),
55	hDPI(72), vDPI(72), rotate(0), paperWidth(-1), paperHeight(-1),
56	marginRight(0), marginBottom(0), marginLeft(0), marginTop(0),
57	opts(PSConverter::Printing)
58	{
59	}

So 0.10 has changed the default to isPrinting, but also added an interface to be able to change this default:
157	void PSConverter::setPSOptions(PSConverter::PSOptions options)
158	{
159	Q_D(PSConverter);
160	d->opts = options;
161	}

The default of True for isPrinting makes much more sense for postscript output, which is almost always printed or displayed on the screen as would a printout. My patch modifies the output by making postscript output always behave as if it were sent to a printer, leaving out the hyperlink rectangles.

Comment 6 Rex Dieter 2009-01-16 19:27:41 UTC
thanks.

Comment 7 Rex Dieter 2009-01-16 19:39:50 UTC
I'll have to think about it a bit, this would regress screen rendering of postscript files with embedded hyperlinks, no?

Comment 8 Jeremy Sanders 2009-01-16 20:14:49 UTC
I don't think so. As far as I can tell, Poppler only renders PDF, not postscript. For instance, okular uses libgs to render Postscript, see
http://okular.kde.org/download.php . Postscript doesn't support the hyperlinks either - at least evince and gv don't see them.

The only way I could think of it having an effect would be if there were a qt4 based application which used Poppler to render a PDF to Postscript, then sent the Postscript to something like ghostscript to render to the screen.

Anyway, I can work around this personally with my patch, and check nothing obvious breaks. I suppose it depends on how many people are going to get hit by this issue, and the risk of regressing something. I don't see any obvious risks as there aren't that many qt4-poppler based renderers out there (at least yet).

Comment 9 Rex Dieter 2009-01-20 15:13:43 UTC
alright, I'll work on integrating the patch.

Comment 10 Fedora Update System 2009-01-21 20:09:32 UTC
poppler-0.8.7-5.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/poppler-0.8.7-5.fc10

Comment 11 Fedora Update System 2009-01-24 02:43:19 UTC
poppler-0.8.7-5.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update poppler'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0937

Comment 12 Fedora Update System 2009-02-06 05:19:35 UTC
poppler-0.8.7-5.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.