Bug 480357 - Poppler needs upgrade to fix okular rendering hyperlink bugs
Poppler needs upgrade to fix okular rendering hyperlink bugs
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: poppler (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-16 11:45 EST by Jeremy Sanders
Modified: 2009-02-06 00:19 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-06 00:19:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to always tell poppler that the output is being printed if postscript is generated by the qt4 interface (453 bytes, patch)
2009-01-16 13:08 EST, Jeremy Sanders
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
KDE Software Compilation 180980 None None None Never

  None (edit)
Description Jeremy Sanders 2009-01-16 11:45:22 EST
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 12:31:36 EST
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 13:07:39 EST
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 13:08:36 EST
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 13:31:02 EST
Is that how the 0.10 branch/fix handles this case too?
Comment 5 Jeremy Sanders 2009-01-16 14:20:07 EST
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 14:27:41 EST
thanks.
Comment 7 Rex Dieter 2009-01-16 14:39:50 EST
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 15:14:49 EST
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 10:13:43 EST
alright, I'll work on integrating the patch.
Comment 10 Fedora Update System 2009-01-21 15:09:32 EST
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-23 21:43:19 EST
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 00:19:35 EST
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.

Note You need to log in before you can comment on or make changes to this bug.