You should forget about trying to create an equivalent Font object from PDF 
font information - it won't work for the vast majority of the world's PDFs that 
use embedded fonts.   Even if the font name "matches" one that you have 
installed, MSFT has changed fonts between versions and something won't match.

As Kevin said, you REALLY  need to read ISO 32000-1, the PDF standard to 
understand 1-4...

Leonard

From: Shujaat [mailto:[email protected]]
Sent: Wednesday, September 19, 2012 8:05 AM
To: [email protected]
Subject: Re: [iText-questions] PdfContentStreamProcessor not handling TJ 
operator correctly (maybe)

I just updated my local copy and then ported the new function to iTextSharp. 
From the tests I have done so far, there are a few cases where my computation 
provides a slightly different position than the new function. I was looking 
into it when I discovered a somewhat different but very related issue. 
TextRenderInfo provides me with the text font information, but I cannot seem to 
create a System.Drawing.Font object from it that I'd need for doing any text 
drawing in .NET. There is no built-in converter as far as I have seen. One 
alternate is to grab the FullFontName property and try to build it manually, 
but I'm facing the following issues with that:


1.      FullFontName is a 2D array, not a string. I can overcome this issue by 
always reading FullFontName[0][3] for now.

2.      It contains "CJFLDK+" string before the font name. I need to know if 
this is some constant or what. Couldn't find any reference in the code or on 
the Internet. Should I simply trim that?

3.      It also concatenates font style with the font name. For example, my 
machine has only Calibri font installed, but the FullFontName shows it like 
"Calibri-Bold". This is also simple to fix if it will always return font style 
with the font name, separated by dash. This will also solve the issue of not 
having any Style property.

4.      I also need to know the font size in points. I couldn't a property for 
that.

If you could provide an insight into these, I'll do further testing of the 
TextRenderInfo with different fonts and sizes.

Shujaat

________________________________
View this message in context: RE: PdfContentStreamProcessor not handling TJ 
operator correctly 
(maybe)<http://itext-general.2136553.n4.nabble.com/PdfContentStreamProcessor-not-handling-TJ-operator-correctly-maybe-tp4656117p4656379.html>
Sent from the iText - General mailing list 
archive<http://itext-general.2136553.n4.nabble.com/> at Nabble.com.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to