On 02/06/2011 08:47, mehdi houshmand wrote:
Hi Rob,
Hi Rob,
Mehdi is right that the problem when generating IF is down to the way
the fop.xconf is organized by Renderer. The command line option he
mentions is the way to resolve this from the command line. The API code
we use to set the Mimic Renderer (the renderer from which to lookup
configuration for the IF Renderer in the fop.xconf) is shown below:
IFDocumentHandler targetHandler =
m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent,
mimeType);
IFSerializer ifSerializer = new IFSerializer();
ifSerializer.setContext(new IFContext(m_foUserAgent));
ifSerializer.mimicDocumentHandler(targetHandler);
HTH,
Chris
I just tested this on my system and I was finding the same results as
you... When I set the output format to IF, FOP wasn't working. So
anyway, I fixed it by setting the output MIME type, which is done via
the command line as such:
./fop -c fop.xconf test.fo -if<insert mime-type> output.if
so in my case it was:
./fop -c fop.xconf test.fo -if application/pdf output.if
When you think about it, it does make sense. You refer to fonts in the
fop.xconf as a child of their rendering output, which allows you to
distinguish different font files according to the document output
format. There wouldn't be any way of FOP knowing your desired FINAL
output format if you were processing to IF.
How you do that using FOPs API, I don't know, but I can't imagine that
would be hard to find out.
Mehdi
On 1 June 2011 19:18, Rob Sargent<[email protected]> wrote:
Again with thanks to Jeremias, I'm successfully sizing the region-before for
dynamically generated tables. I'm doing this via and xslt extension function
(Xalan style).
The xslt extension calls my sizing function which employs fop-1.0 to
generate an IF from the given dom.Node. I notice that during the function's
invocation of fop-1.0 that the named fonts are not found and are substituted
with "any" in the resultant intermediate format output, with font-size=1000
(!!!!), with log messages like 'Font "Optima-Oblique,normal,700" not found.
Substituting with "any,normal,700'. I'm doubly confused because the fo is
ultimately processed to pdf by the same fop-1.0.
I have to confess that I'm invoking fop reflectively since we have many
versions in play and I need each to have their own classpath. That said the
same invocation happens for both the extension and the final processing.
Here's part of the where the font path is set:
final Method setFontBaseURLMethod =
fopFactoryClass.getMethod("setFontBaseURL", new Class[]{String.class});
String fontsURL = "file://" + bundlePath + fopHome + "/fonts";
setFontBaseURLMethod.invoke(fopFactory, new Object[]{fontsURL});
I suspect there is some subtle distinction between generating IF and PDF
output?
I get good results with this if the caller of my function is processed with
fop-1.0. If the caller is processed by fop-0.95 the estimated size is much
too large and I mis-size the region. In both cases the IF has
'font-name="any"' so I'm a little surprised it work at all?!
Any pointers on where I've messed up would be greatly appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]