.net - PDF4NET: Change orientation of Canvas.DrawText() -
.net - PDF4NET: Change orientation of Canvas.DrawText() -
in 1 of application utilize pdf4net
to print info onto pdf-file. goal utilize method drawtext
.
right question has arisen specific countries/labels (arabic) orientation must alter left right
right left
current method print text:
page.canvas.drawtext(strobj, mainxmlnode.pdffont, nothing, pdfnode.pdfbrush, pdfnode.x , pageposy, pdfnode.angle)
method definition of drawtext
public sub drawtext(byval text string, byval font o2s.components.pdf4net.graphics.pdffont, byval pen o2s.components.pdf4net.graphics.pdfpen, byval brush o2s.components.pdf4net.graphics.pdfbrush, byval x single, byval y single, byval orientation single)
changing orientation/angle +180
or -180
causes text drawn upsidedown
. not quite result needed.
my thought utilize strinverse inverse order of string
, print right left
. yet lastly step keeps bugging me. can't seem find right method/parameters alter direction string printed.
so question all, have of come across same problem , how did tackle it?
thank time
update: other (non pdf4net) solutions welcome aswell.
note: has .net 2.0 compatible
i've found solution: method drawtext
has definition:
public sub drawtext(byval text string, byval font o2s.components.pdf4net.graphics.pdffont, byval pen o2s.components.pdf4net.graphics.pdfpen, byval brush o2s.components.pdf4net.graphics.pdfbrush, byval x single, byval y single, byval orientation single, byval align o2s.components.pdf4net.graphics.shapes.textalign)
don't decieved name align
. isn't align within textbox
. although has same possiblities:
bottomcenter bottomleft bottomright middlecenter ...
when using drawtext
-method align, start printing in direction. example
public sub drawtext("abc",....,12,14,0,textalign.bottomright)
this print abc
starting @ (x= 12 & y=14)
letters printed left of point starting c
it follows point presenting (by approximation) x=12 & y=14
:
abc.
.net vb.net drawtext
Comments
Post a Comment