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 Edward McMasters <ed...@yahoo.com> on 2006/02/07 14:46:40 UTC

generating data url external-graphic in PDF

I have an application that needs to generate images in a PDF using a base64 string using the <fo:external-graphic src="url('data:image/gif;base64,R0lG . . .  format in my XSL stylesheet.  I have tried to use the technique referenced in this forum at (http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2) of setting the java.protocol.handler.pkgs property to "org.apache.fop.util.protocols" and adding in the classes Handler and RFC2397URLConnection to the package org.apache.fop.util.protocols.data but when I generate my PDF the image does not get created and (based on System.out.println) the classes in org.apache.fop.util.protocols.data do not get used.
   
  I think that I must be missing something in my implementation.  Note that as a test I overwrote other classes in org.apache.fop (eg. org.apache.fop.apps.Driver) and these classes did get referenced.  I was also able to use my XSL in another application that I tried to copy (that another developer wrote using the same technique above) to generate the image and my application has not trouble generating images using src=file.
   
  I am using FOP version 0.20.5, as is the application I tried to clone.  Guessing that perhaps fop or another library (batik, etc) was out of sync, I copied all of the libraries that the other, working, application was using and still no success.
   
  Thanks.
   
  Edward

		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!

Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
Thank you very much for the info Jeremias.  If anyone
needs me I will be locked in my study.

Edward

--- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

> The protocol handler is a plug-in for a very
> low-level service in the
> Java class library. It plug directly into the
> java.net.URL subsystem.
> That's why these classes must be available on a very
> low level.
> 
> If you want to know more about protocol handlers,
> read:
>
http://java.sun.com/developer/onlineTraining/protocolhandlers/
> 
> Yes, I'm sure your modified classes get called, but
> they get called in
> the context of a special class loader that's set up
> specifially for your
> web application. The java.net.* stuff however, is a
> basic class library
> service so these classes won't see the protocol
> handler if it's not
> added to the system class loader.
> 
> Here are a couple of links that may help:
>
http://www.developer.com/java/other/article.php/10936_2248831_1
>
http://www.theserverside.com/articles/article.tss?l=ClassLoading
> 
> On 08.02.2006 23:16:05 Edward McMasters wrote:
> > I am still trying to figure out how to do what you
> > suggested, but meanwhile, sorry to belabor this
> point,
> > but, what is special about this protocol handler? 
> I
> > was able to replace other classes
> > (org.apache.fop.render.pdf.PDFRenderer,
> > org.apache.fop.fo.flow.ExternalGraphic) that are
> > called from inside the FOP JAR to my modified
> class in
> > WEB-INF/classes and my local versions get called
> by
> > FOP (as evidenced by System.out displays).
> > 
> > Thanks.
> > 
> > Edward (confused but slowly trying to learn!)
> > 
> > --- Jeremias Maerki <de...@jeremias-maerki.ch>
> wrote:
> > 
> > > In addition to what Chris already told you:
> Maybe I
> > > was not clear enough.
> > > You don't place that JAR file with the protocol
> > > handler with your other
> > > JARs (i.e. not in WEB-INF/lib), you need to
> place it
> > > in WebSphere so
> > > they end up in the top-level class loader. That
> > > directory could be a
> > > "lib" directory directly under the root where
> you
> > > installed WebSphere.
> > > As I said, you will need to consult the
> WebSphere
> > > documentation to find
> > > the right spot. What I forgot to mention is that
> in
> > > addition to the JAR
> > > file with the protocol handler you will need to
> > > place the batik.jar in
> > > the same place, too, because the protocol
> handler
> > > references classes
> > > from batik.jar.
> > > 
> > > On 08.02.2006 17:58:53 Edward McMasters wrote:
> > > > I generated a JAR with just those classes and
> put
> > > it
> > > > in the same place as my other JAR files,
> giving
> > > this
> > > > new one precedence and got the same result.  I
> am
> > > in
> > > > the middle of attempting to try rebuilding FOP
> > > 0.20.5
> > > > with these new classes embedded but I am
> currently
> > > > having a problem because it seems that I
> cannot
> > > get
> > > > one of the packages from the source download
> > > > (org.apache.fop.fo.properties).
> > > > 
> > > > Should I be concerned that the package
> > > > org.apache.fop.util.protocols.data does not
> appear
> > > in
> > > > the original FOP 0.20.5 JAR?  I am just
> wondering
> > > > where these classes will be called from,
> although
> > > the
> > > > program that I copied has the same libraries
> as my
> > > > program and it has no trouble referencing
> these
> > > > classes.
> > > <snip/>
> > > 
> > > 
> > > Jeremias Maerki
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > fop-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail:
> > > fop-users-help@xmlgraphics.apache.org
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
Jeremias,

It only took several tries and one week to get your
advice through my thick skull!

This is how I finally got it to work:

I added my JAR with the new classes and batik.jar to
the global classpath via:

Servers -> myserver -> configuration tab -> Process
Definition -> Java Virtual Machine -> Classpath

In Classpath I just listed the two jars separated only
by newlines.

Maybe having this in the record will help the next WS
user with this issue.

Thanks again.  You may have saved my job!

Edward

--- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

> The protocol handler is a plug-in for a very
> low-level service in the
> Java class library. It plug directly into the
> java.net.URL subsystem.
> That's why these classes must be available on a very
> low level.
> 
> If you want to know more about protocol handlers,
> read:
>
http://java.sun.com/developer/onlineTraining/protocolhandlers/
> 
> Yes, I'm sure your modified classes get called, but
> they get called in
> the context of a special class loader that's set up
> specifially for your
> web application. The java.net.* stuff however, is a
> basic class library
> service so these classes won't see the protocol
> handler if it's not
> added to the system class loader.
> 
> Here are a couple of links that may help:
>
http://www.developer.com/java/other/article.php/10936_2248831_1
>
http://www.theserverside.com/articles/article.tss?l=ClassLoading
> 
> On 08.02.2006 23:16:05 Edward McMasters wrote:
> > I am still trying to figure out how to do what you
> > suggested, but meanwhile, sorry to belabor this
> point,
> > but, what is special about this protocol handler? 
> I
> > was able to replace other classes
> > (org.apache.fop.render.pdf.PDFRenderer,
> > org.apache.fop.fo.flow.ExternalGraphic) that are
> > called from inside the FOP JAR to my modified
> class in
> > WEB-INF/classes and my local versions get called
> by
> > FOP (as evidenced by System.out displays).
> > 
> > Thanks.
> > 
> > Edward (confused but slowly trying to learn!)
> > 
> > --- Jeremias Maerki <de...@jeremias-maerki.ch>
> wrote:
> > 
> > > In addition to what Chris already told you:
> Maybe I
> > > was not clear enough.
> > > You don't place that JAR file with the protocol
> > > handler with your other
> > > JARs (i.e. not in WEB-INF/lib), you need to
> place it
> > > in WebSphere so
> > > they end up in the top-level class loader. That
> > > directory could be a
> > > "lib" directory directly under the root where
> you
> > > installed WebSphere.
> > > As I said, you will need to consult the
> WebSphere
> > > documentation to find
> > > the right spot. What I forgot to mention is that
> in
> > > addition to the JAR
> > > file with the protocol handler you will need to
> > > place the batik.jar in
> > > the same place, too, because the protocol
> handler
> > > references classes
> > > from batik.jar.
> > > 
> > > On 08.02.2006 17:58:53 Edward McMasters wrote:
> > > > I generated a JAR with just those classes and
> put
> > > it
> > > > in the same place as my other JAR files,
> giving
> > > this
> > > > new one precedence and got the same result.  I
> am
> > > in
> > > > the middle of attempting to try rebuilding FOP
> > > 0.20.5
> > > > with these new classes embedded but I am
> currently
> > > > having a problem because it seems that I
> cannot
> > > get
> > > > one of the packages from the source download
> > > > (org.apache.fop.fo.properties).
> > > > 
> > > > Should I be concerned that the package
> > > > org.apache.fop.util.protocols.data does not
> appear
> > > in
> > > > the original FOP 0.20.5 JAR?  I am just
> wondering
> > > > where these classes will be called from,
> although
> > > the
> > > > program that I copied has the same libraries
> as my
> > > > program and it has no trouble referencing
> these
> > > > classes.
> > > <snip/>
> > > 
> > > 
> > > Jeremias Maerki
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > fop-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail:
> > > fop-users-help@xmlgraphics.apache.org
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: generating data url external-graphic in PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The protocol handler is a plug-in for a very low-level service in the
Java class library. It plug directly into the java.net.URL subsystem.
That's why these classes must be available on a very low level.

If you want to know more about protocol handlers, read:
http://java.sun.com/developer/onlineTraining/protocolhandlers/

Yes, I'm sure your modified classes get called, but they get called in
the context of a special class loader that's set up specifially for your
web application. The java.net.* stuff however, is a basic class library
service so these classes won't see the protocol handler if it's not
added to the system class loader.

Here are a couple of links that may help:
http://www.developer.com/java/other/article.php/10936_2248831_1
http://www.theserverside.com/articles/article.tss?l=ClassLoading

On 08.02.2006 23:16:05 Edward McMasters wrote:
> I am still trying to figure out how to do what you
> suggested, but meanwhile, sorry to belabor this point,
> but, what is special about this protocol handler?  I
> was able to replace other classes
> (org.apache.fop.render.pdf.PDFRenderer,
> org.apache.fop.fo.flow.ExternalGraphic) that are
> called from inside the FOP JAR to my modified class in
> WEB-INF/classes and my local versions get called by
> FOP (as evidenced by System.out displays).
> 
> Thanks.
> 
> Edward (confused but slowly trying to learn!)
> 
> --- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:
> 
> > In addition to what Chris already told you: Maybe I
> > was not clear enough.
> > You don't place that JAR file with the protocol
> > handler with your other
> > JARs (i.e. not in WEB-INF/lib), you need to place it
> > in WebSphere so
> > they end up in the top-level class loader. That
> > directory could be a
> > "lib" directory directly under the root where you
> > installed WebSphere.
> > As I said, you will need to consult the WebSphere
> > documentation to find
> > the right spot. What I forgot to mention is that in
> > addition to the JAR
> > file with the protocol handler you will need to
> > place the batik.jar in
> > the same place, too, because the protocol handler
> > references classes
> > from batik.jar.
> > 
> > On 08.02.2006 17:58:53 Edward McMasters wrote:
> > > I generated a JAR with just those classes and put
> > it
> > > in the same place as my other JAR files, giving
> > this
> > > new one precedence and got the same result.  I am
> > in
> > > the middle of attempting to try rebuilding FOP
> > 0.20.5
> > > with these new classes embedded but I am currently
> > > having a problem because it seems that I cannot
> > get
> > > one of the packages from the source download
> > > (org.apache.fop.fo.properties).
> > > 
> > > Should I be concerned that the package
> > > org.apache.fop.util.protocols.data does not appear
> > in
> > > the original FOP 0.20.5 JAR?  I am just wondering
> > > where these classes will be called from, although
> > the
> > > program that I copied has the same libraries as my
> > > program and it has no trouble referencing these
> > > classes.
> > <snip/>
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> > fop-users-help@xmlgraphics.apache.org
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



Jeremias Maerki


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


Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
I am still trying to figure out how to do what you
suggested, but meanwhile, sorry to belabor this point,
but, what is special about this protocol handler?  I
was able to replace other classes
(org.apache.fop.render.pdf.PDFRenderer,
org.apache.fop.fo.flow.ExternalGraphic) that are
called from inside the FOP JAR to my modified class in
WEB-INF/classes and my local versions get called by
FOP (as evidenced by System.out displays).

Thanks.

Edward (confused but slowly trying to learn!)

--- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

> In addition to what Chris already told you: Maybe I
> was not clear enough.
> You don't place that JAR file with the protocol
> handler with your other
> JARs (i.e. not in WEB-INF/lib), you need to place it
> in WebSphere so
> they end up in the top-level class loader. That
> directory could be a
> "lib" directory directly under the root where you
> installed WebSphere.
> As I said, you will need to consult the WebSphere
> documentation to find
> the right spot. What I forgot to mention is that in
> addition to the JAR
> file with the protocol handler you will need to
> place the batik.jar in
> the same place, too, because the protocol handler
> references classes
> from batik.jar.
> 
> On 08.02.2006 17:58:53 Edward McMasters wrote:
> > I generated a JAR with just those classes and put
> it
> > in the same place as my other JAR files, giving
> this
> > new one precedence and got the same result.  I am
> in
> > the middle of attempting to try rebuilding FOP
> 0.20.5
> > with these new classes embedded but I am currently
> > having a problem because it seems that I cannot
> get
> > one of the packages from the source download
> > (org.apache.fop.fo.properties).
> > 
> > Should I be concerned that the package
> > org.apache.fop.util.protocols.data does not appear
> in
> > the original FOP 0.20.5 JAR?  I am just wondering
> > where these classes will be called from, although
> the
> > program that I copied has the same libraries as my
> > program and it has no trouble referencing these
> > classes.
> <snip/>
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: generating data url external-graphic in PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
In addition to what Chris already told you: Maybe I was not clear enough.
You don't place that JAR file with the protocol handler with your other
JARs (i.e. not in WEB-INF/lib), you need to place it in WebSphere so
they end up in the top-level class loader. That directory could be a
"lib" directory directly under the root where you installed WebSphere.
As I said, you will need to consult the WebSphere documentation to find
the right spot. What I forgot to mention is that in addition to the JAR
file with the protocol handler you will need to place the batik.jar in
the same place, too, because the protocol handler references classes
from batik.jar.

On 08.02.2006 17:58:53 Edward McMasters wrote:
> I generated a JAR with just those classes and put it
> in the same place as my other JAR files, giving this
> new one precedence and got the same result.  I am in
> the middle of attempting to try rebuilding FOP 0.20.5
> with these new classes embedded but I am currently
> having a problem because it seems that I cannot get
> one of the packages from the source download
> (org.apache.fop.fo.properties).
> 
> Should I be concerned that the package
> org.apache.fop.util.protocols.data does not appear in
> the original FOP 0.20.5 JAR?  I am just wondering
> where these classes will be called from, although the
> program that I copied has the same libraries as my
> program and it has no trouble referencing these
> classes.
<snip/>


Jeremias Maerki


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


Re: generating data url external-graphic in PDF

Posted by Chris Bowditch <bo...@hotmail.com>.
Edward McMasters wrote:
> I generated a JAR with just those classes and put it
> in the same place as my other JAR files, giving this
> new one precedence and got the same result.  I am in
> the middle of attempting to try rebuilding FOP 0.20.5
> with these new classes embedded but I am currently
> having a problem because it seems that I cannot get
> one of the packages from the source download
> (org.apache.fop.fo.properties).

The source for the package org.apache.fop.fo.properties is not in the 
repository because it is created by the ant script.

<snip/>

Chris



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


Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
I generated a JAR with just those classes and put it
in the same place as my other JAR files, giving this
new one precedence and got the same result.  I am in
the middle of attempting to try rebuilding FOP 0.20.5
with these new classes embedded but I am currently
having a problem because it seems that I cannot get
one of the packages from the source download
(org.apache.fop.fo.properties).

Should I be concerned that the package
org.apache.fop.util.protocols.data does not appear in
the original FOP 0.20.5 JAR?  I am just wondering
where these classes will be called from, although the
program that I copied has the same libraries as my
program and it has no trouble referencing these
classes.

Thanks.

Edward

--- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

> Ok, there we have the problem. One more example that
> it's a good idea to
> write down as much as possible about the environment
> in which the
> problem occurs. If you put the classes into
> WEB-INF/classes they are not
> available to the JDK because they are loaded by a
> special class loader.
> You will have to pack the two classes into a
> separate JAR and deploy
> that in a part of WebSphere where they are available
> to the whole system.
> I can't tell you where that is because I don't know
> WebSphere. You will
> have to consult the documentation.
> 
> On 07.02.2006 21:20:48 Edward McMasters wrote:
> > Yes, I am able to verify that the property is set
> > before and after the PDF generation
> > (System.getProperty("java.protocol.handler.pkgs")
> =
> > "org.apache.fop.util.protocols").
> > 
> > What do you mean by registering the protocol
> handler? 
> > I added the package
> org.apache.fop.util.protocols.data
> > with the two classes in my Java Source (I am using
> > WebSphere) and the classes get generated in my
> > WEB-INF/classes.  I overwrote another FOP class
> the
> > same way (as a test) and my version definitely
> gets
> > executed.  Interesting thought though, looking at
> the
> > FOP source and the classes from the JAR file, I
> cannot
> > see the org.apache.fop.util package or classes.
> <snip/>
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: generating data url external-graphic in PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Ok, there we have the problem. One more example that it's a good idea to
write down as much as possible about the environment in which the
problem occurs. If you put the classes into WEB-INF/classes they are not
available to the JDK because they are loaded by a special class loader.
You will have to pack the two classes into a separate JAR and deploy
that in a part of WebSphere where they are available to the whole system.
I can't tell you where that is because I don't know WebSphere. You will
have to consult the documentation.

On 07.02.2006 21:20:48 Edward McMasters wrote:
> Yes, I am able to verify that the property is set
> before and after the PDF generation
> (System.getProperty("java.protocol.handler.pkgs") =
> "org.apache.fop.util.protocols").
> 
> What do you mean by registering the protocol handler? 
> I added the package org.apache.fop.util.protocols.data
> with the two classes in my Java Source (I am using
> WebSphere) and the classes get generated in my
> WEB-INF/classes.  I overwrote another FOP class the
> same way (as a test) and my version definitely gets
> executed.  Interesting thought though, looking at the
> FOP source and the classes from the JAR file, I cannot
> see the org.apache.fop.util package or classes.
<snip/>

Jeremias Maerki


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


Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
Yes, I am able to verify that the property is set
before and after the PDF generation
(System.getProperty("java.protocol.handler.pkgs") =
"org.apache.fop.util.protocols").

What do you mean by registering the protocol handler? 
I added the package org.apache.fop.util.protocols.data
with the two classes in my Java Source (I am using
WebSphere) and the classes get generated in my
WEB-INF/classes.  I overwrote another FOP class the
same way (as a test) and my version definitely gets
executed.  Interesting thought though, looking at the
FOP source and the classes from the JAR file, I cannot
see the org.apache.fop.util package or classes.

Edward

--- Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

> The error message is misleading in this case. I
> assume that FOP thinks
> you've specified a filename since it hasn't found
> support for the "data"
> protocol. So, it really looks like the protocol
> handler isn't properly
> registered. Have you looked at the system property
> yet from inside your
> application?
> 
> "no base URL is specified" means that you didn't
> specify a URL that is
> used when you specify relative URLs/filenames. If
> you specify the base
> URL as "file:///C:/Temp/" then a URL
> "test/image.gif" will ultimately
> point to "file:///C:/Temp/test/image.gif".
> 
> 
> On 07.02.2006 18:12:04 Edward McMasters wrote:
> > Thank you for the quick response.  I (did a quick
> study of logging and) outputted my log and this is
> what I saw:
> >    
> >   [ERROR] Error while creating area : Error with
> image URL:
>
data:image\gif;base64,R0lGODdhMAAwAPAAAAAAAP\ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh\DeuNcP5yLWGsEbtLiOSpa\TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy\Xl4\f1cf5VWzXyym7PHhhx4dbgYKAAA7
> (The filename or extension is too long) and no base
> URL is specified
> >    
> >   Is there a property that I can set to define how
> long a filename can be?  This one does not seem very
> long.  Is a more appropriate question, "What is
> meant by 'no base URL is specified'?"
> >    
> >   Thanks.
> >    
> >   Edward
> >    
> >   > Jeremias Maerki <de...@jeremias-maerki.ch>
> wrote:
> > > Interesting would be to know what the FOP log
> output looks like. Without
> > > being able to see into your environment I'd say
> you did everything right
> > > but I can't be sure. I just verified the
> solution on my machine:
> > > Extracted the two classes from the ZIP into the
> FOP sources, recompiled
> > > FOP and added
>
"-Djava.protocol.handler.pkgs=org.apache.fop.util.protocols"
> > > to the command-line. It worked. Try reading the
> java.protocol.handler.pkgs
> > > property at run-time and check that the right
> value is set. Maybe
> > > someone else overwrites the system property.
> Good luck.
> > > 
> > > On 07.02.2006 14:46:40 Edward McMasters wrote:
> > > > I have an application that needs to generate
> images in a PDF using a
> > > > base64 string using the >
> src="url('data:image/gif;base64,R0lG . . . format in
> my XSL stylesheet. 
> > > > I have tried to use the technique referenced
> in this forum at
> > > >
>
(http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2)
> of
> > > > setting the java.protocol.handler.pkgs
> property to
> > > > "org.apache.fop.util.protocols" and adding in
> the classes Handler and
> > > > RFC2397URLConnection to the package
> org.apache.fop.util.protocols.data
> > > > but when I generate my PDF the image does not
> get created and (based on
> > > > System.out.println) the classes in
> org.apache.fop.util.protocols.data do
> > > > not get used.
> > > > 
> > > > I think that I must be missing something in my
> implementation. Note
> > > > that as a test I overwrote other classes in
> org.apache.fop (eg.
> > > > org.apache.fop.apps.Driver) and these classes
> did get referenced. I was
> > > > also able to use my XSL in another application
> that I tried to copy
> > > > (that another developer wrote using the same
> technique above) to
> > > > generate the image and my application has not
> trouble generating images
> > > > using src=file.
> > > > 
> > > > I am using FOP version 0.20.5, as is the
> application I tried to clone. 
> > > > Guessing that perhaps fop or another library
> (batik, etc) was out of
> > > > sync, I copied all of the libraries that the
> other, working, application
> > > > was using and still no success.
> 
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: generating data url external-graphic in PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The error message is misleading in this case. I assume that FOP thinks
you've specified a filename since it hasn't found support for the "data"
protocol. So, it really looks like the protocol handler isn't properly
registered. Have you looked at the system property yet from inside your
application?

"no base URL is specified" means that you didn't specify a URL that is
used when you specify relative URLs/filenames. If you specify the base
URL as "file:///C:/Temp/" then a URL "test/image.gif" will ultimately
point to "file:///C:/Temp/test/image.gif".


On 07.02.2006 18:12:04 Edward McMasters wrote:
> Thank you for the quick response.  I (did a quick study of logging and) outputted my log and this is what I saw:
>    
>   [ERROR] Error while creating area : Error with image URL: data:image\gif;base64,R0lGODdhMAAwAPAAAAAAAP\ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh\DeuNcP5yLWGsEbtLiOSpa\TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy\Xl4\f1cf5VWzXyym7PHhhx4dbgYKAAA7 (The filename or extension is too long) and no base URL is specified
>    
>   Is there a property that I can set to define how long a filename can be?  This one does not seem very long.  Is a more appropriate question, "What is meant by 'no base URL is specified'?"
>    
>   Thanks.
>    
>   Edward
>    
>   > Jeremias Maerki <de...@jeremias-maerki.ch> wrote:
> > Interesting would be to know what the FOP log output looks like. Without
> > being able to see into your environment I'd say you did everything right
> > but I can't be sure. I just verified the solution on my machine:
> > Extracted the two classes from the ZIP into the FOP sources, recompiled
> > FOP and added "-Djava.protocol.handler.pkgs=org.apache.fop.util.protocols"
> > to the command-line. It worked. Try reading the java.protocol.handler.pkgs
> > property at run-time and check that the right value is set. Maybe
> > someone else overwrites the system property. Good luck.
> > 
> > On 07.02.2006 14:46:40 Edward McMasters wrote:
> > > I have an application that needs to generate images in a PDF using a
> > > base64 string using the > src="url('data:image/gif;base64,R0lG . . . format in my XSL stylesheet. 
> > > I have tried to use the technique referenced in this forum at
> > > (http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2) of
> > > setting the java.protocol.handler.pkgs property to
> > > "org.apache.fop.util.protocols" and adding in the classes Handler and
> > > RFC2397URLConnection to the package org.apache.fop.util.protocols.data
> > > but when I generate my PDF the image does not get created and (based on
> > > System.out.println) the classes in org.apache.fop.util.protocols.data do
> > > not get used.
> > > 
> > > I think that I must be missing something in my implementation. Note
> > > that as a test I overwrote other classes in org.apache.fop (eg.
> > > org.apache.fop.apps.Driver) and these classes did get referenced. I was
> > > also able to use my XSL in another application that I tried to copy
> > > (that another developer wrote using the same technique above) to
> > > generate the image and my application has not trouble generating images
> > > using src=file.
> > > 
> > > I am using FOP version 0.20.5, as is the application I tried to clone. 
> > > Guessing that perhaps fop or another library (batik, etc) was out of
> > > sync, I copied all of the libraries that the other, working, application
> > > was using and still no success.



Jeremias Maerki


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


Re: generating data url external-graphic in PDF

Posted by Edward McMasters <ed...@yahoo.com>.
Thank you for the quick response.  I (did a quick study of logging and) outputted my log and this is what I saw:
   
  [ERROR] Error while creating area : Error with image URL: data:image\gif;base64,R0lGODdhMAAwAPAAAAAAAP\ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh\DeuNcP5yLWGsEbtLiOSpa\TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy\Xl4\f1cf5VWzXyym7PHhhx4dbgYKAAA7 (The filename or extension is too long) and no base URL is specified
   
  Is there a property that I can set to define how long a filename can be?  This one does not seem very long.  Is a more appropriate question, "What is meant by 'no base URL is specified'?"
   
  Thanks.
   
  Edward
   
  > Jeremias Maerki <de...@jeremias-maerki.ch> wrote:
> Interesting would be to know what the FOP log output looks like. Without
> being able to see into your environment I'd say you did everything right
> but I can't be sure. I just verified the solution on my machine:
> Extracted the two classes from the ZIP into the FOP sources, recompiled
> FOP and added "-Djava.protocol.handler.pkgs=org.apache.fop.util.protocols"
> to the command-line. It worked. Try reading the java.protocol.handler.pkgs
> property at run-time and check that the right value is set. Maybe
> someone else overwrites the system property. Good luck.
> 
> On 07.02.2006 14:46:40 Edward McMasters wrote:
> > I have an application that needs to generate images in a PDF using a
> > base64 string using the > src="url('data:image/gif;base64,R0lG . . . format in my XSL stylesheet. 
> > I have tried to use the technique referenced in this forum at
> > (http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2) of
> > setting the java.protocol.handler.pkgs property to
> > "org.apache.fop.util.protocols" and adding in the classes Handler and
> > RFC2397URLConnection to the package org.apache.fop.util.protocols.data
> > but when I generate my PDF the image does not get created and (based on
> > System.out.println) the classes in org.apache.fop.util.protocols.data do
> > not get used.
> > 
> > I think that I must be missing something in my implementation. Note
> > that as a test I overwrote other classes in org.apache.fop (eg.
> > org.apache.fop.apps.Driver) and these classes did get referenced. I was
> > also able to use my XSL in another application that I tried to copy
> > (that another developer wrote using the same technique above) to
> > generate the image and my application has not trouble generating images
> > using src=file.
> > 
> > I am using FOP version 0.20.5, as is the application I tried to clone. 
> > Guessing that perhaps fop or another library (batik, etc) was out of
> > sync, I copied all of the libraries that the other, working, application
> > was using and still no success.
>
>
>
> Jeremias Maerki


			
---------------------------------
 Yahoo! Mail - Helps protect you from nasty viruses.

Re: generating data url external-graphic in PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Interesting would be to know what the FOP log output looks like. Without
being able to see into your environment I'd say you did everything right
but I can't be sure. I just verified the solution on my machine:
Extracted the two classes from the ZIP into the FOP sources, recompiled
FOP and added "-Djava.protocol.handler.pkgs=org.apache.fop.util.protocols"
to the command-line. It worked. Try reading the java.protocol.handler.pkgs
property at run-time and check that the right value is set. Maybe
someone else overwrites the system property. Good luck.

On 07.02.2006 14:46:40 Edward McMasters wrote:
> I have an application that needs to generate images in a PDF using a
> base64 string using the <fo:external-graphic
> src="url('data:image/gif;base64,R0lG . . .  format in my XSL stylesheet. 
> I have tried to use the technique referenced in this forum at
> (http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2) of
> setting the java.protocol.handler.pkgs property to
> "org.apache.fop.util.protocols" and adding in the classes Handler and
> RFC2397URLConnection to the package org.apache.fop.util.protocols.data
> but when I generate my PDF the image does not get created and (based on
> System.out.println) the classes in org.apache.fop.util.protocols.data do
> not get used.
>    
> I think that I must be missing something in my implementation.  Note
> that as a test I overwrote other classes in org.apache.fop (eg.
> org.apache.fop.apps.Driver) and these classes did get referenced.  I was
> also able to use my XSL in another application that I tried to copy
> (that another developer wrote using the same technique above) to
> generate the image and my application has not trouble generating images
> using src=file.
>    
> I am using FOP version 0.20.5, as is the application I tried to clone. 
> Guessing that perhaps fop or another library (batik, etc) was out of
> sync, I copied all of the libraries that the other, working, application
> was using and still no success.



Jeremias Maerki


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