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 mi...@steria.com on 2012/07/10 16:52:05 UTC

Image URL issue rendering XML into PDF

Hi everyone,
I'm asking for a little help using FOP to render my XML file, which contains images (checked and unchecked boxes), into a PDF.
My script is done, and works perfectly when I indicate in my xml file :
<checkbox>http://10.6.66.134:7008/images/checkbox.gif</checkbox>, this being an extern server that I cannot use in Production

But when i want to test it in local on my computer, and replace the previous line with
<checkbox>box_check.gif</checkbox>, my images being in the same folder than my script, and my XML and XSL files.

I got the error message :
Error in XObject : Error while loading image file:/home/emmji/tmp/xml/jni/box_check.gif : class java.lang.NullPointerException - null

I know the image is found because I tried to rename it and got this error :
[ERROR] Error while creating area : Error while recovering Image Informations (file:/home/emmji/tmp/xml/jni/box_check2.gif) : /home/emmji/tmp/xml/jni/box_check2.gif (No such file or directory)

Here is the declaration of the variable and the code where I integrate my image :
<xsl:variable name="checkedbox">
	<xsl:value-of select="/root/param/checkbox"/>
</xsl:variable>

<fo:block text-align="center">
	<fo:external-graphic src="url('{$checkedbox}')" width="8px" height="8px" display-align="center"/>
</fo:block>

I think this is a matter of URL, but I don't understand why.

Thanks for your help.

Regards

PS : I also tried : 
<checkbox>./box_check.gif</checkbox>
<checkbox>/home/emmji/tmp/xml/jni/box_check.gif</checkbox>
but I still end up with the same XObject errorCe message est à l'attention exclusive des destinataires désignés. Il peut contenir des informations confidentielles. Si vous n'êtes pas destinataire du message, merci d'en avertir immédiatement l'expéditeur et de détruire ce message. Le contenu de ce message ne pourrait engager la responsabilité de Steria que s'il a été émis par une personne dûment habilitée agissant dans le strict cadre de ses fonctions et à des fins non étrangères à ses attributions. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.  
This message is intended exclusively for the designated addressee. It may contain confidential material. If you are not the correct addressee, please notify the sender immediately and destroy the message. The content of this message will engage the responsibility of Steria only if it has been sent by an authorized person acting in the strict scope of his functions and for purposes that are related to his competence. Although reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus.  
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Image URL issue rendering XML into PDF

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

what fop version do you use?
I found such message in fop-users-list archive, but it was for the
*very old* FOP 0.20.x
how do you run fop: via command line, tomcat, something else?
what java version do you use?
what FO is fed to FOP?
 it is a good practice to provide short XSL-FO (result of XML+XSLT
transformation).

After googling, I found some probable causes:
 - app container do not provide image type [1]
 - JRE doesn't interpret correctly file path [2]
 - malformed URL in FO (as suggested by Marc)

[1] http://www.mail-archive.com/fop-user@xml.apache.org/msg04369.html
[2] http://www.stylusstudio.com/xsllist/200405/post00800.html

2012/7/10  <mi...@steria.com>:
> Hi everyone,
> I'm asking for a little help using FOP to render my XML file, which contains images (checked and unchecked boxes), into a PDF.
> My script is done, and works perfectly when I indicate in my xml file :
> <checkbox>http://10.6.66.134:7008/images/checkbox.gif</checkbox>, this being an extern server that I cannot use in Production
>
> But when i want to test it in local on my computer, and replace the previous line with
> <checkbox>box_check.gif</checkbox>, my images being in the same folder than my script, and my XML and XSL files.
>
> I got the error message :
> Error in XObject : Error while loading image file:/home/emmji/tmp/xml/jni/box_check.gif : class java.lang.NullPointerException - null
>
> I know the image is found because I tried to rename it and got this error :
> [ERROR] Error while creating area : Error while recovering Image Informations (file:/home/emmji/tmp/xml/jni/box_check2.gif) : /home/emmji/tmp/xml/jni/box_check2.gif (No such file or directory)
>
> Here is the declaration of the variable and the code where I integrate my image :
> <xsl:variable name="checkedbox">
>         <xsl:value-of select="/root/param/checkbox"/>
> </xsl:variable>
>
> <fo:block text-align="center">
>         <fo:external-graphic src="url('{$checkedbox}')" width="8px" height="8px" display-align="center"/>
> </fo:block>
>
> I think this is a matter of URL, but I don't understand why.
>
> Thanks for your help.
>
> Regards
>
> PS : I also tried :
> <checkbox>./box_check.gif</checkbox>
> <checkbox>/home/emmji/tmp/xml/jni/box_check.gif</checkbox>
> but I still end up with the same XObject errorCe message est à l'attention exclusive des destinataires désignés. Il peut contenir des informations confidentielles. Si vous n'êtes pas destinataire du message, merci d'en avertir immédiatement l'expéditeur et de détruire ce message. Le contenu de ce message ne pourrait engager la responsabilité de Steria que s'il a été émis par une personne dûment habilitée agissant dans le strict cadre de ses fonctions et à des fins non étrangères à ses attributions. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.
> This message is intended exclusively for the designated addressee. It may contain confidential material. If you are not the correct addressee, please notify the sender immediately and destroy the message. The content of this message will engage the responsibility of Steria only if it has been sent by an authorized person acting in the strict scope of his functions and for purposes that are related to his competence. Although reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus.

-- 
pascal

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


Re: Image URL issue rendering XML into PDF

Posted by Marc <Ma...@free.fr>.
sorry, it's the reverse I don't see the ' in the url('{$checkbox}')
in FOP url() don't need the ', try with url({$checkedbox})

Do you have the XSL-FO generated?

Marc

Le mardi 10 juillet 2012 17:03:29, Marc a écrit :
> I think that you forget the ' (simple quote) around your path :
> <xsl:value-of select="'/root/param/checkbox'"/>
> else it's an Xpath.
> Marc
>
> Le 10/07/2012 16:52, michael.jerusalmi@steria.com a écrit :
>> Hi everyone,
>> I'm asking for a little help using FOP to render my XML file, which
>> contains images (checked and unchecked boxes), into a PDF.
>> My script is done, and works perfectly when I indicate in my xml file :
>> <checkbox>http://10.6.66.134:7008/images/checkbox.gif</checkbox>,
>> this being an extern server that I cannot use in Production
>>
>> But when i want to test it in local on my computer, and replace the
>> previous line with
>> <checkbox>box_check.gif</checkbox>, my images being in the same
>> folder than my script, and my XML and XSL files.
>>
>> I got the error message :
>> Error in XObject : Error while loading image
>> file:/home/emmji/tmp/xml/jni/box_check.gif : class
>> java.lang.NullPointerException - null
>>
>> I know the image is found because I tried to rename it and got this
>> error :
>> [ERROR] Error while creating area : Error while recovering Image
>> Informations (file:/home/emmji/tmp/xml/jni/box_check2.gif) :
>> /home/emmji/tmp/xml/jni/box_check2.gif (No such file or directory)
>>
>> Here is the declaration of the variable and the code where I
>> integrate my image :
>> <xsl:variable name="checkedbox">
>>     <xsl:value-of select="/root/param/checkbox"/>
>> </xsl:variable>
>>
>> <fo:block text-align="center">
>>     <fo:external-graphic src="url('{$checkedbox}')" width="8px"
>> height="8px" display-align="center"/>
>> </fo:block>
>>
>> I think this is a matter of URL, but I don't understand why.
>>
>> Thanks for your help.
>>
>> Regards
>>
>> PS : I also tried :
>> <checkbox>./box_check.gif</checkbox>
>> <checkbox>/home/emmji/tmp/xml/jni/box_check.gif</checkbox>
>> but I still end up with the same XObject errorCe message est à
>> l'attention exclusive des destinataires désignés. Il peut contenir
>> des informations confidentielles. Si vous n'êtes pas destinataire du
>> message, merci d'en avertir immédiatement l'expéditeur et de détruire
>> ce message. Le contenu de ce message ne pourrait engager la
>> responsabilité de Steria que s'il a été émis par une personne dûment
>> habilitée agissant dans le strict cadre de ses fonctions et à des
>> fins non étrangères à ses attributions. Bien que les meilleurs
>> efforts soient faits pour maintenir cette transmission exempte de
>> tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa
>> responsabilité ne saurait être engagée pour tout dommage résultant
>> d'un virus transmis.
>> This message is intended exclusively for the designated addressee. It
>> may contain confidential material. If you are not the correct
>> addressee, please notify the sender immediately and destroy the
>> message. The content of this message will engage the responsibility
>> of Steria only if it has been sent by an authorized person acting in
>> the strict scope of his functions and for purposes that are related
>> to his competence. Although reasonable efforts have been made to keep
>> this transmission free from viruses, the sender will not be liable
>> for damages caused by a transmitted virus.
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Image URL issue rendering XML into PDF

Posted by Marc <Ma...@free.fr>.
I think that you forget the ' (simple quote) around your path :
<xsl:value-of select="'/root/param/checkbox'"/>
else it's an Xpath.
Marc

Le 10/07/2012 16:52, michael.jerusalmi@steria.com a écrit :
> Hi everyone,
> I'm asking for a little help using FOP to render my XML file, which contains images (checked and unchecked boxes), into a PDF.
> My script is done, and works perfectly when I indicate in my xml file :
> <checkbox>http://10.6.66.134:7008/images/checkbox.gif</checkbox>, this being an extern server that I cannot use in Production
>
> But when i want to test it in local on my computer, and replace the previous line with
> <checkbox>box_check.gif</checkbox>, my images being in the same folder than my script, and my XML and XSL files.
>
> I got the error message :
> Error in XObject : Error while loading image file:/home/emmji/tmp/xml/jni/box_check.gif : class java.lang.NullPointerException - null
>
> I know the image is found because I tried to rename it and got this error :
> [ERROR] Error while creating area : Error while recovering Image Informations (file:/home/emmji/tmp/xml/jni/box_check2.gif) : /home/emmji/tmp/xml/jni/box_check2.gif (No such file or directory)
>
> Here is the declaration of the variable and the code where I integrate my image :
> <xsl:variable name="checkedbox">
> 	<xsl:value-of select="/root/param/checkbox"/>
> </xsl:variable>
>
> <fo:block text-align="center">
> 	<fo:external-graphic src="url('{$checkedbox}')" width="8px" height="8px" display-align="center"/>
> </fo:block>
>
> I think this is a matter of URL, but I don't understand why.
>
> Thanks for your help.
>
> Regards
>
> PS : I also tried :
> <checkbox>./box_check.gif</checkbox>
> <checkbox>/home/emmji/tmp/xml/jni/box_check.gif</checkbox>
> but I still end up with the same XObject errorCe message est à l'attention exclusive des destinataires désignés. Il peut contenir des informations confidentielles. Si vous n'êtes pas destinataire du message, merci d'en avertir immédiatement l'expéditeur et de détruire ce message. Le contenu de ce message ne pourrait engager la responsabilité de Steria que s'il a été émis par une personne dûment habilitée agissant dans le strict cadre de ses fonctions et à des fins non étrangères à ses attributions. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.
> This message is intended exclusively for the designated addressee. It may contain confidential material. If you are not the correct addressee, please notify the sender immediately and destroy the message. The content of this message will engage the responsibility of Steria only if it has been sent by an authorized person acting in the strict scope of his functions and for purposes that are related to his competence. Although reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus.
> ---------------------------------------------------------------------
> 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: Image URL issue rendering XML into PDF

Posted by polymorphisme <we...@polymorphisme.org>.
Hi,  http://10.6.66.134:7008/ don't work !

--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Image-URL-issue-rendering-XML-into-PDF-tp36299p36309.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Image URL issue rendering XML into PDF

Posted by Luis Bernardo <lm...@gmail.com>.
"Error while loading the image" indicates the error is during loading. 
So, it is not a URL issue but a problem with the image. If you provide 
the image we can confirm that.

On 7/10/12 3:52 PM, michael.jerusalmi@steria.com wrote:
> Hi everyone,
> I'm asking for a little help using FOP to render my XML file, which contains images (checked and unchecked boxes), into a PDF.
> My script is done, and works perfectly when I indicate in my xml file :
> <checkbox>http://10.6.66.134:7008/images/checkbox.gif</checkbox>, this being an extern server that I cannot use in Production
>
> But when i want to test it in local on my computer, and replace the previous line with
> <checkbox>box_check.gif</checkbox>, my images being in the same folder than my script, and my XML and XSL files.
>
> I got the error message :
> Error in XObject : Error while loading image file:/home/emmji/tmp/xml/jni/box_check.gif : class java.lang.NullPointerException - null
>
> I know the image is found because I tried to rename it and got this error :
> [ERROR] Error while creating area : Error while recovering Image Informations (file:/home/emmji/tmp/xml/jni/box_check2.gif) : /home/emmji/tmp/xml/jni/box_check2.gif (No such file or directory)
>
> Here is the declaration of the variable and the code where I integrate my image :
> <xsl:variable name="checkedbox">
> 	<xsl:value-of select="/root/param/checkbox"/>
> </xsl:variable>
>
> <fo:block text-align="center">
> 	<fo:external-graphic src="url('{$checkedbox}')" width="8px" height="8px" display-align="center"/>
> </fo:block>
>
> I think this is a matter of URL, but I don't understand why.
>
> Thanks for your help.
>
> Regards
>
> PS : I also tried :
> <checkbox>./box_check.gif</checkbox>
> <checkbox>/home/emmji/tmp/xml/jni/box_check.gif</checkbox>
> but I still end up with the same XObject errorCe message est à l'attention exclusive des destinataires désignés. Il peut contenir des informations confidentielles. Si vous n'êtes pas destinataire du message, merci d'en avertir immédiatement l'expéditeur et de détruire ce message. Le contenu de ce message ne pourrait engager la responsabilité de Steria que s'il a été émis par une personne dûment habilitée agissant dans le strict cadre de ses fonctions et à des fins non étrangères à ses attributions. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.
> This message is intended exclusively for the designated addressee. It may contain confidential material. If you are not the correct addressee, please notify the sender immediately and destroy the message. The content of this message will engage the responsibility of Steria only if it has been sent by an authorized person acting in the strict scope of his functions and for purposes that are related to his competence. Although reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus.
> ---------------------------------------------------------------------
> 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