RE: Ideas needed: insert byte[] into XSLFO

2018-03-06 Thread Simon Steiner
HI,

Maybe:
FopFactoryBuilder confBuilder = new FopConfParser(conf, 
RESOURCE_RESOLVER).getFopFactoryBuilder();
FopFactory fopFactory = confBuilder.build();

Thanks

-Original Message-
From: Ulrich Mayring [mailto:u...@denic.de] 
Sent: 06 March 2018 16:33
To: fop-users@xmlgraphics.apache.org
Subject: Re: Ideas needed: insert byte[] into XSLFO

Hi,

data uri is a good idea.

About the resource resolver, I am instantiating my FopFactory from a config 
file:

FopConfParser confParser = new FopConfParser(fopConfigFile); fopFactory = 
confParser.getFopFactoryBuilder().build();

So there's no way to pass a resolver. Perhaps I can put it right into the 
config file?

Ulrich


Simon Steiner schrieb:
> Hi,
> 
> You can use a data uri or use a custom resource resolver.
> 
> FopFactoryBuilder builder = new FopFactoryBuilder(new 
> File(".").toURI(), resolver); fopFactory = builder.build();
> 
> Thanks
> 
> -Original Message-
> From: Ulrich Mayring [mailto:u...@denic.de]
> Sent: 06 March 2018 16:09
> To: fop-users@xmlgraphics.apache.org
> Subject: Ideas needed: insert byte[] into XSLFO
> 
> 
> 
> Hi all,
> 
> I have a byte[] (basically, a PNG or JPG image) that I generated myself and 
> would like to insert it in an XSLFO page at a certain position and render the 
> page to PDF with fop.
> 
> Think of it like a letter with a logo, only that the logo is dynamically 
> created.
> 
> The best way to insert it seems to be fo:external-graphic, but that requires 
> a url, from where the resource is acquired.
> 
> I don't want to save my image to disk or put it on a webserver, so my idea is 
> to somehow make a custom URIResolver, which would supply my generated 
> image(s).
> 
> My question is how do I wire this up into my existing fop workflow, which 
> looks like this:
> 
> FOUserAgent userAgent = fopFactory.newFOUserAgent(); Fop fop = 
> fopFactory.newFop(mimeType, userAgent, outStream); Result res = new 
> SAXResult(fop.getDefaultHandler());
> xslTransformer.transform(xmlSource, res); return 
> outStream.toByteArray()
> 
> There appears to be no way to set a custom resolver. Or perhaps someone has a 
> better idea than to do it via custom URI schemes?
> 
> Many thanks for any pointers,
> 
> Ulrich
> 
> 
> 
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 



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



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



Re: Ideas needed: insert byte[] into XSLFO

2018-03-06 Thread Ulrich Mayring
Hi,

data uri is a good idea.

About the resource resolver, I am instantiating my FopFactory from a
config file:

FopConfParser confParser = new FopConfParser(fopConfigFile);
fopFactory = confParser.getFopFactoryBuilder().build();

So there's no way to pass a resolver. Perhaps I can put it right into
the config file?

Ulrich


Simon Steiner schrieb:
> Hi,
> 
> You can use a data uri or use a custom resource resolver.
> 
> FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI(), 
> resolver);
> fopFactory = builder.build();
> 
> Thanks
> 
> -Original Message-
> From: Ulrich Mayring [mailto:u...@denic.de] 
> Sent: 06 March 2018 16:09
> To: fop-users@xmlgraphics.apache.org
> Subject: Ideas needed: insert byte[] into XSLFO
> 
> 
> 
> Hi all,
> 
> I have a byte[] (basically, a PNG or JPG image) that I generated myself and 
> would like to insert it in an XSLFO page at a certain position and render the 
> page to PDF with fop.
> 
> Think of it like a letter with a logo, only that the logo is dynamically 
> created.
> 
> The best way to insert it seems to be fo:external-graphic, but that requires 
> a url, from where the resource is acquired.
> 
> I don't want to save my image to disk or put it on a webserver, so my idea is 
> to somehow make a custom URIResolver, which would supply my generated 
> image(s).
> 
> My question is how do I wire this up into my existing fop workflow, which 
> looks like this:
> 
> FOUserAgent userAgent = fopFactory.newFOUserAgent(); Fop fop = 
> fopFactory.newFop(mimeType, userAgent, outStream); Result res = new 
> SAXResult(fop.getDefaultHandler());
> xslTransformer.transform(xmlSource, res); return outStream.toByteArray()
> 
> There appears to be no way to set a custom resolver. Or perhaps someone has a 
> better idea than to do it via custom URI schemes?
> 
> Many thanks for any pointers,
> 
> Ulrich
> 
> 
> 
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 



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



RE: Ideas needed: insert byte[] into XSLFO

2018-03-06 Thread Simon Steiner
Hi,

You can use a data uri or use a custom resource resolver.

FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI(), 
resolver);
fopFactory = builder.build();

Thanks

-Original Message-
From: Ulrich Mayring [mailto:u...@denic.de] 
Sent: 06 March 2018 16:09
To: fop-users@xmlgraphics.apache.org
Subject: Ideas needed: insert byte[] into XSLFO



Hi all,

I have a byte[] (basically, a PNG or JPG image) that I generated myself and 
would like to insert it in an XSLFO page at a certain position and render the 
page to PDF with fop.

Think of it like a letter with a logo, only that the logo is dynamically 
created.

The best way to insert it seems to be fo:external-graphic, but that requires a 
url, from where the resource is acquired.

I don't want to save my image to disk or put it on a webserver, so my idea is 
to somehow make a custom URIResolver, which would supply my generated image(s).

My question is how do I wire this up into my existing fop workflow, which looks 
like this:

FOUserAgent userAgent = fopFactory.newFOUserAgent(); Fop fop = 
fopFactory.newFop(mimeType, userAgent, outStream); Result res = new 
SAXResult(fop.getDefaultHandler());
xslTransformer.transform(xmlSource, res); return outStream.toByteArray()

There appears to be no way to set a custom resolver. Or perhaps someone has a 
better idea than to do it via custom URI schemes?

Many thanks for any pointers,

Ulrich



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



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



Ideas needed: insert byte[] into XSLFO

2018-03-06 Thread Ulrich Mayring


Hi all,

I have a byte[] (basically, a PNG or JPG image) that I generated myself
and would like to insert it in an XSLFO page at a certain position and
render the page to PDF with fop.

Think of it like a letter with a logo, only that the logo is dynamically
created.

The best way to insert it seems to be fo:external-graphic, but that
requires a url, from where the resource is acquired.

I don't want to save my image to disk or put it on a webserver, so my
idea is to somehow make a custom URIResolver, which would supply my
generated image(s).

My question is how do I wire this up into my existing fop workflow,
which looks like this:

FOUserAgent userAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(mimeType, userAgent, outStream);
Result res = new SAXResult(fop.getDefaultHandler());
xslTransformer.transform(xmlSource, res);
return outStream.toByteArray()

There appears to be no way to set a custom resolver. Or perhaps someone
has a better idea than to do it via custom URI schemes?

Many thanks for any pointers,

Ulrich



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