Can MarshalByRefObject object be transformed into a byte[] array?

  • Thread starter Thread starter BBFrost
  • Start date Start date
B

BBFrost

I'm not having much success from the interop group. So I'm going to
crosspost and hope I don't get flamed too badly

Disclaimer - I don't know much at all about Marshalling and Reflection.

THE QUESTION: Is it possible to transform a MarshalByRefObject object into a
byte[] array? If so, will someone point me at a documentation reference or
better yet a snippet of example code ??

The MarshalByRefObject in this case is a PDF document extracted from
Acrobat's GetActiveDoc( )
method.

I'm hoping there's a way to do this... unfortunately I havn't
stumbled across an example or document that provides the hint(s) I need.

Any help would be very much appreciated. I've been hung since last week
trying to guess at different incantations.

Thanks in advance.

Barry
in Oregon
 
Barry,

What you need is called "Serialization". I gave an example of how to
serialize an object here:
http://groups.google.co.th/groups?h...moFcVXHFHA.3148%40TK2MSFTNGP14.phx.gbl&rnum=1

Please note that each class controls it's own serialization/deserialization,
and depending on what Acrobat programmers decided you might not get the
complete copy of the object (or even a single byte!).

Anyway, what are you going to do with those bytes?

HTH,
Alexander Shirshov
 
Alexander,

Thanks for quick the reply. Its very much appreciated. At
this point I'm desparate for any help at all.

Unfortunately, I can't seem to get to the link you posted
below. However, a quick search around the web lead to
a number of interesting examples of "Serialization". With
your help I now have a focus for my R&D efforts. :)

For instance.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemruntimeserializationiserializableclassgetobjectdatatopic.asp


To answer your question about what we hope to do with
the byte[] array afterwards, we have a large archive of
PDF format documents stored in our database.

I need to convert the PDF document extracted from the Acrobat
Scanning process into a byte[] array before I can insert it
as a blob into our database.

We developed technology years ago that automated Adobe Acrobat
from our C# data entry application. Because of our lack of
sophistication / knowledge of interop practices we ended up
passing documents back and forth between Acrobat & our data
entry application by using a temporary .pdf file on the local
hard drive. The temporary file approach has worked, but it
leaves a lot to be desired. As a result I'm trying to figure
out if there's a way to pass PDF documents back and forth
directly between Acrobat and C#. Being able to retrieve
scanned documents directly from Acrobat would save us a
tremendous amount of problematic 'Rube Goldberg' style
code.

You can see an example of our PDF doc archive by clicking on the
12345 certificate number at the following URL.

http://apps.wrd.state.or.us/apps/wr/wrinfo/wrinfo.php?search_type=SNPID&snpi
d=64734

Again ... thanks!

Barry
in Oregon


Alexander Shirshov said:
Barry,

What you need is called "Serialization". I gave an example of how to
serialize an object here:
http://groups.google.co.th/groups?hl=en&lr=&threadm=umoFcVXHFHA.3148@TK2MS
FTNGP14.phx.gbl&rnum=1&prev=/groups%3Fq%3DAlexander%2Bserializable%26hl%3Den
%26lr%3D%26scoring%3Dd%26selm%3DumoFcVXHFHA.3148%2540TK2MSFTNGP14.phx.gbl%26
rnum%3D1

Please note that each class controls it's own serialization/deserialization,
and depending on what Acrobat programmers decided you might not get the
complete copy of the object (or even a single byte!).

Anyway, what are you going to do with those bytes?

HTH,
Alexander Shirshov



BBFrost said:
I'm not having much success from the interop group. So I'm going to
crosspost and hope I don't get flamed too badly

Disclaimer - I don't know much at all about Marshalling and Reflection.

THE QUESTION: Is it possible to transform a MarshalByRefObject object into
a
byte[] array? If so, will someone point me at a documentation reference
or
better yet a snippet of example code ??

The MarshalByRefObject in this case is a PDF document extracted from
Acrobat's GetActiveDoc( )
method.

I'm hoping there's a way to do this... unfortunately I havn't
stumbled across an example or document that provides the hint(s) I need.

Any help would be very much appreciated. I've been hung since last week
trying to guess at different incantations.

Thanks in advance.

Barry
in Oregon
 
Being able to retrieve
scanned documents directly from Acrobat would save us a
tremendous amount of problematic 'Rube Goldberg' style
code.

Well, forget about serialization then :-). Serialization converts CLR
objects into bytes, and you're working with Acrobat API, right? It all
depends on how Acrobat API returns those scanned documents. Unfortunately I
can't help here...

Alexander
 
Yup. When I tried serialization the app croaked with a message indicating
"cannot be serialized". It was worth a try. I'm trying another approach
which involves moving the scanned document into a pdf document object. I'll
figure it out eventually but my time line for this project is permanently
wrecked. So much for productivity. :)

Your suggestions and help are very much appreciated regardless. You were
the only one brave enough to make a stab at a solution so far. :)

Barry
in Oregon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top