2

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 TextFormat()
        {
          FontName = "Courier New",
          FontSize = 10.0f,
          ForeColor = Color.Black,
          Language = 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();
}

Edited: Attached image as per commenter's request.

enter image description here

fletchsod
  • 3,181
  • 6
  • 31
  • 58
  • You may want to post a picture so that we don't have to wonder what "blurry/sponge" means :-) – paxdiablo Jun 30 '20 at 22:24
  • @paxdiablo - done – fletchsod Jul 01 '20 at 12:57
  • Blurry/sponge is a novel way to describe matters for sure :) Could you post a link to an example PDF file? If it's the PDF that's wrong, it would be good to have a sample so we can investigate why it might be wrong... – David van Driessche Jul 01 '20 at 15:06
  • @DavidvanDriessche - Googled & found a tmp online fire sharing to use. Here it is at https://file.io/JyptIUcf . Just download it, open it up in Adobe PDF Reader app & print it through dotmatrix printer. We use Oki Microline 420 printer & Win10 printer driver is we had to install manually (not part of Win10) is Epson FX 100 . We set it to DPI high resolution there. You might not be able to get it right this way. I'm pretty sure it is the GrapeCity code that I'm missing in the posted script above. – fletchsod Jul 01 '20 at 17:50
  • Your link gives a 404 not found page unfortunately – David van Driessche Jul 01 '20 at 17:57
  • @DavidvanDriessche - Try this one at https://tmpfiles.org/download/58456/PdfViewer16.pdf. – fletchsod Jul 01 '20 at 18:39
  • this is strange, grapecity pdf is not involved in the printing process as it only saves to PDF. can you try a different font type to see where the issue might be. – GrapeCity Team Jul 11 '20 at 04:16
  • @GrapeCityTeam - It's a bug on your end with GrapeCity Documents PDF software. We have no issue with jsPDF & Courier New printed beautifully w/ the DotMatrix Printer. – fletchsod Jul 17 '20 at 18:51

0 Answers0