Click here to Skip to main content
15,925,602 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralDataGrid New Row Pin
Madni Abbasi1-Aug-05 5:53
Madni Abbasi1-Aug-05 5:53 
GeneralRe: DataGrid New Row Pin
Jim Matthews1-Aug-05 6:46
Jim Matthews1-Aug-05 6:46 
GeneralRe: DataGrid New Row Pin
lata07mahi2-Aug-05 2:18
lata07mahi2-Aug-05 2:18 
Questionhow to use picture attribute of user class in active directory Pin
nanba1-Aug-05 5:30
nanba1-Aug-05 5:30 
AnswerRe: how to use picture attribute of user class in active directory Pin
Dave Kreskowiak1-Aug-05 8:01
mveDave Kreskowiak1-Aug-05 8:01 
GeneralRe: how to use picture attribute of user class in active directory Pin
nanba3-Aug-05 23:03
nanba3-Aug-05 23:03 
GeneralRe: how to use picture attribute of user class in active directory Pin
Dave Kreskowiak4-Aug-05 0:51
mveDave Kreskowiak4-Aug-05 0:51 
GeneralParsing Postscript in VB.NET Pin
Christopher K. Campbell1-Aug-05 3:52
Christopher K. Campbell1-Aug-05 3:52 
I'm new to file handling in VB.NET as well as new to parsing Postscript so bear with me...

I am parsing large .ps files into smaller ones by detecting document breaks inserted into the Postscript code using comments. For example: On the first page of each document, there is a unique comment string followed by a file name. I use the file name to name the resulting parsed file. For those not familiar with Postscript, many of the print resources (i.e. images, fonts, etc.) as well as page layout, margins...you get the idea...are defined up front. Then, individual pages follow and finally a trailer section that wraps up the file with page counts and stuff.

My program scans through the Postscript code looking for the first page. It then saves the prefix section in a character array and jumps to about 1K from the end of the file and looks for the trailer (I do this because the files are large and I don't want to pass through the entire stream twice). I save the trailer in a second array and then jump back to where I left off after reading the prefix.

Finally, I start processing the individual pages. Each time I find the file name comment, I open a new text file, write out the prefix array, then loop through all of the pages until I find the next file name comment, writing out the pages as I go. When I've found the last page, I write out the trailer array (updating pages counts and such), close the file, open the file for the next document.

Works great...until...I came across a .ps file with a large image stored as a chunk of binary data embedded in the prefix section. So now to the details.

I was using a Filestream with a BinaryReader to read the input data. I was using the ReadChar method to return each character, store it in the array and move on. This was working great until the aformentioned file came into my life. When that file was processed I started getting the "Conversion buffer overflow" error that I've read so much about. It always happened on the same byte (containing x'FF'). The odd thing was that many other bytes around it contained the same data and it didn't have a problem. I tried switching the program to use a StreamReader and that got around the conversion buffer error but now I was having problems jumping around in the file due to buffering and I couldn't get the DisposeBufferedData method to work for me. So, I tried switching to using the ReadByte method of the base Filestream and the program is working BUT (hopefully you're still with me), something in the binary section is getting messed up because now Distiller can't process my Postscript code. My guess is that a conversion in the binary data is happening because I don't understand something low-level that is going on under the covers of the Filestream class.

So, to make a long story short (too late), can anyone point me in the right direction? Do I need to go back to using a BinaryReader and handle the data at a lower level? Postscript files are just text files and we have done similar things in VB6 without so much trouble. Anyone know a good book on file handling in VB.NET?

Any help, pointers, or direction would be appreciated.

Thanks,

Chris
GeneralRe: Parsing Postscript in VB.NET Pin
progload1-Aug-05 9:54
progload1-Aug-05 9:54 
GeneralRe: Parsing Postscript in VB.NET Pin
Christopher K. Campbell1-Aug-05 10:11
Christopher K. Campbell1-Aug-05 10:11 
GeneralRe: Parsing Postscript in VB.NET Pin
progload1-Aug-05 10:26
progload1-Aug-05 10:26 
QuestionHow To Generating a Product Key Pin
Mark061-Aug-05 2:28
Mark061-Aug-05 2:28 
AnswerRe: How To Generating a Product Key Pin
progload1-Aug-05 11:12
progload1-Aug-05 11:12 
Generalpowerpoint in vb.net Pin
dap_qk1-Aug-05 2:26
dap_qk1-Aug-05 2:26 
GeneralRe: powerpoint in vb.net Pin
Dave Kreskowiak1-Aug-05 7:58
mveDave Kreskowiak1-Aug-05 7:58 
GeneralRe: powerpoint in vb.net Pin
dap_qk1-Aug-05 14:49
dap_qk1-Aug-05 14:49 
GeneralRe: powerpoint in vb.net Pin
Dave Kreskowiak1-Aug-05 14:55
mveDave Kreskowiak1-Aug-05 14:55 
GeneralRe: powerpoint in vb.net Pin
dap_qk1-Aug-05 15:43
dap_qk1-Aug-05 15:43 
GeneralRe: powerpoint in vb.net Pin
Anonymous3-Aug-05 3:48
Anonymous3-Aug-05 3:48 
Generalconvert string to integer Pin
angeltsoi1-Aug-05 0:43
angeltsoi1-Aug-05 0:43 
GeneralRe: convert string to integer Pin
toxcct1-Aug-05 1:06
toxcct1-Aug-05 1:06 
GeneralRe: convert string to integer Pin
J4amieC1-Aug-05 1:49
J4amieC1-Aug-05 1:49 
Generallooking for this... Pin
Rizwan Bashir1-Aug-05 2:51
Rizwan Bashir1-Aug-05 2:51 
QuestionHow to add a control on a winform? Pin
rushing31-Jul-05 23:47
rushing31-Jul-05 23:47 
AnswerRe: How to add a control on a winform? Pin
Rizwan Bashir1-Aug-05 2:53
Rizwan Bashir1-Aug-05 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.