Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undesired mouseover effect on links in PDF #283

Closed
travelfish opened this issue Dec 14, 2016 · 22 comments
Closed

Undesired mouseover effect on links in PDF #283

travelfish opened this issue Dec 14, 2016 · 22 comments

Comments

@travelfish
Copy link

Latest version of Chrome (Version 55.0.2883.95 (64-bit))
Mac OSX 10.10.5
MPDF 5.7.3

With a Chrome upgrade am now seeing an ugly yellow box appear on mouseover of all links in generated PDFs. The PDFs are fine in other browsers and native viewers, but not so hot in Chrome

I've attached a screenshot of the behaviour. It happens in new PDFs as well as ones created previously, so is Chrome related. Any thoughts on what could be causing it?

pdfwot

@danielhjames
Copy link
Contributor

I can reproduce this issue and I think it needs fixing. My best guess is that it relates to http://mpdf.github.io/reference/html-control-tags/annotation.html

@danielhjames
Copy link
Contributor

My mPDF version is 6.1.2 on Debian jessie. Seems similar to https://productforums.google.com/forum/#!topic/chrome/dSzZOneqhNc

@danielhjames
Copy link
Contributor

Here is a simple test example from mPDF 6.1.2:

yellow-box-in-chrome.pdf

@danielhjames
Copy link
Contributor

I've reported the issue to Google and linked to this GitHub issue. Pop-ups for annotations are also oversized relative to the content. If the pop-ups were fitted to the size of the link or annotation text and in less bright colours, as in Evince, I think this would make the PDF more readable in Chrome.

@travelfish
Copy link
Author

Right, we're having the highlighting box (as per screenshot above) appear on all linked text - only on Chrome, and didn't used to happen - and we're not using any annotations, which I guess means this is something driven from Chrome's end.

Cheers

@danielhjames
Copy link
Contributor

Because the yellow box on links looks exactly like the annotation box (please see example above) I think it likely that Chrome's PDF viewer is treating every link as an annotation, even when the document does not contain any annotations.

@travelfish
Copy link
Author

travelfish commented Dec 20, 2016

example.pdf
Yes, but if you look at this PDF (made in Open Office) Chrome doesn't behave the same way.

@danielhjames
Copy link
Contributor

Thanks for your example, it does seem to be related to mPDF then.

@jakejackson1
Copy link
Contributor

If it works without any issues in Adobe Reader it's the Google Chrome PDF viewer that should be updated.

@kentct
Copy link

kentct commented Dec 28, 2016

I had this problem as well but was able to fix it by removing the /Contents portion of the annotation generator since I don't need the yellow annotations box and can't think of any reason why I would need it. I'm using mpdf 5.7.4. In mpdf/mpdf.php I located this line and commented it out:
$annot .= ' /Contents '.$this->_UTF16BEtextstring($pl[4]);

@danielhjames
Copy link
Contributor

Hi Kent, thanks for the workaround :-) Jake, I got no response from Google on the issue I reported, I doubt they are going to change Chrome because only PDFs made with mPDF seem to have the issue.

@morelazers
Copy link

I got here from google, I'm actually using html2pdf, started getting the unsightly yellow boxes a little while ago.

@kentct's solution was still applicable, comment out the lines that denote the '/Contents' for the annotation. 👍

@danielhjames
Copy link
Contributor

Thanks Tom, please file an issue on https://github.com/spipu/html2pdf/issues and link to this issue. Looks like there is some common ancestry from FPDF? Maybe the two projects can work together, I see they have an active community with a number of pull requests pending.

@travelfish
Copy link
Author

Thanks for the fix Kent - now I just need to go regenerate 200 pdfs ;-)

@stemis
Copy link

stemis commented Feb 20, 2017

I am having the same issue as described above.

Thanks for coming up with a fix Kent, unfortunately this won't work in my case since editing vendor files in production is a no-go in my environment.

@nawlbergs
Copy link

Have same issue with TcPDF 5.8.007

@jakejackson1
Copy link
Contributor

jakejackson1 commented Mar 26, 2017

@danielhjames can you link to the Google Chrome issue you created? I wasn't able to find it when searching Chrome's support forum.

@danielhjames
Copy link
Contributor

Hi Jake, I definitely reported it via Chrome feedback but it seems this is not the same thing as filing an issue at the upstream project https://bugs.chromium.org/p/chromium/issues/list

@jakejackson1
Copy link
Contributor

@danielhjames the way I helped get the Gmail PDF Viewer Encryption issue fixed was to open a topic in the Chrome Help Forums. It took a bit of time but it happened eventually.

@marclaporte
Copy link
Member

The yellow box on external links: indeed, I would prefer it removed.

But the yellow box has a use case for things like mouseovers. ex.: https://doc.tiki.org/PluginMouseover

Thanks!

@spipu
Copy link

spipu commented Jun 14, 2017

merge request for tecnickcom/TCPDF#60 for this issue

@esclim
Copy link

esclim commented Jun 11, 2020

Hi Jake, I definitely reported it via Chrome feedback but it seems this is not the same thing as filing an issue at the upstream project https://bugs.chromium.org/p/chromium/issues/list

Most likely: https://bugs.chromium.org/p/chromium/issues/detail?id=856331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests