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

Multiple carriage returns in Text property get removed or ignored. #3154

Open
JoseSanchezMoralesIDOX opened this issue Jan 4, 2024 · 2 comments

Comments

@JoseSanchezMoralesIDOX
Copy link

Context

  • MapFish print version: 3.30
  • Java version: openjdk 11.0.21 2023-10-17
  • OS: Docker version 20.10.7, build f0df350

Describe the bug

Multiple carriage returns (i.e., \n\n..) inside the Text property of the geoJson Layer ("type": "FeatureCollection") are not handled properly by Mapfish and they get removed from the printed PDF.

How to reproduce

Create a Feature Collection in the print request, and add empty lines (several carriage returns) in the Text property in one of the Features, i.e.:

                                    "type": "Feature",
                                    "geometry": {
                                        "type": "Polygon",
                                        "coordinates": [
                                            [],
                                            [],
                                            [],
                                            [],
                                            []
                                        ]
                                    },
                                    "properties": {
                                        "width": 6.7627606404320195,
                                        "linewidth": 1.6906231321781462,
                                        "annotype": "TextBox",
                                        "backgroundfill": "#ffffff",
                                        "backgroundstroke": "#000000",
                                        "strokecolour": "#000000",
                                        "text": "asdsasd \n\n\n\nasdaasdas  dasdssaadsddsaads",
                                        "textAlign": "cm",
                                        "centerCoords": [
                                            256872.2004,
                                            681873.0992,
                                            0
                                        ],
                                        "padding": 5,
                                        "offsetY": "1.6906901601080049",
                                        "scaling": "Scaled",
                                        "_style_0": "0e79d7ec-1faf-4c35-81dd-5d6441a848ac",
                                        "_style_1": "4a9e1238-a87f-4df5-b98a-456e00575546"
                                    },
                                    "id": "feature.1adaf7f2-a896-4b4b-a7ee-32ec1baafea1"
                                }

This was not happening in version 3.26.

Is this somehow a known bug?

Thanks in advance,

@sbrunner
Copy link
Member

sbrunner commented Jan 8, 2024

This can be done by GeoTools, what about replacing \n by <br />?

@JoseSanchezMoralesIDOX
Copy link
Author

JoseSanchezMoralesIDOX commented Jan 8, 2024

Thanks for the tip @sbrunner . However, replacing every single instance of \n by <br /> in the JSON print object before sending the request to Mapfish produces an empty bbox with no text back from MAPFISH. So, it doesn't like it.

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

No branches or pull requests

2 participants