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
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:
#===========================================================================
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
- 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
Ing. Alessio Fabiani
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
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.
Please make sure you read the following two resources before posting to this list: