I am using% w / o TextWriter to read / write a card voucher as a Classe
but it does not have the property for letter size, spacing, etc. formatting.
This makes the voucher printed on the thermal printer go out without symmetry.
My question is, is there another Class in C # that does this, 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();
}