lhbit
asked on
itextsharp and displaying fractions
Can't figure this one out. I am creating a pdf dynamically that is displaying numbers of say 40.5, but I need it to display as 40 1/2 with the 1/2 to be the smaller font like Word does it when you type it in there. I've tried adding a new paragraph with the Unicode such as this:
document.Add(New Paragraph("\u00bc", FontFactory.GetFont("sanse rif", 8)))
But it just displays the "\u00bc" as text. Obviously I'm doing something wrong. I know I can use a chunk and raise the text up, but its still not what they want.
Searching is getting me nowhere and even on here it doesn't appear to have been asked ever. Anybody know?
document.Add(New Paragraph("\u00bc", FontFactory.GetFont("sanse
But it just displays the "\u00bc" as text. Obviously I'm doing something wrong. I know I can use a chunk and raise the text up, but its still not what they want.
Searching is getting me nowhere and even on here it doesn't appear to have been asked ever. Anybody know?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If the text Chr is in the paragraph, I suspect you haven't used my code correctly. The function Chr() is called, nowhere is the text "Chr" put in the paragraph in the code I posted.
I'm objecting because I posted a perfectly good and simple solution (a month ago) including an example of the output, whereas your accepted solution is actually a workaround which may be useful but not as fitting to your actual question compared to the solution I posted.
I'm objecting because I posted a perfectly good and simple solution (a month ago) including an example of the output, whereas your accepted solution is actually a workaround which may be useful but not as fitting to your actual question compared to the solution I posted.
Objection: please see my previous post for objecting to the chosen closure.
ASKER
Accepted answer: 0 points for lhbit's comment #a39984436
for the following reason:
Trying to get it to work any other way doesn't work for me from .net, so I'm only posting my solution to close the thread, but keep it in history for somebody else.