Add function to copy link address to clipboard

Bug #1351379 reported by v_2e
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Fix Released
Wishlist
Adam Reichold

Bug Description

I noticed that Qpdfview does not open the so-called "Encoded URLs" correctly. So, for example, if I have a link

http://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%BE%D1%82%D0%B0%D0%BA%D1%82%D0%B8%D0%BD%D0%B8%D0%B9

in my PDF document, when I click this link in Qpdfview, my browser opens at the page

http://ru.wikipedia.org/wiki/%25D0%259F%25D1%2580%25D0%25BE%25D1%2582%25D0%25B0%25D0%25BA%25D1%2582%25D0%25B8%25D0%25BD%25D0%25B8%25D0%25B9

Obviously, all the "%" symbols are replaced by the "%25" code and all the letters and numbers are treated as a regular text.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello v_2e,

thanks for taking the time to report this! Could you attach at least one such document to this bug report so I can properly test this? Thanks!

Best regards, Adam.

Revision history for this message
v_2e (v-2e) wrote :

Here is a PDF document created with LaTeX with the URLs implemented in several ways. The result seems to be the same each time, and does not provide a correct URL to the browser. By the way, the pop-up hints in Qpdfview show the URLs correctly.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

thanks for creating the document to isolate the issue. It seems to be a Qt4 only issue since when I build qpdfview against Qt4, then I can reproduce it. Building it against Qt5, I cannot. Can you confirm that you are using a qpdfview build against Qt4? Next step is to figure out how to stop Qt4 from trying to reencode and already encoded URL...

Best regards, Adam.

Revision history for this message
Adam Reichold (adamreichold) wrote :

From how I understand by reading [1], this might be Qt bug since sequences of the "%XY" with X and Y begin hexadecimal digits, e.g. your example URL, should not be reencoded as Qt5 does but Qt4 does not.
I also do not think that I can enable strict parsing mode which does no try to do any replacements since the URL within PDF documents are user-supplied and might not be properly encoded.

From this I'd say the only option to update to Qt5. :-\ Do you agree with this conclusion?

[1] http://qt-project.org/doc/qt-4.8/qurl.html

Revision history for this message
v_2e (v-2e) wrote :

I use Gentoo GNU/Linux, and there is only Qt4.8.5 in the official repository. I think, I'll switch to Qt5 as soon as it is available in the 'testing'. No one knows when it is going to happen though.

What about adding an option "Copy link address" to the hyperlink context menu in Qpdfview? This might be a workaround to the current problem, and a nice feature by itself. In fact, I was thinking about adding such a "bugreport", or rather a "feature request" here, because sometimes it is convenient to disable the direct opening of URLs (by left click), but copy a link for pasting into the browser or somewhere else instead.

What do you think about that?

  Thanks!
  Vladimir

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Vladimir,

after trying out to force Qt4 to take the URL by using StrictMode and only using TolerantMode if that fails without success, I'd say add such a context menu entry is the only workaround currently possible. I added a corresponding link context menu in trunk revision 1637 and will repurpose this bug report. I would be glad if you could test it (and maybe report a Qt bug on this since Qt4 is still maintained)?

Best regards, Adam.

summary: - Encoded URLs
+ Add function to copy link address to clipboard
Changed in qpdfview:
status: New → Fix Committed
importance: Undecided → Wishlist
assignee: nobody → Adam Reichold (adamreichold)
milestone: none → 0.4.12
Revision history for this message
v_2e (v-2e) wrote :

Hello!

I could try to submit a bugreport to Qt bugtracker, but I am not sure I can state the problem clearly.
And also I did a quick search through their bugreports and found some bugs that seem to be related. Could you please check if they are about the same problem we experience or not?

https://bugreports.qt-project.org/browse/QTBUG-14339
https://bugreports.qt-project.org/browse/QTBUG-27787

Revision history for this message
Adam Reichold (adamreichold) wrote : Re: [Bug 1351379] Re: Add function to copy link address to clipboard

Hello Vladimir,

Am 06.08.2014 um 09:29 schrieb v_2e:
> Hello!
>
> I could try to submit a bugreport to Qt bugtracker, but I am not sure I can state the problem clearly.
> And also I did a quick search through their bugreports and found some bugs that seem to be related. Could you please check if they are about the same problem we experience or not?
>
> https://bugreports.qt-project.org/browse/QTBUG-14339
> https://bugreports.qt-project.org/browse/QTBUG-27787

Both reports seem to be exactly the problem we encounter (with the
second one being a duplicate of the first one). The first seems to be
dead because this is fixed in Qt5. I will however chime in and ask for
an update for Qt4...

Best regards, Adam.

P.S.: Were you able to try out the copy link address function?

Revision history for this message
v_2e (v-2e) wrote :

Hello!
I downloaded the latest trunk (1637) and it worked fine for the document I sent you earlier. Thanks for this patch!

I have also a couple of questions here.

1. What does "Select link address" mean?
2. In this document -- https://www-nds.iaea.org/point2012/Document/POINT20112.pdf -- there are links on page 4 which are highlighted as the hyperlinks, but they are not clickable, nor copy-able. Are they just a regular text, but coloured and underscored -- not the real links?

Regards,
  Vladimir

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

Am 06.08.2014 um 21:20 schrieb v_2e:
> Hello! I downloaded the latest trunk (1637) and it worked fine for
> the document I sent you earlier. Thanks for this patch!
>
> I have also a couple of questions here.
>
> 1. What does "Select link address" mean?

This copies the address into the selection buffer on X11 systems, i.e.
you can paste it by middle clicking. This is a separate buffer from
the actual clipboard.

> 2. In this document --
> https://www-nds.iaea.org/point2012/Document/POINT20112.pdf -- there
> are links on page 4 which are highlighted as the hyperlinks, but
> they are not clickable, nor copy-able. Are they just a regular
> text, but coloured and underscored -- not the real links?

Yes, seems like these are just blue underline text and not links.

> Regards, Vladimir
>

Best regards, adam.

Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.