LPR failed on Edited PRN file
-
Hi All, I have .Prn file which was generated out of PCL printer.I need to find a string in that file and then I have to replace it with another string. Iam able to do it by using stream writer,streamreader,Binary reader,binary writer and file streams. But if gave a print(LPR)for it, it get failed and giving me syntax error as Illegal tag. If I print original file it is printing very well. I came to know that while writing it has lost some of its originality ,so it was failed Please help me Thanks in advance
-
Hi All, I have .Prn file which was generated out of PCL printer.I need to find a string in that file and then I have to replace it with another string. Iam able to do it by using stream writer,streamreader,Binary reader,binary writer and file streams. But if gave a print(LPR)for it, it get failed and giving me syntax error as Illegal tag. If I print original file it is printing very well. I came to know that while writing it has lost some of its originality ,so it was failed Please help me Thanks in advance
balu12345 wrote:
I have to replace it with another string.
Thats probably whats wrong then. Either the value you are replacing with is illegal OR you are replacing something you didn't mean to. Why not save both the original and your new version to disk and compare them - there are loads of free utilities to compare files.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
-
balu12345 wrote:
I have to replace it with another string.
Thats probably whats wrong then. Either the value you are replacing with is illegal OR you are replacing something you didn't mean to. Why not save both the original and your new version to disk and compare them - there are loads of free utilities to compare files.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
Hi, Thanks for the reply, The original file size is like 16k, after the editing it becoming as 22k.. more over it is not normal file,It is a file generated by PCL printer. So may be during the conversion it is losing printer supported font. so that's the reason printer cannot understand the file(after editing)to print.so it gives syntax error as Kernel and Illegal tag error. I even cannot compare both file because the file is generated by PCL printer which has some non-readable data I have no clues to overcome this problem kindly help me
-
Hi, Thanks for the reply, The original file size is like 16k, after the editing it becoming as 22k.. more over it is not normal file,It is a file generated by PCL printer. So may be during the conversion it is losing printer supported font. so that's the reason printer cannot understand the file(after editing)to print.so it gives syntax error as Kernel and Illegal tag error. I even cannot compare both file because the file is generated by PCL printer which has some non-readable data I have no clues to overcome this problem kindly help me
balu12345 wrote:
The original file size is like 16k, after the editing it becoming as 22k..
So basically what you are doing has corrupted it.
balu12345 wrote:
it is not normal file,It is a file generated by PCL printer.
Yes, so unless you know the format of the file you will mess it up.
balu12345 wrote:
I even cannot compare both file because the file is generated by PCL printer which has some non-readable data
Ther eis no such thing as unreadable data. Use a hex editor to compare, there are plenty freely avalable. It does beg the question though, why do you have to change the PCL file rather than the original data.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP