You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Manfred Pock <po...@gmail.com> on 2015/02/24 14:23:53 UTC

Use your own PageDrawer...

Hi,

why it ist not allowed to derivate or set the an own PageDrawer at the 
current trunk-version of Pdfbox.

It is not possible to derivate it because the PageDrawer is final. It's 
also not possible to set the PageDrawer because he is defined fixed in 
PDFRenderer.

I need this, because i want to paint some annotation at my own. The only 
thing i can to without any Pdfbox-codechanges to remove this annotations 
before i render it.

Could there be a better solution.

Regarts, Manfred

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Re: Use your own PageDrawer...

Posted by John Hewson <jo...@jahewson.com>.
Hi Manfred,

This was a conscious decision for 2.0. By allowing subclassing, we expose the internal details of PageDrawer in our public API, which prevents us from making modifications to the internal workings of PageDrawer, which means we can’t fix bugs or make improvements which require internal refactoring.

If there’s some functionality which you feel is missing from PageDrawer, then please do let us know exactly what that is. I’m sure we can solve it more robustly without subclassing. You do say:

> I need this, because i want to paint some annotation at my own. The only thing i can to without any Pdfbox-codechanges to remove this annotations before i render it.

But I’m not sure what you mean. Are you wanting to draw specific annotations yourself, if so why? Are you unhappy with how PDFBox renders them? Can we improve that?

— John

> On 24 Feb 2015, at 05:23, Manfred Pock <po...@gmail.com> wrote:
> 
> Hi,
> 
> why it ist not allowed to derivate or set the an own PageDrawer at the current trunk-version of Pdfbox.
> 
> It is not possible to derivate it because the PageDrawer is final. It's also not possible to set the PageDrawer because he is defined fixed in PDFRenderer.
> 
> I need this, because i want to paint some annotation at my own. The only thing i can to without any Pdfbox-codechanges to remove this annotations before i render it.
> 
> Could there be a better solution.
> 
> Regarts, Manfred
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
> 


Re: Use your own PageDrawer...

Posted by Daniel Wilson <wi...@gmail.com>.
Thanks, Maruan.  I've added mine at
https://issues.apache.org/jira/browse/PDFBOX-2691

Manfred, if you'd add a comment explaining your use case, I'm sure that
will help the active developers evaluate possible solutions.

On Tue, Feb 24, 2015 at 2:37 PM, Maruan Sahyoun <sa...@fileaffairs.de>
wrote:

> Hi Daniel, hi Manfred,
>
> if you could describe your use case - maybe in a JIRA ticket with an
> enhancement request or by discussing it further in the mailing list - we
> might be able to come up with a solution. There are many changes in PDFBox
> 2.0 compared to 1.8 with the intention to make it better and not with the
> intention to leave people with a good use case behind. In PDFBox 1.8 and
> before a lot was public which didn't have to be that way and made changes
> behind the scenes nearly impossible. That's the main reason why things have
> been made private, package private and final. Having a cleaner public API
> has been the driving factor behind these decisions.
>
> BR
> Maruan
>
> PS: I'm not using PDFBox for rendering - so please understand my comment
> as a general feedback. I think that John, Tilman and others who worked on
> for PDFBox 2.0 will be able to provide a more targeted feedback.
>
>
> Am 24.02.2015 um 19:47 schrieb Daniel Wilson <
> williamstonconsulting@gmail.com>:
>
> > That disappoints me too. I have been deriving from Page drawer for
> several
> > years in order to render in .Net. in order to use 2.0, I would need to
> make
> > my own build of PDF box that changed that.
> > On Feb 24, 2015 8:24 AM, "Manfred Pock" <po...@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> why it ist not allowed to derivate or set the an own PageDrawer at the
> >> current trunk-version of Pdfbox.
> >>
> >> It is not possible to derivate it because the PageDrawer is final. It's
> >> also not possible to set the PageDrawer because he is defined fixed in
> >> PDFRenderer.
> >>
> >> I need this, because i want to paint some annotation at my own. The only
> >> thing i can to without any Pdfbox-codechanges to remove this annotations
> >> before i render it.
> >>
> >> Could there be a better solution.
> >>
> >> Regarts, Manfred
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: dev-help@pdfbox.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
>
>

Re: Use your own PageDrawer...

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi Daniel, hi Manfred,

if you could describe your use case - maybe in a JIRA ticket with an enhancement request or by discussing it further in the mailing list - we might be able to come up with a solution. There are many changes in PDFBox 2.0 compared to 1.8 with the intention to make it better and not with the intention to leave people with a good use case behind. In PDFBox 1.8 and before a lot was public which didn't have to be that way and made changes behind the scenes nearly impossible. That's the main reason why things have been made private, package private and final. Having a cleaner public API has been the driving factor behind these decisions. 

BR
Maruan

PS: I'm not using PDFBox for rendering - so please understand my comment as a general feedback. I think that John, Tilman and others who worked on for PDFBox 2.0 will be able to provide a more targeted feedback.


Am 24.02.2015 um 19:47 schrieb Daniel Wilson <wi...@gmail.com>:

> That disappoints me too. I have been deriving from Page drawer for several
> years in order to render in .Net. in order to use 2.0, I would need to make
> my own build of PDF box that changed that.
> On Feb 24, 2015 8:24 AM, "Manfred Pock" <po...@gmail.com> wrote:
> 
>> Hi,
>> 
>> why it ist not allowed to derivate or set the an own PageDrawer at the
>> current trunk-version of Pdfbox.
>> 
>> It is not possible to derivate it because the PageDrawer is final. It's
>> also not possible to set the PageDrawer because he is defined fixed in
>> PDFRenderer.
>> 
>> I need this, because i want to paint some annotation at my own. The only
>> thing i can to without any Pdfbox-codechanges to remove this annotations
>> before i render it.
>> 
>> Could there be a better solution.
>> 
>> Regarts, Manfred
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: dev-help@pdfbox.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Re: Use your own PageDrawer...

Posted by Daniel Wilson <wi...@gmail.com>.
That disappoints me too. I have been deriving from Page drawer for several
years in order to render in .Net. in order to use 2.0, I would need to make
my own build of PDF box that changed that.
On Feb 24, 2015 8:24 AM, "Manfred Pock" <po...@gmail.com> wrote:

> Hi,
>
> why it ist not allowed to derivate or set the an own PageDrawer at the
> current trunk-version of Pdfbox.
>
> It is not possible to derivate it because the PageDrawer is final. It's
> also not possible to set the PageDrawer because he is defined fixed in
> PDFRenderer.
>
> I need this, because i want to paint some annotation at my own. The only
> thing i can to without any Pdfbox-codechanges to remove this annotations
> before i render it.
>
> Could there be a better solution.
>
> Regarts, Manfred
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
>
>