-
Notifications
You must be signed in to change notification settings - Fork 23
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 to office and PLR in static extract are not always correct #1278
Comments
Did you also check the DataExtract? Is the link in the DataExtract right one and just in the static extract wrong? In that case it would point the problem to MFP. Otherwise to pyramid_oereb. Think we should first find out if the problem occurs in pyramid_oereb or in MFP. |
Sorry, I was not clear enough: And, I have seen it only on the PDF, not in the dynamic extract - the data extract I did not test, but I assume it's only in the static extract. |
So it seems to be an MFP problem. I generated a static extract from Heiden and could reproduce the issue. It's really weird, sometimes the link works, sometimes not. I opened the same PDF with Firefox and the links seemed to always work. Still it should work in Adobe Reader as well. Just hope it's not a bug in Adobe :) As we don't use MFP in SH, I'm afraid I can't give more help on this, sorry. |
As far as I remember it, it is a general issue with multiline URL links in the PDF. |
Hi - I tried to reproduce the issue with the PDF Print from SH, since they do not use MFP. |
We have a tiny area of KBS military, see 204a64a7-5b89-4570-9814-bb9821466ae8.pdf Still couldn't reproduce on a quick test. |
As far as I can see, the URL covers the whole zone for your PDF @romefi (click on the link and keep the button pressed > the whole area goes black in Adobe PDF Reader). you might want to compare the two examples to have a look if you see the same difference? This could also hint to a possible solution: rather to put an href on the text, we might want to put it on the area for MFP, if possible? @jwkaltz @marionb ? |
@voisardf @MaxHoeferGEOINFO I found the issue we had in the past about this matter: @MaxHoeferGEOINFO can you please check whether the print templates in your project are up to date? As far as I remember, you did update them, but please double-check to be sure. |
@jwkaltz Where do I see the version of my MFP templates again? Or what file should I compare? |
@MaxHoeferGEOINFO these are the most current templates: https://github.com/openoereb/pyramid_oereb_mfp/tree/v1.9.0/print-apps/oereb |
Thanks, I thought there is a version number hidden somewhere, so I would not have to compare files all the. |
Is this the link https://www.ar.ch/verwaltung/departement-bau-und-volkswirtschaft/amt-fuer-raum-und-wald/ ? |
This is the link, correct. With that link, it only happens in Adobe, not when opening the extract in the broswer for example. I have no other PDF program right now, and therefore did not test any other. |
@MaxHoeferGEOINFO I have integrated both links in the test data of the project, and tested the resulting static extract with Adobe Acrobat Reader DC 2021.005.20058, I can not reproduce a problem klicking on the links, this is the file: |
@jwkaltz I was able to reproduce with the PDF file you attached, when opening it in Chrome and opening the KBS link a lot of times. Sometimes the following link is opened then https://map.geo.admin.ch/?zoom=12&E=2739650&N=1250525&bgLayer=ch.swisstopo.pixelkarte-farbe&lang=de&topic=ech&layers=ch.swisstopo.zeitreihen,ch.bfs.gebaeude_wohnungs_register,ch.bav.haltestellen-oev,ch.swisstopo.swisstlm3d-wanderwege,ch.astra.wanderland-sperrungen_umleitungen&layers_opacity=1,1,1,0.8,0.8&layers_visibility=false,false,false,false,false&layers_timestamp=18641231,,,, Here is the link to our PDF, where you can reproduce the issue with the Link for the "Amt für Raum & Wald" for the topics "statische Walgrenzen", when opening the file in Adobe. http://oereb.ar.ch/ktar/wsgi/oereb/extract/reduced/pdf/CH345449778476 |
@MaxHoeferGEOINFO when looking at the data extract (https://oereb.ar.ch/ktar/wsgi/oereb/extract/reduced/json/CH345449778476), I see that the last two links contain a space at the end, so, strictly speaking, the URLs are not correct: Can you please repair the links in the project, and try again? |
@jwkaltz Thanks for that - I changed this and now it seems to work reliably. I think we can forget for now the question, why the link worked sometimes and sometimes it didn't? |
@MaxHoeferGEOINFO Thanks for the message. I can only confirm that, even if this ticket was closed, the bug described in openoereb/pyramid_oereb_mfp#38 is still here: when a Link is on many lines, there's a small pixel area between the lines where the link is incomplete. The reason given was "Please note that while the hyperlinks work now, JasperReports does not provide a box around the whole link, as some tools such as Word do; therefore the user click will work only when the user clicks on the text within the link." @jwkaltz This ticket was in 2019, but now in 2021 with a new version of Jasper, is there still nothing we can do to fix this? @svamaa FYI |
@remyguillaume Regarding the description in openoereb/pyramid_oereb_mfp#38 , to my knowledge the bug as such was solved, meaning, there are no longer any incomplete links that are presented to the user. As least, we could not reproduce that in various PDF viewers after the fix. Do you observe a different behaviour? What is still the case, and what I can reproduce in the development setup, is that in the current solution there are gaps between the lines, meaning: the link will only open when the user clicks on the link text, but nothing will happen when the user clicks between the text lines. I agree this can be confusing to the user. However, I see no new functionality about the hyperlink rendering in JasperReports in the newest version, which is 6.17.0 (whereas the MapFish Print used for oereb development tests, which is 3.28, is using JasperReports 6.16.0). |
@jwkaltz The issue discussed here was reproducible with the PDF you generated and attached, see my comment on the 2nd of August - or is that something different now? |
@jwkaltz I confirm that the bug is still here. Can be reproduced with the default integrated PDF viewer in Chrome and with Adobe Acrobat DC. We are using pyramid_oereb 1.8.1 with the corresponding templates. The example file: e68f6413-88ba-4606-8d33-081077499096.pdf |
@remyguillaume I can reproduce the bug with Adobe Acrobat Reader on your file, but not on the test PDF generated in the development environment; in both cases, when hovering between the lines of the multi-line link, the cursor changes, but in one case it is clickable (with a wrong link) and in the other case it is not. In both cases, when hovering between the lines, the cursor looks like something clickable, which it should not be (other PDF viewers show it differently, meaning, as something not clickable). But in the second case, since it is actually not clickable, the user can not open a bad link. I bet the difference in behavior is due to the WMS backend behavior,
Therefore it seems that Acrobat Reader is doing something "smart" about the link URLs (pre-load?) and knows when one is in error, and therefore does not allow the user to follow the link. Other PDF readers that I have checked do not do that. Now that we know how we can reproduce the bug, we can reinvestigate if other templating options exist which will work also in Acrobat Reader. However, if you want a quick win, I think changing the behavior of wms.oereb.bs.ch to raise a real error when being called with a bad URL will avoid the problem in your PDFs (in the sense that Acrobat Reader should then appear to behave the same as other PDF viewers). If you get a change to try that, please let us know. |
@jwkaltz It seems this difference is within MapServer itself, and is bound to the WMS query
In all cases, the HTTP response code is 200, and thus is identify as success. In version 1.1.1, the content-type So when calling https://wms.oereb.bs.ch/?version=1.3.0&SERVICE=WMS&SLD_VERSION=1.1.0&FORMAT=image/png&EXCEPTIONS=application/vnd.ogc.se_xml, I can get the right content-type. I tried to add this parameter to the vollständige Legende link, but it didn't solve anything. Could you evlt try with the WMS 1.3.0 from Swisstopo instead on the 1.1.1, to see if you can repoduce it with the URL of Swisstopo too? Vollständige Legende page 5 : with_exception.pdf. When I think about it, I suppose it should really be a report problem (Jasper, MFP or the templates), because the content of the wrong link is exactly what is written in the first line of the multiple-line link. The link is just truncated, without any logic: |
Actually we are using the WMS-Services version 1.3.0 from Swisstopo, and I can repoduce the bug (page 6) : |
Thanks for the inputs @remyguillaume , but it seems we were on the wooden path yesterday. I can not find any correlation between WMS backend behavior and whether the link is working or not in Acrobat Reader. To summarize,
In the first two, I can never open a bad link in Acrobat Reader, in the third, clicking on any multi-line link between the first and second line opens a bad link. Note that the second PDF contains an identical link as the third PDF, compare "Vollständige Legende" on page in the second document with the "Vollständige Legend" on page 4 in the Baselstadt document. Interestingly, even though the link is identical, the line break is not at the same place. Do you observe the same, maybe I am missing something? In summary, right now, the only difference I see is the environment which produces the PDF. In the case of the PDFs I produced in test environment, they are produced by MapFish Print 3.28.1, run via docker-compose, and using these templates: https://github.com/openoereb/pyramid_oereb_mfp/tree/V1 |
After some more tests regarding the previous comment, I see that I can reproduce it sometimes in the first two documents, when I click quickly between the links about ten times, then the (wrong) link is opened. I guess this is the phenomenon that @MaxHoeferGEOINFO also observed. Whereas in the third document, the one from Baselstadt, I can reproduce it on every single click. So there really seems to be some difference coming from the environment where the PDF is produced. |
Hi @jwkaltz I think I finally found the problem. The first 2 PDFs are created with the PDF/A conformance. At BS we cannot activate PDF/A conformance because of this issue: #876 When you open a PDF/A conform file with Acrobat Reader, a warning is displayed : Furthermore, if you open directly the document in the PDF-Reader in the Browser (chrome), the problem can be reproduced on the first 2 documents. So in summary I would say that the wrong link is present in all 3 documents, but as the first 2 are PDF/A compliant, the behavior is different in Acrobat Reader. |
Yes, thanks for the further investigations @remyguillaume , indeed I can always reproduce it in Acrobat Reader when PDF/A is turned off... what a strange combination of effects. |
Hi all
The swisstopo has found an issue in the static extract with the links to the office and with the links for the public law restrictions for the contaminated military sites.
Sometimes when clicking on a link, it opens an incorrect webpage.
I have looked deeper into the problem, and it seems, as if the links in the PDF are not always complete. It does not appear very often, but sometimes the mouse-over shows already an incomplete URL. When the URL is opened then, it goes to an incorrect page.
Please see the images attached from the oereb portal AR and from BS, I hope this makes the issue clearer.
Since I can reproduce the same issue for our static extract and the one from BS, I assume it's a problem with the generation of the link, somewhere within pyramid_oereb or the MFP settings?
Would it be possible to have a look at this while implementing the changes for the new "Weisungen"?
Thanks & Cheers
Max
The text was updated successfully, but these errors were encountered: