#1554: wxGUI Cartographic Composer: preview broken on Windows ----------------------------------------------------+----------------------- Reporter: martinl | Owner: grass-dev@… Type: defect | Status: new Priority: critical | Milestone: 6.4.3 Component: wxGUI | Version: unspecified Keywords: cartographic composer, psmap, wingrass | Platform: MSWindows XP Cpu: Unspecified | ----------------------------------------------------+-----------------------
Comment(by hamish): Replying to [comment:33 annakrat]: > Replying to [comment:32 hamish]: > > just tested in a wingrass nightly build, preview fails with unable to > > find the ps2pdf program. > > Really preview? It fails when creating pdf file (Export to PDF). right. at creating the pdf, sorry. in the preview tab pressing the green '>' button makes a page, but it is all white except for the map box frame in the preview window. Saving to PostScript makes a nice file on the disk, all's correct there, just the preview image is missing. pressing the PDF button comes back with a pop-up window "ps2pdf exited with return code 1". > ps2pdf seems to be missing, we could add it there or maybe call gs directly? right, no ps2pdf in \extrabin. On Debian, ps2pdf comes with the ghostscript package, it's just a shell script which just calls: {{{ ps2pdfwr -dCompatibilityLevel=1.4 }}} And `ps2pdfwr` is another shell/wrapper script which calls `gs`. It boils down to: {{{ gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH \ -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile=elevation.pdf \ -P- -dSAFER -dCompatibilityLevel=1.4 -c .setpdfwrite -f \ elevation.ps }}} just replace elevation.pdf and elevation.ps with %s, and `gs` for `gswin32c`. I was a little worried about the %stderr option, but I just tried the above on the wingrass dosbox command line and it worked! I've a nice pdf now. Perhaps hardcode the above long command into an if(wingrass) part of the composer code, or maybe cleaner to write a little ps2pdf.bat or ps2pdf.pyw (.pyw to avoid a dosbox popping up; we know python is there..) script to do it? minor cosmetics: * "Generating PostScript..." and "Generating PDF..." never go away after it's done. Can we clear the status bar after the file is closed? * I also notice when you add a mapframe with a raster in wingrass the text in the green rectangle on the draft mode page shows as "MAP FRAME[]raster: mapname"; the newline in the string is rendered as an unknown char instead of a newline. thanks, Hamish -- Ticket URL: <https://trac.osgeo.org/grass/ticket/1554#comment:34> GRASS GIS <http://grass.osgeo.org> _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev