PVC badge printing with thermal printer

Asked

Viewed 925 times

4

I’m with a thermal printer to do some tests of printing badges with cards pvc.

At first I set up a model badge on Reportviewer and I’m generating it in pdf.
And apparently she’s losing a lot of quality when I’m in this format.

I’d like to know how to improve how to generate this badge and print it with this type of printer? Taking into consideration printing in the right shape with this printer and get quality.

  • 2

    Maybe using bitmaps or something? Memory consumption goes to space, I know, but you can achieve a correlation from one pixel on the screen to one on the printer if you put a lot of effort into it.

  • 2

    Generate and render directly using the .NET. classes so you have more control. However, it can be too much brute force... I do not know if it is the most suitable, or if there is a more elegant solution. I hope that someone can suggest something better as a response.

  • 4

    I had a similar problem, pdf really was the best solution, but Reportviewer did not. Parti pro GMC Inspire and I didn’t have any more problems.

  • You note the loss of quality when you see in the PDF or when you print?

  • The answer to your question depends on a few factors. In what part of the process is the badge losing resolution? After printing all content features aliasing? Or fonts, etc are printed in high resolution, but visual features like bitmaps do not?

1 answer

1

As I am generating in PDF in an ASP.NET-MVC project I am using a method that renders the report and then makes it available to be viewed 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 I set the default values for the card. Ready. With this the card/ badge is now generated with quality.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.