Printing of pvc badge with thermal printer

4

I have a thermal printer to do a test print of badges with pvc cards.

At first I put up a badge template in ReportViewer and I'm generating it in pdf . And apparently it's losing a lot of quality when it comes up in that format.

I would like to know how to improve the way to generate this badge and print it with this type of printer? Considering printing correctly with this printer and getting quality.

    
asked by anonymous 27.05.2014 / 13:36

1 answer

1

As I'm generating PDF in an ASP.NET-MVC project I'm using a method that renders the report and then makes it available for viewing in the browser.

public FileContentResult RenderReport(string reportName, List<dynamic> data, string format = "PDF", string deviceInfo = "")
{
    LocalReport localReport = new LocalReport();
    localReport.ReportPath = Server.MapPath("~/Reports/" + reportName + ".rdlc");

    // Passa os dados para o arquivo .xsd
    ReportDataSource reportDataSource = new ReportDataSource(reportName, data);
    localReport.DataSources.Add(reportDataSource);

    format = format.ToUpper();
    string mimeType;
    string encoding;
    string fileNameExtension;

    if (Common.Strings.IsEmpty(deviceInfo))
    {
        deviceInfo = "<DeviceInfo>" +
                        "  <OutputFormat>" + format + "</OutputFormat>" +
                        "  <PageWidth>21cm</PageWidth>" +
                        "  <PageHeight>11in</PageHeight>" +
                        "  <MarginTop>2cm</MarginTop>" +
                        "  <MarginLeft>2cm</MarginLeft>" +
                        "  <MarginRight>2cm</MarginRight>" +
                        "  <MarginBottom>2cm</MarginBottom>" +
                        "</DeviceInfo>";
    }

    Warning[] warnings;
    string[] streams;
    byte[] renderedBytes;

    renderedBytes = localReport.Render(
        format,
        deviceInfo,
        out mimeType,
        out encoding,
        out fileNameExtension,
        out streams,
        out warnings);

    return File(renderedBytes, mimeType);
}

The last parameter of this method was added and then set the default values for the card. Ready. With this, the card / badge started to be generated with quality.

    
17.06.2014 / 15:10