On 17.03.2008 09:43:37 thebluemountain wrote:
> Hi,
> 
> I need to support embedding files as attachment when generating pdf file.
> 
> I've been
> - registering my element (using element mapping class). the Attachment class
> extends the AbstractGraphics

An embedded file doesn't have any visual appearance in the PDF file so
deriving from AbstractGraphics is wrong.

> now, for the layout manager, i've been trying to extend the
> AbstractGraphicsLayoutManager: however, the class defines a method abstract 
> Area
> getChildArea() that prevents from extending, unless from same package.
> 
> What i've then been doing was copying the AbstractGraphicsLayoutManager code
> into my AttachmentLayoutManager that now extends LeafNodeLayoutManager.
> 
> 1- Is there any reason the getChildArea () is restricted to classes in same
> package ?

AFAIK, noone has written an external extension that requires a layout
manager, yet. It could very well be that this will require some tweaking
the first time someone does that. But as mentioned above for your case
this is the wrong approach.

> 2- Should I do it another way ?

Yes. Take a look at https://issues.apache.org/bugzilla/show_bug.cgi?id=44460
Andrejus Chaliapinas has already started to write a patch for the same
thing. I rejected the first patch because of the issues listed. Andrejus
hasn't submitted a new version since. Maybe you can help him finish the
patch the way we need it. You can contact him through the Bugzilla issue.
I'll gladly review the improved patch once it's available.

> Thank you for your help
>
> Daniel



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to