[Geomoose-users] Create a quick print button

Len Kne lkne at houstoneng.com
Mon Dec 28 13:33:52 EST 2009


It would take a quick modification to print.php.  GeoMOOSE normally looks for a two part response from the service, the first part is JavaScript that GeoMOOSE will execute and the second is HTML text for the tab.  The current print service only sends HTML for the tab, thus you get the list of print format options.  If we send JavaScript as well to open a new window with the PDF, that should give you the result you are looking for.


1.       Look in print.php for the following section:

header("Content-type: application/xml");
print "<results><script>";

if($mode == "feature_report"){
                print '<![CDATA[window.open("php/download.php?id='.$uniqueId.'&ext=pdf");GeoMOOSE.changeTab("catalog-tab");]]>';
}
print "</script>";

(this was not in 2.01, so you may have to download the newer version from SVN)


2.       Change this block to look like this:

header("Content-type: application/xml");
print "<results><script>";

if($mode == "feature_report"){
                print '<![CDATA[window.open("php/download.php?id='.$uniqueId.'&ext=pdf");GeoMOOSE.changeTab("catalog-tab");]]>';
}
if($mode == "print_pdf"){
                print '<![CDATA[window.open("php/download.php?id='.$uniqueId.'&ext=pdf");]]>';
}
print "</script>";


3.       Edit the "Print" service (or create a copy) in the mapbook and add :

<input type="hidden" name="mode" value="print_pdf" />


4.       I think that should do it.  We should maybe think about adding this feature as a mapbook or settings.ini configuration option.

Len

From: FRANZ OKYERE [mailto:franzzoa at hotmail.com]
Sent: Monday, December 28, 2009 12:03 PM
To: geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] Create a quick print button

Hi Boo, I think geomoose service's always means we can't by-pass php, which has to make one output or the other for the user to click.. Personally I'm struggling with creating a quick print and a quick popup.       Franz. Gis Specialist.
________________________________
From: eboesenberg at niraengineers.com
To: geomoose-users at lists.sourceforge.net
Date: Tue, 15 Dec 2009 13:23:10 -0500
Subject: [Geomoose-users] Create a quick print button
I have my PDF templates setup so that I can easily print or save a PDF of the map image but I would like to create a "Quick Print" button that would print out a PDF created from the printing templates.  Can this be easily done?

Thanks,

Edward E. Boesenberg, III
CADD / GIS Manager
Nira Consulting Engineers, Inc.
950 Fifth Avenue
Coraopolis, PA 15108
www.niraengineers.com<http://www.niraengineers.com>
eboesenberg at niraengineers.com
T: 412-262-3970
F: 412-262-1938


________________________________
Have more than one Hotmail account? Link them together to easily access both.<%20http:/clk.atdmt.com/UKM/go/186394591/direct/01/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20091228/11000d46/attachment.html


More information about the Geomoose-users mailing list