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 jmorra <jo...@gmail.com> on 2009/05/29 03:25:19 UTC

Missing images when many images are displayed

I have an XML document which contains information that points to many images,
and I'm trying to display them using the fo:external-graphic method.  When
only a few images are present it works fine.  However, when many images are
present (enough that they span multiple pages) then images appear to be
"lost," which means they are simply not printed in the PDF.  When I use the
following code, the images appear staggered, and there is a lot of white
space, however, all the images are printed correctly.

<fo:table-cell padding="3mm">
    <xsl:apply-templates select="attr[@tag='0040A730']/item" mode="content">
        <xsl:with-param name="pattern">Image</xsl:with-param>
    </xsl:apply-templates>
</fo:table-cell>

<xsl:template match="item" mode="content">
    <xsl:param name="pattern"/>
    <xsl:if test="$pattern='Image'">
        <fo:external-graphic width="8cm">
            <xsl:attribute
name="src">url(https://localhost:8443/wado?requestType=WADO&amp;studyUID=1&amp;seriesUID=1&amp;objectUID=<xsl:value-of
select="attr[@tag='00081199']/item/attr[@tag='00081155']"/>)</xsl:attribute>
        </fo:external-graphic>
    </xsl:if>
</xsl:template>

The first part of the code is wrapped inside of a fo:table.  However, if I
replace the first part with the following

<fo:table-cell padding="3mm">
    <fo:block>
        <xsl:apply-templates select="attr[@tag='0040A730']/item"
mode="content">
            <xsl:with-param name="pattern">Image</xsl:with-param>
        </xsl:apply-templates>
    <'fo:block>
</fo:table-cell>

Then the images look much better on the page (no white space), but some
images are just missing.

I'm pretty new to XSL:FO, but I've been trying to figure this one out for a
while, and would greatly appreciate any input.  I'm using version 0.20.5,
and am locked into that version.
-- 
View this message in context: http://www.nabble.com/Missing-images-when-many-images-are-displayed-tp23772880p23772880.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: Missing images when many images are displayed

Posted by jmorra <jo...@gmail.com>.
OK, well I'm going to answer my own post because I figured it out, and for
everyone else out there who has this issue.

The way I solved it was by changing my keystore using the java keytool
command.  When I first created my keystore, I did it with a CN (computer
name) of localhost.  This is why the images were coming across when the
hostname was localhost.  However, if I recreated my keystore with a CN of
the computer name (jonmorra), then it worked with jonmorra (and not with
localhost).

Thanks again for your help with my other post.


jmorra wrote:
> 
> Thanks for the help with this question, I was able to upgrade to fop 0.95
> (as you suggested).  It too didn't print the images correctly.  However, I
> was able to solve my problem by using a for each loop and creating a two
> column table.
> 
> However, now I'm having another image problem.  I need to formulate the
> URLs for these images via the https protocol, however, the images aren't
> appearing when I use any hostname other than localhost.
> 
> Here's the error message I'm getting
> 
> 14:03:25,140 ERROR FOP:243 - Error with opening URL
> 'https://jonmorra:8443/wado?requestType=WADO&studyUID=1&seriesUID=1&objectUID=1.2.826.0.1.3680043.2.1074.64826.5.71.10003791.5':
> HTTPS hostname wrong:  should be <jonmorra>
> 
> I know that the URL is valid (I can copy and paste it into a browser), but
> I don't know what else I can do, short of downloading the image to a temp
> directory and then having the xslt point to that temp directory (which is
> really really messy, because I'm dealing with a lot of images).
> 
> Any help would be greatly appreciated.  Thanks
> 
> 
> jmorra wrote:
>> 
>> I have an XML document which contains information that points to many
>> images, and I'm trying to display them using the fo:external-graphic
>> method.  When only a few images are present it works fine.  However, when
>> many images are present (enough that they span multiple pages) then
>> images appear to be "lost," which means they are simply not printed in
>> the PDF.  When I use the following code, the images appear staggered, and
>> there is a lot of white space, however, all the images are printed
>> correctly.
>> 
>> <fo:table-cell padding="3mm">
>>     <xsl:apply-templates select="attr[@tag='0040A730']/item"
>> mode="content">
>>         <xsl:with-param name="pattern">Image</xsl:with-param>
>>     </xsl:apply-templates>
>> </fo:table-cell>
>> 
>> <xsl:template match="item" mode="content">
>>     <xsl:param name="pattern"/>
>>     <xsl:if test="$pattern='Image'">
>>         <fo:external-graphic width="8cm">
>>             <xsl:attribute
>> name="src">url(https://localhost:8443/wado?requestType=WADO&amp;studyUID=1&amp;seriesUID=1&amp;objectUID=<xsl:value-of
>> select="attr[@tag='00081199']/item/attr[@tag='00081155']"/>)</xsl:attribute>
>>         </fo:external-graphic>
>>     </xsl:if>
>> </xsl:template>
>> 
>> The first part of the code is wrapped inside of a fo:table.  However, if
>> I replace the first part with the following
>> 
>> <fo:table-cell padding="3mm">
>>     <fo:block>
>>         <xsl:apply-templates select="attr[@tag='0040A730']/item"
>> mode="content">
>>             <xsl:with-param name="pattern">Image</xsl:with-param>
>>         </xsl:apply-templates>
>>     <'fo:block>
>> </fo:table-cell>
>> 
>> Then the images look much better on the page (no white space), but some
>> images are just missing.
>> 
>> I'm pretty new to XSL:FO, but I've been trying to figure this one out for
>> a while, and would greatly appreciate any input.  I'm using version
>> 0.20.5, and am locked into that version.
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Missing-images-when-many-images-are-displayed-tp23772880p23860929.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: Missing images when many images are displayed

Posted by jmorra <jo...@gmail.com>.
Thanks for the help with this question, I was able to upgrade to fop 0.95 (as
you suggested).  It too didn't print the images correctly.  However, I was
able to solve my problem by using a for each loop and creating a two column
table.

However, now I'm having another image problem.  I need to formulate the URLs
for these images via the https protocol, however, the images aren't
appearing when I use any hostname other than localhost.

Here's the error message I'm getting

14:03:25,140 ERROR FOP:243 - Error with opening URL
'https://jonmorra:8443/wado?requestType=WADO&studyUID=1&seriesUID=1&objectUID=1.2.826.0.1.3680043.2.1074.64826.5.71.10003791.5':
HTTPS hostname wrong:  should be <jonmorra>

I know that the URL is valid (I can copy and paste it into a browser), but I
don't know what else I can do, short of downloading the image to a temp
directory and then having the xslt point to that temp directory (which is
really really messy, because I'm dealing with a lot of images).

Any help would be greatly appreciated.  Thanks


jmorra wrote:
> 
> I have an XML document which contains information that points to many
> images, and I'm trying to display them using the fo:external-graphic
> method.  When only a few images are present it works fine.  However, when
> many images are present (enough that they span multiple pages) then images
> appear to be "lost," which means they are simply not printed in the PDF. 
> When I use the following code, the images appear staggered, and there is a
> lot of white space, however, all the images are printed correctly.
> 
> <fo:table-cell padding="3mm">
>     <xsl:apply-templates select="attr[@tag='0040A730']/item"
> mode="content">
>         <xsl:with-param name="pattern">Image</xsl:with-param>
>     </xsl:apply-templates>
> </fo:table-cell>
> 
> <xsl:template match="item" mode="content">
>     <xsl:param name="pattern"/>
>     <xsl:if test="$pattern='Image'">
>         <fo:external-graphic width="8cm">
>             <xsl:attribute
> name="src">url(https://localhost:8443/wado?requestType=WADO&amp;studyUID=1&amp;seriesUID=1&amp;objectUID=<xsl:value-of
> select="attr[@tag='00081199']/item/attr[@tag='00081155']"/>)</xsl:attribute>
>         </fo:external-graphic>
>     </xsl:if>
> </xsl:template>
> 
> The first part of the code is wrapped inside of a fo:table.  However, if I
> replace the first part with the following
> 
> <fo:table-cell padding="3mm">
>     <fo:block>
>         <xsl:apply-templates select="attr[@tag='0040A730']/item"
> mode="content">
>             <xsl:with-param name="pattern">Image</xsl:with-param>
>         </xsl:apply-templates>
>     <'fo:block>
> </fo:table-cell>
> 
> Then the images look much better on the page (no white space), but some
> images are just missing.
> 
> I'm pretty new to XSL:FO, but I've been trying to figure this one out for
> a while, and would greatly appreciate any input.  I'm using version
> 0.20.5, and am locked into that version.
> 

-- 
View this message in context: http://www.nabble.com/Missing-images-when-many-images-are-displayed-tp23772880p23859454.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: Missing images when many images are displayed

Posted by Chris Bowditch <bo...@hotmail.com>.
jmorra wrote:

<snip/>

> 
> Then the images look much better on the page (no white space), but some
> images are just missing.
> 
> I'm pretty new to XSL:FO, but I've been trying to figure this one out for a
> while, and would greatly appreciate any input.  I'm using version 0.20.5,
> and am locked into that version.

It's hard to tell from your XSLT exactly what your XSL-FO will look 
like. I recommend running your XSLT stylesheet and XML through a XSLT 
processor such as Xalan to produce your XSL-FO and then post the 
relevant snippets from that.

As for v0.20.5; I appreciate that you may be locked into a particular 
version but it is v.v.v.v.old now and no one really knows much about it 
anymore (or has the energy to re-learn it)

Chris



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


Re: Missing images when many images are displayed

Posted by Pascal SANCHO <pa...@takoma.fr>.
Hi,

With FOP 0.20.5, many reasons can give such behaviour:
 - erroneous vertical remaining space calculation in body page, witch 
causes some content to be dropped below the bottom of page
 - image height larger than body height (in such case, infinite loop can 
occur)
 - available space too short for the image
 - etc.
In addition, this version is not totally conformant with the XSL 
recommandation.

Since you are "pretty new to XSL:FO", the better thing to do IMHO is to 
use FOP 0.9x, since its behaviour is more predictible.

Another tip: you should provide a XSL-FO file (not XSLT), this is more 
helpfull for list contributors...

Pascal


jmorra a écrit :
> I have an XML document which contains information that points to many images,
> and I'm trying to display them using the fo:external-graphic method.  When
> only a few images are present it works fine.  However, when many images are
> present (enough that they span multiple pages) then images appear to be
> "lost," which means they are simply not printed in the PDF.  When I use the
> following code, the images appear staggered, and there is a lot of white
> space, however, all the images are printed correctly.
>
> <fo:table-cell padding="3mm">
>     <xsl:apply-templates select="attr[@tag='0040A730']/item" mode="content">
>         <xsl:with-param name="pattern">Image</xsl:with-param>
>     </xsl:apply-templates>
> </fo:table-cell>
>
> <xsl:template match="item" mode="content">
>     <xsl:param name="pattern"/>
>     <xsl:if test="$pattern='Image'">
>         <fo:external-graphic width="8cm">
>             <xsl:attribute
> name="src">url(https://localhost:8443/wado?requestType=WADO&amp;studyUID=1&amp;seriesUID=1&amp;objectUID=<xsl:value-of
> select="attr[@tag='00081199']/item/attr[@tag='00081155']"/>)</xsl:attribute>
>         </fo:external-graphic>
>     </xsl:if>
> </xsl:template>
>
> The first part of the code is wrapped inside of a fo:table.  However, if I
> replace the first part with the following
>
> <fo:table-cell padding="3mm">
>     <fo:block>
>         <xsl:apply-templates select="attr[@tag='0040A730']/item"
> mode="content">
>             <xsl:with-param name="pattern">Image</xsl:with-param>
>         </xsl:apply-templates>
>     <'fo:block>
> </fo:table-cell>
>
> Then the images look much better on the page (no white space), but some
> images are just missing.
>
> I'm pretty new to XSL:FO, but I've been trying to figure this one out for a
> while, and would greatly appreciate any input.  I'm using version 0.20.5,
> and am locked into that version.
>   

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