Posted 30 June 2020, 6:10 pm 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();
}