[Geoserver-users] Geoserver Mapfish: how to print in multiple pages?

Hi all,

I need to print a large map with a high resolution.

I wonder is it possible to print such a map in more than one page? and how?

I’ve tested the Mapfish Printing Demo that comes with Geoserver admin page, but it only print in one page, even if I enlarge the map extent and resolution.

Regards,

Fawzy

I’m not at all familiar with this, but how have you defined the pages part of the {SPEC} you’re using?

More generally, what have you already tried, what happened, and what were you expecting to happen instead?

Brad

From: fawzyb@anonymised.com fawzyb@anonymised.com
Sent: Saturday, 4 August 2018 9:27 PM
To: Geoserver Users geoserver-users@anonymised.coms.sourceforge.net
Subject: [Geoserver-users] Geoserver Mapfish: how to print in multiple pages?

Hi all,

I need to print a large map with a high resolution.

I wonder is it possible to print such a map in more than one page? and how?

I’ve tested the Mapfish Printing Demo that comes with Geoserver admin page, but it only print in one page, even if I enlarge the map extent and resolution.

Regards,

Fawzy

On 08/04/2018 01:27 PM, fawzyb@anonymised.com wrote:

Hi all,

I need to print a large map with a high resolution.

I wonder is it possible to print such a map in more than one page? and how?

I've tested the Mapfish Printing Demo that comes with Geoserver admin
page, but it only print in one page, even if I enlarge the map extent
and resolution.

Not very familiar with complex mapfish layouts but 2 solutions come to
my mind:

- client side
create a large page (larger than a4 or letter) and use some tool on the
client to print on multiple a4 or letter pages a large pdf.

- server side
create a config.yaml with as many pages as needed to put a section of
the map on each page.
Example: you create a config.yaml file with four pages and put on each
NW, NE, SE, SW of the map.

My 2 cents

   maxx

I’m not at all familiar with this, but how have you defined the pages part of the {SPEC} you’re using?

More generally, what have you already tried, what happened, and what were you expecting to happen instead?

Brad

···

From: fawzyb@anonymised.com <fawzyb@anonymised.com>
Sent: Saturday, 4 August 2018 9:27 PM
To: Geoserver Users <geoserver-users@lists.sourceforge.net>
Subject: [Geoserver-users] Geoserver Mapfish: how to print in multiple pages?

Hi all,

I need to print a large map with a high resolution.

I wonder is it possible to print such a map in more than one page? and how?

I’ve tested the Mapfish Printing Demo that comes with Geoserver admin page, but it only print in one page, even if I enlarge the map extent and resolution.

Regards,

Fawzy

Hello,
I really don’t think that currently the code envisages the possibility of splitting a single map into different pages (as far as I know).

From what I remember, the current Java library tries always to adapt the scale of the map to page size, or better, to be more precise, to the frame on the PDF page containing the map.

I did not experiments by myself honestly, but I suspect that in order to get something similar to what you are asking, there will be the need to modify the code from here

https://github.com/geosolutions-it/mapfish-print

···

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A - 55054 Massarosa (LU) - Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

I think that mapfish3 might let you do this as it uses Jasper Reports to handle the design of the output. Your issue then is that it does not integrate with geoserver.

Ian

On Fri, 17 Aug 2018, 16:37 Alessio Fabiani, <alessio.fabiani@anonymised.com> wrote:

Hello,
I really don’t think that currently the code envisages the possibility of splitting a single map into different pages (as far as I know).

From what I remember, the current Java library tries always to adapt the scale of the map to page size, or better, to be more precise, to the frame on the PDF page containing the map.

I did not experiments by myself honestly, but I suspect that in order to get something similar to what you are asking, there will be the need to modify the code from here

https://github.com/geosolutions-it/mapfish-print

Il giorno gio 16 ago 2018 alle ore 17:43 <fawzyb@anonymised.com> ha scritto:

Hi all,
Here is my problem in more detail:
I have a map which I want to print in high resolution. In order to be in high resolution the map can’t be fit in one page, it must be printed in more than one page.
According to the documentations:
http://docs.geoserver.org/latest/en/user/extensions/printing/configuration.html

“If the items that are in the main section are too big, more pages are generated.”

Here is my config.yaml:

#===========================================================================

allowed DPIs

#===========================================================================
dpis: [75, 150, 300, 1000]

#===========================================================================

the allowed scales

#===========================================================================
scales:

  • 25000
  • 50000
  • 100000
  • 200000
  • 500000
  • 1000000
  • 2000000
  • 4000000
  • 8000000
  • 16000000
  • 160000000
  • 1600000000
    #===========================================================================

format

#===========================================================================

formats:

#===========================================================================

the list of allowed hosts

#===========================================================================
hosts:

  • !localMatch
    dummy: true

#===========================================================================

the output file name

#===========================================================================
outputFilename: ‘map-${dd_MM_yyyy-hh_mm_ss}’
#===========================================================================

The list of layouts

#===========================================================================
layouts:
A3:
mainPage:
pageSize: A3
items:

  • !map
    spacingAfter: 30
    width: 440
    height: 483
    Legal:
    mainPage:
    pageSize: LEGAL
    items:
  • !map
    spacingAfter: 30
    width: 640
    height: 430

##########################################################################################3
And here is my post request’s body (the specs):

{
“units”:“degrees”,
“srs”:“EPSG:4326”,
“layout”:“Legal”,
“dpi”:1000,
“layers”:[
{
“baseURL”:“http://localhost:6256/geoserver/wms”,
“opacity”:1,
“singleTile”:false,
“type”:“WMS”,
“layers”:[
“tst:geometry_table”
],
“format”:“image/jpeg”,
“styles”:[
“”
],
“customParams”:{
}
}
],
“pages”:[
{
“bbox”:[25.9937515258789, 31.9969902038574, 27.2562484741211, 33.0051727294922],
“rotation”:0,
“mapTitle”:“A custom title”,
“comment”:“A custom comment”
}
]
}
##########################################################################################

This request result in printing the map in only one page with a high scale (1:1000,000).

My question is how to print this map with a lower scale (e.g. 1:100,000), so that it fits in more than one page?

I’ve tried to encrease the map size in the config.yaml file to be more than the page size, but results in the following exception:

Error while generating PDF:
com.itextpdf.text.DocumentException: com.itextpdf.text.DocumentException: Infinite table loop; row content is larger than the page (for instance because you didn’t scale an image).
at com.itextpdf.text.pdf.PdfDocument.add(PdfDocument.java:786)
at com.itextpdf.text.Document.add(Document.java:278)
at org.mapfish.print.config.layout.Page$1.add(Page.java:76)
at org.mapfish.print.config.layout.MapBlock.render(MapBlock.java:81)
at org.mapfish.print.config.layout.Page.render(Page.java:73)
at org.mapfish.print.config.layout.MainPage.render(MainPage.java:63)
at org.mapfish.print.config.layout.Layout.render(Layout.java:59)
at org.mapfish.print.output.AbstractOutputFormat.doPrint(AbstractOutputFormat.java:30)
at org.mapfish.print.output.PdfOutputFactory.print(PdfOutputFactory.java:58)

What is my problem?

Thanks,
Fawzy


Securely sent with Tutanota. Claim your encrypted mailbox today!
https://tutanota.com

  1. Aug 2018 06:28 by bradh@anonymised.com:

I’m not at all familiar with this, but how have you defined the pages part of the {SPEC} you’re using?

More generally, what have you already tried, what happened, and what were you expecting to happen instead?

Brad

From: fawzyb@anonymised.com <fawzyb@anonymised.com>
Sent: Saturday, 4 August 2018 9:27 PM
To: Geoserver Users <geoserver-users@lists.sourceforge.net>
Subject: [Geoserver-users] Geoserver Mapfish: how to print in multiple pages?

Hi all,

I need to print a large map with a high resolution.

I wonder is it possible to print such a map in more than one page? and how?

I’ve tested the Mapfish Printing Demo that comes with Geoserver admin page, but it only print in one page, even if I enlarge the map extent and resolution.

Regards,

Fawzy


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A - 55054 Massarosa (LU) - Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi,
that’s correct, you cannot split a single image (the map) on multiple pages. If you have other content, it can “extend” to additional pages, but you cannot do it with an image.
Basically what you ask for is not supported by the mapfish version included in the geoserver printing plugin. As Ian already mentioned, mapfish can be used as a standalone service, so you can try using the newer version outside of GeoServer, eventually, to see if it matches your use case.

···

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.