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

Add outputFormat as a none-custom param of MapfishPrintProvider #349

Merged
merged 3 commits into from Jul 1, 2015

Conversation

bentrm
Copy link
Member

@bentrm bentrm commented Apr 14, 2015

I have the requirement to "print" other formats than pdf via Geoserver printing and thought this may be interesting for upstream as well.
Right now I have problems to configure Geoserver printing to work with other formats than PDF so this has not been tested "live" but only via programmatic tests. I also changed the print-form example to include the outputFormat option but the hosted printing service also fails on delivering the supported formats (as of info.json it should deal with PNG for example).

Error while generating PDF:
java.lang.RuntimeException: java.io.IOException: Cannot run program "/usr/bin/convert": error=2, Datei oder Verzeichnis nicht gefunden
    at org.mapfish.print.output.NativeProcessOutputFactory$ImageOutput.print(NativeProcessOutputFactory.java:202)
    at org.mapfish.print.MapPrinter.print(MapPrinter.java:184)
    at org.mapfish.print.servlet.MapPrinterServlet.doCreatePDFFile(MapPrinterServlet.java:336)
    at org.mapfish.print.servlet.MapPrinterServlet.createAndGetPDF(MapPrinterServlet.java:155)
    at org.mapfish.print.servlet.MapPrinterServlet.doGet(MapPrinterServlet.java:86)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Cannot run program "/usr/bin/convert": error=2, Datei oder Verzeichnis nicht gefunden
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at org.mapfish.print.output.NativeProcessOutputFactory$ImageOutput.createImage(NativeProcessOutputFactory.java:277)
    at org.mapfish.print.output.NativeProcessOutputFactory$ImageOutput.print(NativeProcessOutputFactory.java:193)
    ... 22 more
Caused by: java.io.IOException: error=2, Datei oder Verzeichnis nicht gefunden
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 24 more

If I understand this correctly the printing plugin is trying to convert the generated PDF via ImageMagick command into the desired outputFormat as requested via POST to create.json (described here).

@weskamm
Copy link
Member

weskamm commented Apr 15, 2015

but the hosted printing service also fails on delivering the supported formats

Has been fixed on the server side, the servlet used in the examples now supports image output, tested for jpg and png

@bentrm
Copy link
Member Author

bentrm commented Apr 15, 2015

The changes seem to be fine then. Thank you. Off to configuring my service correctly next.

@bentrm bentrm force-pushed the printformat branch 2 times, most recently from 715a156 to 58ef017 Compare April 19, 2015 18:52
@chrismayer chrismayer mentioned this pull request May 12, 2015
9 tasks
@marcjansen
Copy link
Member

Is this waiting for review? @weskamm, any chance you may want to do it?

@weskamm
Copy link
Member

weskamm commented May 18, 2015

I'm having a look at this just right now..

@bentrm
Copy link
Member Author

bentrm commented May 18, 2015

Thanks @weskamm. I think it's ready for review.

@@ -458,6 +494,16 @@ Ext.define('GeoExt.data.MapfishPrintProvider', {
*
* @param {Ext.data.Record} layout The record of the layout.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs adjustments from c&p

@weskamm
Copy link
Member

weskamm commented May 18, 2015

I just added a minor comment. Otherwise, this looks good to me, thanks for the contribution!

@bentrm
Copy link
Member Author

bentrm commented Jun 30, 2015

Is this interesting for upstream? Otherwise I will close the PR.

@marcjansen
Copy link
Member

@weskamm?

@weskamm
Copy link
Member

weskamm commented Jul 1, 2015

Yes i still think it is a nice addition. And as it keeps the PDF format as the default, i dont't see any problems here merging this into upstream and will do so now!

weskamm added a commit that referenced this pull request Jul 1, 2015
Add outputFormat as a none-custom param of MapfishPrintProvider
@weskamm weskamm merged commit 011a0da into geoext:master Jul 1, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants