c# - Graphics.TextRenderingHint property doesn't change in printing -


i have application job print on preexisting preprinted labels, important text printed in precise way, looks when user places during editing. use gdi+ methods that.

i noticed there difference between printed font , 1 shown in preview , found out during printing not possible set graphics.textrenderinghint property value singlebitperpixelgridfit. try set value of textrenderinghint antialias, doesn't change.

here example of code:

  private void printdoc_printpage(object sender, printpageeventargs e)     {         printdocument printdoc = (printdocument)sender;         e.graphics.pageunit = graphicsunit.millimeter;         //i try set value of textrenderinghint antialias, doesn't change         e.graphics.textrenderinghint = system.drawing.text.textrenderinghint.antialias;          string line = "line of text";         system.drawing.font textfont = new system.drawing.font("arial", 5f, fontstyle.regular);         stringformat sf = new stringformat(stringformatflags.nowrap);          e.graphics.drawstring(line, textfont, brushes.black, position.x, position.y, sf);     } 

i think should use option of textrenderinghint independent grid fitting in order have printed document absolutely identical preview.

how can accomplish that?

i had similar problem. trying cleartypegridfit displayed, singlebitperpixelgridfit displayed. found out did not enable cleartype in display settings. after enabling cleartype textrenderinghint started work. check.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -