Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 1 of 7 (714 Views)

MyByteReader to Stream Reader

714 Views, 6 Replies
11-09-2012 01:19 PM

Can I get the data from MgByteReader, and turn to Stream Reader; so I can make a pdf map using iTextSharp?

Valued Mentor
jackie.ng
Posts: 284
Registered: ‎10-06-2008
Message 2 of 7 (703 Views)

Re: MyByteReader to Stream Reader

11-11-2012 06:27 PM in reply to: swimming123

You can try this class I wrote, that provides a System.IO.Stream adapter over the MgByteReader:

 

http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Desktop/MapViewer/MgReadOnlyStream.cs

 

- Jackie

Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 3 of 7 (688 Views)

Re: MyByteReader to Stream Reader

11-13-2012 12:20 PM in reply to: jackie.ng

Thank you Jackie,

 

when I add your class to my project, I found I cannot reference the namespace OSGeo.MapGuide.Viewer; And Line 216 "Strings" not exist in the context. I am pretty new, can you help me more? Thanks again.

Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 4 of 7 (685 Views)

Re: MyByteReader to Stream Reader

11-13-2012 05:43 PM in reply to: swimming123

Did I need other assembly class files?

Valued Mentor
jackie.ng
Posts: 284
Registered: ‎10-06-2008
Message 5 of 7 (681 Views)

Re: MyByteReader to Stream Reader

11-13-2012 06:47 PM in reply to: swimming123

That file can't just be dropped in, so change/rename the namespace

 

Strings.ErrorStreamNotRewindable is just a localizable message, just replace it with something equivalent

 

- Jackie

Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 6 of 7 (678 Views)

Re: MyByteReader to Stream Reader

11-13-2012 07:13 PM in reply to: swimming123

I create a new class file and paste your code there, but still I cannot new a MgReadOnlyStream. I cannot find the problem is.

Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 7 of 7 (668 Views)

Re: MyByteReader to Stream Reader

11-14-2012 07:28 AM in reply to: jackie.ng

Finally I get the MgReadOnlyStream. Thank you Jackie.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!