0
I’m using the Classe
Textwriter to read/write a card receipt on .txt
however it does not have the property of formatting letter size, spacing, etc.
This makes the proof printed on the thermal printer come out without symmetry.
My question is, is there another Class in C# that does this process, but with the formatting options?
public void LerConfirmacao()
{
if (File.Exists(ConfigurationManager.AppSettings["Comprovante"]))
{
File.Create(ConfigurationManager.AppSettings["Comprovante"]).Close();
}
TextWriter textWriter = File.AppendText(ConfigurationManager.AppSettings["Comprovante"]);
string[] linhas = File.ReadAllLines(ConfigurationManager.AppSettings["001Resp"]);
foreach (string linha in linhas)
{
if (linha.Substring(0, 3) == "029")
{
textWriter.WriteLine(linha.Substring(10));
}
}
textWriter.Close();
if (Directory.Exists(ConfigurationManager.AppSettings["Pagamentos"]))
{
Directory.CreateDirectory(ConfigurationManager.AppSettings["Pagamentos"]);
}
Directory.CreateDirectory(ConfigurationManager.AppSettings["Pagamentos"]);
//File.Create(ConfigurationManager.AppSettings["Pagamentos"]).Close();
string nomeArquivo = ConfigurationManager.AppSettings["Pagamentos"] + "Comprovante_" + PedNumero + "_" + PedFrmPgto;
TextWriter writer = File.AppendText(nomeArquivo);
foreach (string item in File.ReadAllLines(ConfigurationManager.AppSettings["Comprovante"]))
{
writer.WriteLine(item);
}
writer.Close();
}
No formation in plain text files.
– Jéf Bueno
@Is there a way out? Procedure change ... (?)
– Igor Carreiro
Use a single-spaced font for printing (?)
– Jéf Bueno