Hi Kevin,

 

I'm not 100% sure this is related to TJ operator, but the string that it
displays incorrectly is stored within a TJ. The contents of this TJ array
look like this (the full string as it displays in Acrobat is "Marketing
Math". You can see it on Page 14 of the PDF file available in the original
attachment):

 

{
Ma}{-22.5}{r}{-25.5}{k}{-10.2}{e}{-17.6}{t}{-20.7}{i}{-12.3}{n}{-14.1}{g}{-1
7.8}{ }{6526.7}{Ma}{-22.5}{t}{-20.7}{h}{-7.4}{ } 

 

As I have mentioned previously, I've implemented ITextExtractionStrategy to
get the X,Y position of each text chunk and draw it to a bitmap file. Now
when PdfContentStreamProcessor calls RenderText() function for the first
element of this array (" Ma"), I call the GetBaseLine().GetStartPoint()
function of the renderInfo object that I receive as parameter to get its X,Y
location. The value I get for the X coordinate is 212.5197, which is
seemingly incorrect, because in the PDF file the string is displayed
somewhere near 270 (you can simply open the PDF file and take a print screen
to measure it). Interestingly, for the rest of the TJ array elements, the X
coordinate is computed correctly. The final effect is that the string "Ma"
appears at some distance (to the left) from the rest of the string "rketing
Math" in the bitmap. The same string appears just fine in Adobe Reader or
other tools. This happens for quite a few text chunks on this page.

 

Another thing that raises the eyebrow (may or may not be related to this
problem) is the huge text adjust factor you see before the second "Ma" chunk
(6526.7). I'm not sure how iText would handle such a large text adjust
compared to other small values, but it doesn't seem to have any visible
effect in the output. The string "Math" appears at correct position. Again,
I'm not sure if this has anything to do with the original problem.

 

Hope I was able to describe my problem in detail. I'm uploading the output
bitmap here: http://www.mediafire.com/view/?cczann8b736n4pr

 

See the text in 4th and 5th columns of the table (2nd and 4th rows for
example). The text "Ma" and "Bio" appear away from the rest of the strings.
Compare it with page 14 of the original PDF file and you'll see the problem.

 

Best,

Shujaat





--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PdfContentStreamProcessor-not-handling-TJ-operator-correctly-maybe-tp4656117p4656195.html
Sent from the iText - General mailing list archive 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