-
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
TOC - review calculation #2038
Comments
This issue is about checking the calculation of the size of the table of contents (i.e. number of pages) made in
The number of pages that the table of contents needs is used in mapfish_print.py to be compared with the actual length of the table of contents in the PDF. If the two numbers do not match, the PDF is created a second time to correct the page numbers in the table of contents. The most accurate calculation possible prevents the PDF from being created a second time and therefore increases performance. |
First of all, I looked at some parcels in the canton of Bern to see whether the PDF would be generated a second time. I looked at the following examples:
In all these cases, the length of the TOC is two pages. In no case will the PDF be generated a second time. In our current constellation, there is no plot in the canton of Bern that generates a table of contents of more than two pages, so that in our case at least, the PDF is only ever generated once. @svamaa @michmuel @voisardf @lopo977 Are there examples in your cantons where the PDF is generated twice? I can't really test this from the outside. |
In Tessin, both in the worst and best case, we have a table of contents of 2 pages. |
Extracts with wrong calculation (results in second print request): https://api.oereb.bs.ch/extract/pdf/?EGRID=CH198970136775 We always have 2 pages table of contents. But I could not find a case where the calculation was correct. |
PDF computation in BL: |
Computation of the TOC length is mostly incorrect in our case. One of the few examples it is ok: 2 calls: In our case, as soon as there are two concerned themes (which is the default for us) and the title for restrictions touching the real estate needs two lines, the computation is wrong by default. My best guess would be that we need to also calculate the wrapped text length for the concerned themes header, as depending on the municipality name and the 'Grundbuchkreis' there is a line break leading to a wrong computation. |
In my opinion there are several issues with the calculation:
|
thanks @peterschaer I opened the template and can already confirm the first point: d1 is set to a fixed height of 77px in the computation though it should also be computed. Here are the screen shots of the template allowing also a better understanding of the code in One real estate info line in d1: Two real estate info lines in d1: In conclusion: d1 should also be computed using the For point 2: QR-Code height is 56px by default |
Thanks @peterschaer for updating the branch. I think we will be able to narrow down the remaining issues next week. Here some information from the logs from BL using the latest version:
|
Are topMargin and bottomMargin possibly relevant as well (just a thought)? |
Yes, topMargin and bottomMargin are relevant but not yet included in the calculation. Thanks for the hint. I included those two values. Could you test again? |
Now, it is close. One example misses the correct value (one or two pages) by 2. These (
|
No description provided.
The text was updated successfully, but these errors were encountered: