Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to generate barcode PNR File using c#.net and also need to print using prn file, print bar code with printer and generate .prn file on run time.
Please let me know soon' .
Thanks in advance...

What I have tried:

I don't have idea to create PNR file please provide such references....thanks
Posted
Updated 10-May-16 2:17am
v6
Comments
Richard MacCutchan 10-May-16 3:25am    
What happens?
Sinisa Hajnal 10-May-16 4:25am    
Do you get any errors? Just out of curiosity: why do you print to prn instead of printing directly?

For your "What I have tried: provide references" - google it. This is not free-code-service
Suvendu Shekhar Giri 10-May-16 4:30am    
What is a PNR file?
Are you refering to .prn file?
What is issue with your code?
Patrice T 10-May-16 4:48am    
What is PNR file ?
Meer Wajeed Ali 10-May-16 6:40am    
A PRN file is a special type of file which contains instructions for a printer, it tells the printer what to print on the page and where as well as which paper tray to use, what the paper size is and a number of other controls.

1 solution

I hope you are looking for .PRN file,Here you have online PRN viewer with some sample PRN Data.

http://labelary.com/viewer.html[^]


build your layout from the above link, and build the PRN as you want.
 
Share this answer
 
v2
Comments
Meer Wajeed Ali 14-May-16 5:16am    
ODFK"*"
FS"*"
q856
Q140,34+0
S3
D12
ZT
A670,165,2,2,1,1,N,"K-22 S-2"
A670,140,2,2,1,1,N,""
B670,65,2,3,1,2,32,N,"5050001104"
A670,26,2,3,1,1,N,"5050001104"
A670,110,2,3,1,1,N,"112.CZ ODMB CLR"
A670,90,2,2,2,2,N,"12.000"
FE
FR"*"
?
P1
N


The above is the format of to generate the barcode, here is my requirement is to generate this file.
King Fisher 23-May-16 0:07am    
you got it ?
Meer Wajeed Ali 23-May-16 1:04am    
Yeah got it but in the above PRn Code is 19 lines respectively, in the 2,3,9,10,11,12,13,14 and 16 line I coated text between "" (double quotes), what my actual requirement is within the "" the text will be change remaining code is static.
Below is my method....
private void button1_Click(object sender, EventArgs e)
{
string[] lines;
var list = new List<string>();
var fileStream = new FileStream(@"c:\srctxt1.txt", FileMode.Open, FileAccess.Read);
using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
{
string line="";
while ((line = streamReader.ReadLine()) != null)
{
list.Add(line);
}
}
lines = list.ToArray();

}
King Fisher 23-May-16 8:04am    
I suggest you,give some static name for those text which are with in double quotes , In your method replace the STATIC NAME with your data.
OD
FK"*"
FS"*"
q856
Q140,34+0
S3
D12
ZT
A670,165,2,2,1,1,N,"CAPTION1"
A670,140,2,2,1,1,N,"CAPTION2"
B670,65,2,3,1,2,32,N,"CAPTION3"
A670,26,2,3,1,1,N,"CAPTION4"
A670,110,2,3,1,1,N,"CAPTION5"
A670,90,2,2,2,2,N,"CAPTION6"
FE
FR"*"
?
P1
N

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