You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by an...@yahoo.com on 2006/08/10 13:17:48 UTC

(See page X)

Does anyoneprovide their readers with '(see page 9)' cross references via FOP.

I have a document that is doing this, but because of the issue with the fo:page-number-citation spacing I get big gaps after the last bracket.

The fo is as follows:

<fo:inline>
(see page <fo:page-number-citation ref-id="{id}"/>
</fo:inline>	

I was wondering about using a maximum length?

thanks

Andy R

--
This message was sent on behalf of andyrob_24_7@yahoo.com at openSubscriber.com
http://www.opensubscriber.com/messages/fop-users@xmlgraphics.apache.org/topic.html

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: How to look up metrics-url with HTTP?

Posted by Peter Neu <pe...@gmx.net>.
Hello,

I'm still on 0.20.5. Any possible work around here?

Cheers,
Pete

-----Ursprüngliche Nachricht-----
Von: Manuel Mall [mailto:manuel@apache.org] 
Gesendet: Dienstag, 15. August 2006 13:52
An: fop-users@xmlgraphics.apache.org
Betreff: Re: How to look up metrics-url with HTTP?

On Tuesday 15 August 2006 19:41, Peter Neu wrote:
> Hello,
>
> I'm using fop in a web app. My metrics file is located in folder
> which can be reached by adding /xml to the current url.
>
> How do put this in the userconfig.xml? I wrote it like this. But this
> won't work. Any ideas? Userconfig.xml is in the same folder in the
> web app.
>
>
> <font metrics-url="http:///xml/ttfcm.xml" kerning="no"
> embed-url="http:///xml/verdana.ttf">
>       <font-triplet name="Verdana" style="normal" weight="bold"/>
>     </font>
>

Pete,

if you are using fop 0.92 or later try the font-base configuration 
option (see http://xmlgraphics.apache.org/fop/0.92/configuration.html) 
and remove the http:// prefix from the font-metrics URL.

> Cheers,
> Pete
>

Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to look up metrics-url with HTTP?

Posted by Manuel Mall <ma...@apache.org>.
On Tuesday 15 August 2006 19:41, Peter Neu wrote:
> Hello,
>
> I'm using fop in a web app. My metrics file is located in folder
> which can be reached by adding /xml to the current url.
>
> How do put this in the userconfig.xml? I wrote it like this. But this
> won't work. Any ideas? Userconfig.xml is in the same folder in the
> web app.
>
>
> <font metrics-url="http:///xml/ttfcm.xml" kerning="no"
> embed-url="http:///xml/verdana.ttf">
>       <font-triplet name="Verdana" style="normal" weight="bold"/>
>     </font>
>

Pete,

if you are using fop 0.92 or later try the font-base configuration 
option (see http://xmlgraphics.apache.org/fop/0.92/configuration.html) 
and remove the http:// prefix from the font-metrics URL.

> Cheers,
> Pete
>

Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


How to look up metrics-url with HTTP?

Posted by Peter Neu <pe...@gmx.net>.
Hello,

I'm using fop in a web app. My metrics file is located in folder which can
be reached by adding /xml to the current url. 

How do put this in the userconfig.xml? I wrote it like this. But this won't 
work. Any ideas? Userconfig.xml is in the same folder in the web app.


<font metrics-url="http:///xml/ttfcm.xml" kerning="no"  
embed-url="http:///xml/verdana.ttf">
      <font-triplet name="Verdana" style="normal" weight="bold"/>
    </font>

Cheers,
Pete



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: (See page X)

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 15, 2006, at 11:27, Jeremias Maerki wrote:

> On 15.08.2006 11:17:01 andyrob_24_7 wrote:
>> Any chance on more details about using  the area tree XML format  
>> to determine the page number.
>
> That's non-standard procedure so there's no official documentation.  
> It's
> just a hacky work-around. Just look around in the area tree XML and
> you'll figure out what it can provide for you. Maybe one hint I can  
> give
> is to use "id" properties on key elements so you can identify the
> elements you look for more easily using XPath. "id" property values  
> will
> end up in "prod-id" attributes in the area tree XML.

To expand a little, very roughly, you'll need an XPath like:

//*[@prod-id='...']/ancestor::pageViewport/@nr (or .../@formatted-nr)


Or, to replace all the page-number-citations in the original document  
with their actual values in the area tree:

<xsl:template match="fo:page-number-citation">

   <fo:inline>
     <!-- copy attributes, then ... -->
     <xsl:value-of select="//*[@prod-id=current()/@ref-id]
			/ancestor::pageViewport/@formatted-nr" />
   </fo:inline>

</xsl:template>

Note that, for performance reasons, the above is actually not a good  
example.
You might prefer to index the nodes by @prod-id using an xsl:key, so  
you can retrieve them using the key() function.

>
>> I'm presuming you can't do this in one pass?

Nope. You'll need to render the original FO once to the intermediate  
format, then 'merge' the result into the original document using a  
separate XSL transform, and render the resulting FO to PDF.

The other, less obvious option, is to manipulate the attributes of  
the nodes corresponding to the rendered page-number-citations in the  
area tree, shifting the text into its desired location... The result  
of doing so may, however, not be exactly what you need, but it would  
enable you to render off the same area tree, and skip a second pass  
through layout.


HTH!

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: (See page X)

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 15.08.2006 11:17:01 andyrob_24_7 wrote:
> Any chance on more details about using  the area tree XML format to determine the page number.

That's non-standard procedure so there's no official documentation. It's
just a hacky work-around. Just look around in the area tree XML and
you'll figure out what it can provide for you. Maybe one hint I can give
is to use "id" properties on key elements so you can identify the
elements you look for more easily using XPath. "id" property values will
end up in "prod-id" attributes in the area tree XML.

> I'm presuming you can't do this in one pass?

No, not without fixing the whole issue in code beforehand.

Good luck.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Re: (See page X)

Posted by an...@yahoo.com.
Any chance on more details about using  the area tree XML format to determine the page number.

I'm presuming you can't do this in one pass?

thanks

Andy R

--
This message was sent on behalf of andyrob_24_7@yahoo.com at openSubscriber.com
http://www.opensubscriber.com/message/fop-users@xmlgraphics.apache.org/4650925.html

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: (See page X)

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
This is a known problem, documented in http://xmlgraphics.apache.org/fop/knownissues.html#Layout+Engine
A possible work-around is to determine the page numbers yourself (using
the area tree XML format) and insert those numbers as text instead of
page-number-citation in a second run.

A better work-around would be to fix the problem in the code, but so far,
nobody seems to feel enough of an itch to start on it.

On 10.08.2006 13:17:48 andyrob_24_7 wrote:
> Does anyoneprovide their readers with '(see page 9)' cross references via FOP.
> 
> I have a document that is doing this, but because of the issue with the fo:page-number-citation spacing I get big gaps after the last bracket.
> 
> The fo is as follows:
> 
> <fo:inline>
> (see page <fo:page-number-citation ref-id="{id}"/>
> </fo:inline>	
> 
> I was wondering about using a maximum length?


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org