Link to home
Start Free TrialLog in
Avatar of pure032398
pure032398

asked on

How to get some binary data?

Hi folks.

  i have some code that converts HTML into a PDF format (binary) using our ActivePDF Server + Webgrabber software, here at work.

Works perfectly, etc.

   Now that i'm converting my code from asp -> c#, i cannot do the following :-


   (ERRORS) strTextBinary = objAPServer.GetBinaryImage( strFileName );

objAPServer is an instance of the ActivePDF Server class :-

   eg. APServerNET.APServer objAPServer = null;


   The error is that the GetBinaryImage() function returns a type 'object'.


   So then i tried this ....

   object test = null;
   test = objAPServer.GetBinaryImage( strFileName );

   compiled.  but i still have NO IDEA how i can get the CONTENT of this object...


   Why am i using GetBinaryImage then???
   well, in my working (old/traditional) ASP code, this is what i did...

   Response.BinaryWrite(objAPServer.GetBinaryImage( strFileName )


   and becuase i'm now proigramming this in C#, i do not want to write anything to the screen/console, becuase this is all encapsualted in a class. i wish for the class to return a binary string instead - so the person who USES my class can have the raw binary data and do what they want with it -> ie. save to disk, display to page, etc.


    any suggestions folks?
Avatar of Nebulus_
Nebulus_

first:
- is ActivePDF Server class a COM class?
- can you show me its interface?

second:
- you can use your code:
object test = null;
test = objAPServer.GetBinaryImage( strFileName );
- get test object in debug mode and view Type instance
associated with test:
Type a = test.GetType();
- look at Is... properties now: (IsArray, IsByRef, IsClass, IsEnum, etc.)

maybe this can be a start. :)
ASKER CERTIFIED SOLUTION
Avatar of Buzzby
Buzzby

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial