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

Links in PDFs: Track link overlapping per page, not for all pages #95

Merged

Conversation

rototor
Copy link
Contributor

@rototor rototor commented May 9, 2017

Currently the area occupied by a link is tracked in a Set to avoid
putting two links above each other. No idea why this can happen normaly,
but it least it tries to avoid that. But this Set is not per page,
its global for all pages.

Guess whats happend in a report on the production system of a customer
of mine :)

They have tables spanning many pages, and magically all links which happen
to be exactly at the same position like a link on another page the link
does not get exported.

With this patch the Set is tracked per page.

Is this Set really needed? Why was it introduced in the first place?

Currently the area occupied by a link is tracked in a Set to avoid
putting two links above each other. No idea why this can happen normaly,
but it least it tries to avoid that. But this Set is not per page,
its global for all pages.

Guess whats happend in a report on the production system of a customer
of mine :)

They have tables spanning many pages, and magically all links which happen
to be exactly at the same position like a link on another page the link
does not get exported.

With this patch the Set is tracked per page.

Is this Set really needed? Why was it introduced in the first place?
@danfickle
Copy link
Owner

I think it was introduced because a link can contain multiple boxes, for example, if part of the link is bold. Because checkLinkArea is called for every box, you would generate multiple links for a single anchor element. Perhaps, the check should be that one a element only generates one link in the PDF rather than an area check. You'll notice this is how I did it for form handling.

The other problem with our link handling is that it can only generate a single rectangle. This won't work if the link goes over multiple lines for example.

Anyway, thanks a lot for for the correction and I'll merge now.

@danfickle danfickle merged commit 057d137 into danfickle:open-dev-v1 May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants