You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Andreas L Delmelle <a_...@pandora.be> on 2005/09/23 18:32:53 UTC

More page-height and -width: "auto"?

Hi,

Another question related to page-height and page-width properties on 
simple-page-master:

The Rec states that, in case the value is specified as "auto":
"The 'page-height/-width' shall be determined, in the case of 
continuous media, from the size of the User Agent window, otherwise 
from the size of the media. If media information is not available this 
dimension shall be implementation-defined."

upon which it suggests to use fallbacks of 11in x 8.26in.

Now, I was thinking, since currently the fallback values are used as 
defaults --which, strictly speaking, is wrong-- maybe the first step 
towards implementing "auto" could be to define these fallbacks in 
fop.xconf (?) We'd properly set the default to EN_AUTO in 
FOPropertyMapping, and in case the FOUserAgent doesn't provide any 
values for them, the fallbacks in FOP's default configuration could be 
used, and a user could override these in his own userconfig.xml

This would also be "implementation-defined", but avoids hard-coding the 
fallback values.

I'll gladly take a look at it, if enough people consider this to be 
sensible...


WDYT?

Cheers,

Andreas


Re: More page-height and -width: "auto"?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Sorry for the delay. I needed a FOP-free weekend. :-)

BaseURL and pixelToMillimeter as shown in fop.xconf are indeed not
accessed, yet. Since they configure the user agent directly it makes
sense, IMO, to fetch the values directly in FOUserAgent.setUserConfig(),
as you already suggested.

On 24.09.2005 23:30:07 Andreas L Delmelle wrote:
> On Sep 24, 2005, at 00:22, Andreas L Delmelle wrote:
> 
> > <snip />
> > The FOUserAgent is reachable to the Maker through 
> > FObj.getFOEventHandler().getUserAgent(), so no problem there, but how 
> > to proceed after fetching the String value...
> >
> > If anyone can offer any hints on this (before I figure it out myself 
> > ;-P), these would be much appreciated.
> 
> OK, figured it out. PropertyMaker.make(PropertyList, String, FObj) was 
> the answer.
> It works now, apart from the user-configurable part, although that 
> shouldn't be much of a problem. My only question there is: where would 
> I best insert the code for that? I tried looking at 'baseURL' and 
> 'pixelToMillimeter' as examples, since they are also present as entries 
> in the user-config, but these entries don't seem to be used anywhere.
> For example: apart from being able to specify -dpi as a command-line 
> switch, there are no calls to FOUserAgent.setResolution() anywhere else 
> (unless I didn't look very well, which happens from time to time :-) )
> Are these entries even supposed to work now, or is this still 
> to-be-implemented? If so, I might as well take care of that here...
> 
> My initial thought is to check for these entries immediately in 
> FOUserAgent.setUserConfig(), and if they are present, set them from 
> there.
> 
> Would that sit right with you all?
> Please respond, I don't like making unilateral decisions :-)


Jeremias Maerki


Re: More page-height and -width: "auto"?

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Sep 24, 2005, at 00:22, Andreas L Delmelle wrote:

> <snip />
> The FOUserAgent is reachable to the Maker through 
> FObj.getFOEventHandler().getUserAgent(), so no problem there, but how 
> to proceed after fetching the String value...
>
> If anyone can offer any hints on this (before I figure it out myself 
> ;-P), these would be much appreciated.

OK, figured it out. PropertyMaker.make(PropertyList, String, FObj) was 
the answer.
It works now, apart from the user-configurable part, although that 
shouldn't be much of a problem. My only question there is: where would 
I best insert the code for that? I tried looking at 'baseURL' and 
'pixelToMillimeter' as examples, since they are also present as entries 
in the user-config, but these entries don't seem to be used anywhere.
For example: apart from being able to specify -dpi as a command-line 
switch, there are no calls to FOUserAgent.setResolution() anywhere else 
(unless I didn't look very well, which happens from time to time :-) )
Are these entries even supposed to work now, or is this still 
to-be-implemented? If so, I might as well take care of that here...

My initial thought is to check for these entries immediately in 
FOUserAgent.setUserConfig(), and if they are present, set them from 
there.

Would that sit right with you all?
Please respond, I don't like making unilateral decisions :-)


Cheers,

Andreas


Re: More page-height and -width: "auto"?

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Sep 23, 2005, at 18:32, Andreas L Delmelle wrote:

>
> Now, I was thinking, since currently the fallback values are used as 
> defaults --which, strictly speaking, is wrong-- maybe the first step 
> towards implementing "auto" could be to define these fallbacks in 
> fop.xconf (?)

Duh! I mean, we still have to hard-code it into FOUserAgent, but the 
intention is to provide the end-user with a way to set defaults 
himself, so that he can use "auto" and specify different values for the 
defaults if he wants to.
So he can switch from A4 to Letter to A5 just by modifying the height 
and width values in his own config file, instead of explicitly 
specifying these in his FO source --although for one FO document, this 
seems to be no improvement, if you have a hundred you wish to render to 
A4 instead of Letter, this begins to make sense. Just use "auto" and 
modify the value once in your custom config.

<snip />
> I'll gladly take a look at it, if enough people consider this to be 
> sensible...

So I didn't wait for responses, but I'm a bit stuck ATM, since I'd like 
to make sure that the user can specify these values in a custom 
fop.xconf in the same format he would specify them in the FO source. 
I'd like to take advantage of the property parser here.

More accurately (see thread about indefinite page-dimensions):
As a first step, I'd like to provide a customized PageDimensionMaker, 
that checks for a specified or initial value of "auto", and then 
returns a LengthProperty based on those defaults.
(In the long term we should also take into account the Rec referring to 
the 'media information', but for now this should suffice.)

The FOUserAgent is reachable to the Maker through 
FObj.getFOEventHandler().getUserAgent(), so no problem there, but how 
to proceed after fetching the String value...

If anyone can offer any hints on this (before I figure it out myself 
;-P), these would be much appreciated.


TIA!

Andreas