How do I subscribe to receive blog comments to my e-mail?
PDFGraphics2D and Mac
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Java Programming > PDFGraphics2D and Mac 11 May 2005 02:52:07

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

PDFGraphics2D and Mac

Intellisys 11 May 2005 02:52:07
 Hi,

There is a problem with using PDFGraphics2D on the Mac , which throws an
exception when setRenderingHint() is called with a certain value; the message
of the exception thrown is:
"null incompatible with Text-specific antialiasing
enable key."

This has been mentioned on this list before, I believe. A simple fix for this
would be to add a try-catch block to the setRenderingHint() method in
PdfGraphics2D.

However, let's assume that there is a reason not to put in the abovementioned
try-catch block into PdfGraphics2D, so that this solution is inadmissible.

Then, the logical solution would be for the user to extend PdfGraphics2D and
override the setRenderingHint() method. However, the way PdfGraphics2D is
written makes this impossible. The only visible constructor:

PdfGraphics2D(PdfCo­ntentByte cb, float width, float height, FontMapper
fontMapper, boolean onlyShapes, boolean convertImagesToJPEG­, float quality)

is package private, implying that a subclass must also be in the package
com.lowagie.text.pd­f

Even if you create a subclass in this package, it still doesn't work, because
the method
create()
also has to be overwritten to return an object of the subclass type, and the
no argument constructor is private. Further, the create method uses a number
of private variables that the subclass has no access to.

A gross solution to this problem would be to change everything that's private
in the PdfGraphics2D class to protected. I'm sure the developers can think of
better solutions.

On the other hand, if the intention is to not allow subclasses of PdfGraphics
to be made, why not just mark it final?

In any case, if it's hard to follow what I'm trying to say, this experiment
will make it totally clear - just modify the setRenderingHint() method of
PdfGraphics2D to throw an exception, and then try to create a subclass of
PdfGraphics2D to work around that exception.

Looking forward to your comments,
SPC.





-------------------­--------------------­----------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com­/?ad_id=7393&alloc_i­d=16281&op=click
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Java Programming > PDFGraphics2D and Mac 11 May 2005 02:52:07

see also:
mail server functionality
Re: [OGo-Developer] Outlook integration
Authentication on Lucene Search…
пройди тесты:
see also:
For My dear Ire san
The Lyric of Song Evil Aura
Microsoft France Site Defaced by…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .