Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys. I got a binary file with DVI extension and i need to get the information inside of it. Of course i can use some application such as LatexEditor or something but i want to create my own application. So please help me to create such program.

I used google but i could'nt find any useful source. May be i used wrong key word.
Most Possible resoure is U guys.

I tried read it by byte stream but it wasn't good idea.
What i did is
FileInfo f = new FileInfo("name.dvi");
BinaryReader br = BinaryReader(f.OpenRead() );
while( br.PeekChar()!= -1)
{
consele.writeline( br.ReadByte() ); // just for check
}


If some one who worked something like that or knows any thing ralated to binary file then pls give me some source code or exact name of library.


Thank u.
Posted
Updated 28-Jan-10 9:55am
v3

Reading it is easy, File.ReadAllBytes will do that. I think what you mean is, to get the information out of the file. To do that, you need to read the file format, if you can find it documented anywhere, or just plain work it out. It's a lot of work, unless you can find a library that does it for you.
 
Share this answer
 
T-Joe wrote:
Plz give me proper answer


Christian Graus has given you a good proper answer. I didn't respond before since he answered your question just fine. My answer here is just the same as his, but in different words with some differences in supplemental details. You may need to spend some time working your way through the answer multiple times until you understand it.

Also, if you need to modify or update your question, you can edit it. That is more appropriate than adding an answer that isn't one.


T-Joe wrote:
I tried read by byte stream but it gave me some numbers.

That is exactly right and that is exactly what you should have expected before you tried it. All any file is, is some numbers. The trick is interpreting what they represent. For that you need to what type of file you are dealing with and how it represents things. Your .DVI file might be an Action Media II Digital Video Interactive Movie. It might be a TeX Device Independent Document. It might be something totally different. You, T-Joe, need to determine this first. Then you, T-Joe, will need to research and gather information about that file type. If you are exceedingly fortunate you may turn up a file format specification. You may end up trying to reverse engineer the format. You might find a library you can use - this would be the most effective possibility.

At a guess, but only a guess, it is likely that you are dealing with TeX Device Independent Documents. If this is the case, then you will find lots of information about it when you, T-Joe, use google in your research efforts. You will even turn up source code in C (though I don't expect you to find much, if any, in C#). You will even find information like this[^]. Then you will have to leave your sleeves rolled up :-D (you did roll them up to use Google, no?) and apply your elbow grease to the problem you have undertaken.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900