Courier New font is blurry/sponge when printing to dotmatrix printer

Posted by: fletchsod.developer on 30 June 2020, 9:10 am EST

  • Posted 30 June 2020, 9:10 am EST

    When printing to dotmatrix printer, I noticed the texts in "Courier New" font are blurry/sponge when using GrapeCity's Document PDF.

    To make sure it's not a printer driver issues, I used MS Word & set that text to "Courier New" with same font size as the one used in GrapeCity PDF. I then print it from MS Word, the text are crystal clear so I know the printer driver & Windows 10 printer setup is ok.

    Does anyone know why it doesn't work too good in GrapeCity.Documents.PDF? How do we fix this script bug properly?

    var pdfDocument = new GcPdfDocument(PdfEditor.GrapeCityLicense);
    var pdfPage = pdfDocument.NewPage();
    pdfPage.PaperKind = PaperKind.Legal;
    pdfPage.Landscape = false;

    var rectangleField = new RectangleF(10f, 20f, 200f, 10f);
    var pdfGraphic = pdfPage.Graphics;
    pdfGraphic.DrawString(
    "Hello World! My car is 2008 Toyota LE Sedan 4 Camary. VIN is 4T1B346K88U780470",
    new gcText::TextFormat()
    {
    FontName = "Courier New",
    FontSize = 10.0f,
    ForeColor = dotnetDrawing::Color.Black,
    Language = gcText::Language.English,
    FontSizeInGraphicUnits = false,
    FontStyle = FontStyle.Regular
    },
    rectangleField,
    TextAlignment.Leading,
    ParagraphAlignment.Near,
    false
    );

    using (var pdfStream = new MemoryStream())
    {
    pdfDocument.Save(pdfStream);
    pdfStream.Seek(0, SeekOrigin.Begin);
    pdfBytes = pdfStream.ToArray();
    }

  • Replied 30 June 2020, 5:54 pm EST

    Hi Scott,

    Sorry for the inconvenience caused.
    To further investigate on this we need the following information from your side so that we can help you to resolve the issue ASAP:

    1: Please provide us the code snippet that you are using to print the document.
    2: Are you facing the issue while printing the pdf after loading it into any viewer?
    3: Please send us the screenshot of the preview of the document showing the issue.

    Regards,
    Prabhat Sharma.
  • Replied 30 June 2020, 11:53 pm EST

    Wish this forum have the option to edit the original post.

    1) There isn't one. We use the `using (var pdfStream = new MemoryStream())` option above, to sent out binaries data for file download, prompting the user to save the file locally.

    2) Yes. It looks great when opened it up in Adobe PDF app that come with Windows 10 (not the web browser pdf plugin). It only does that when I print it from Adobe PDF app.

    3) Three attachements below. First one is from Adobe PDF app (filename - zUntitled.png), 2nd one is from printer printout (filename - 20200701_083823.jpg) & 3rd is from PDF file.

  • Replied 1 July 2020, 10:31 pm EST

    Hi Scott,

    1: Can you please tell us the exact code that you are using to print the pdf via printer so that we can forward this to the developers.

    2: Are you facing issue only with the DotMatrix printer.

    3: In your last post you are talking about 3 screenshots but there were just 2 so can you please attach the 3rd screenshot again.

    Regards,
    Prabhat Sharma.
  • Replied 2 July 2020, 12:35 am EST

    Here's the 3rd file (PDF file as in zipped file)

    PdfViewer (16) - GrapeCity Blurry Font Testcase.zip
  • Replied 2 July 2020, 1:41 am EST

    1: Can you please tell us the exact code that you are using to print the pdf via printer so that we can forward this to the developers.

    We're NOT using any code to print. We only save the PDF file locally, via downloading from the website. Then we open the PDF file up in Adobe PDF Reader DC app.

    Here's the code for PDF file download. The `pdfBytes` got it's data from the original post above (the very 1st post/comment).

    --snip--
    Response.Clear();
    Response.AppendHeader("Content-Length", pdfBytes.Length.ToString());
    Response.ContentType = "application/pdf";
    Response.AppendHeader("Content-Disposition", "attachment;filename=testcase1.pdf");
    Response.BinaryWrite(pdfBytes);
    Response.Flush();
    Response.Close();
    Response.End();
    --snip--

    2: Are you facing issue only with the DotMatrix printer.

    Yes. We use "Epson FX 100" printer driver for Windows 10.

    3: In your last post you are talking about 3 screenshots but there were just two so can you please attach the 3rd screenshot again.

    Done, it's in the previous reply. Just right before this one.
  • Replied 2 July 2020, 11:04 pm EST

    Hi Scott,

    Thank you for the information.
    We have forwarded this to the developers and will let you know once we get any update on this from the customer's end.

    Regards,
    Prabhat Sharma.
  • Marked as Answer

    Replied 3 August 2020, 11:34 pm EST

    Hi Scott,

    Developer needs more information from your side, in order to investigate the issue. Please find the developer's comment for information:
    Does this issue occur only with PDFs generated by GcPdf? If not, please provide a sample PDF that uses text/graphics similar to that in the GcPdf-generated PDF, but prints with high quality on that dot-matrix printer.

    Regards,
    Prabhat Sharma.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels