Changing binary to PDF

  • Thread starter Thread starter C#Schroeder
  • Start date Start date
C

C#Schroeder

I am working on a project where I have to take a binary file and
convert it to a PDF file.

The binary file is stored in a database as a Varbinary. What is the
best way to store the binary file. Like is an object, array, interger,
etc.. Also can you point me in the right direction to viewing the
file?


Thanks in advance
Schroeder
 
Schroeder,

The best way to "store" a file in C# is as a stream. One would hope
that the component you're using to convert the file into a PDF can take
a stream as an input. Otherwise, it's basically an array of byte
objects.

Which data would you like to view?

If it's the source file, that varies greatly on what data is being
stored. For instance, if it's an image file (like a TIFF scan), the
best way is to use an image viewer component; you can probably borrow
the Office image viewer if you have it installed or else dump it into a
WebBrowser window. If it's just arbitrary binary data, hex with ASCII
representation is usually how it's done.

If you're trying to view the PDF file, just script in the PDF viewer
COM control. Adobe may have a .NET version that's cleaner, although
you're probably never going to get much control over the whole thing.


Stephan
 

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