[mapguide-users] Create PDF with map image
stoff
mail at effing.org
Mon Sep 7 21:08:25 EDT 2009
Hi,
I would like to create a PDF from my HTML-Printlayout with iTextSharp...
This is my approach on Postback:
Dim imgMap As iTextSharp.text.Image =
iTextSharp.text.Image.GetInstance("http://localhost" & hfMapSrc.Value)
where hfMapSrc.Value was allready written in the hfMapSrc on clientside
initDocument():
if (ValidateMapResponse(requester.responseXML.documentElement))" & vbCrLf
strJS = strJS & " {var strSrc=webAgent + " & Chr(34) &
"?OPERATION=GETMAPIMAGE&FORMAT=PNG&VERSION=1.0.0&SELECTION=&MAPNAME=" &
Chr(34) & " + encodeURIComponent(mapName) + " & Chr(34) & "&SESSION=" &
Chr(34) & " + sessionId + " & Chr(34) & "&CLIENTAGENT=" & Chr(34) & " +
encodeURIComponent(clientAgent); " & vbCrLf
strJS = strJS & " document.getElementById(" & Chr(34) &
"mapImage" & Chr(34) & ").src = strSrc;debugger;" & vbCrLf
strJS = strJS & " document.getElementById('" &
hfMapSrc.ClientID & "').setAttribute('value',strSrc);" & vbCrLf
strJS = strJS & " }" & vbCrLf
the hfMapSrc.value is available as:
"/mapguide2010/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&FORMAT=PNG&VERSION=1.0.0&SELECTION=&MAPNAME=internalMap&SESSION=7fc9d4a0-7e3c-102c-8000-000374890932_en_7F0000010AF20AF10AF0&CLIENTAGENT=Ajax%20Viewer"
and Session is still open of course ...
Or Do I really have to move byte by byte ...like done in the scribble
example? Is there a more comfortable solution (with use of itextSharp)?
Best regards, Stoff
--
View this message in context: http://n2.nabble.com/Create-PDF-with-map-image-tp3600303p3600303.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list