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 Jerry <je...@yahoo.com> on 2004/04/08 00:33:21 UTC

only display the text in XSL file but does not display the image

Jeremias and folks,

I rewrote my servlet and got a little progress even if
it still cannot display the tiff data.

When I ran my servlet, from web browser, I can see the
text(i.e. COPY ONLY etc) in PDF format. Those text are
from my XSL file.  But it does not show the image. I
ran my new servlet--GetByteStream seperately, it can
display tiff image.  It seems like the byte stream
which takes the binary data did not pass to XSL. 

I enclosed the codes here. Can you please tell me
anything wrong with my codes?

Many thanks,

Jerry

//servlet to display tiff data in PDF format 
public class DisplayImage extends HttpServlet {
    ...
   private void
sendPDFBinaryResponse(HttpServletResponse
res,HttpServletRequest req) throws IOException,
ServletException{
                         	

		if (log == null) {
	        log = new
ConsoleLogger(ConsoleLogger.LEVEL_WARN);
            MessageHandler.setScreenLogger(log);
       	 }

  	

		try {

            ByteArrayOutputStream out = new
ByteArrayOutputStream();

           
            Driver driver = new Driver();
            driver.setLogger(log);
            driver.setRenderer(Driver.RENDER_PDF);
            
            
            File xsltfile = new
File("C:/workspace/MaxTradDownload/Web
Content/html/Tiff2Pdf.xsl");

            
            try {


			res.setContentType("application/pdf");
            driver.setOutputStream(out);

            //Setup XSLT
            TransformerFactory factory =
TransformerFactory.newInstance();
            Transformer transformer =
factory.newTransformer(new StreamSource(xsltfile));
        
        	
			String GetByteStreamServletURL="http://" +
req.getServerName() + ":" + req.getServerPort() +
"/MaxTradDownload" + "/GetByteStreamServlet?" +
req.getQueryString();
        	        	
        	
        	//*assign ByteArrayInputStream bais to image
variable in xsltfile, seems like it is not working.
        	transformer.setParameter("image",
GetByteStreamServletURL);


       
        
            //Resulting SAX events (the generated FO)
must be piped through to FOP
            Result result = new
SAXResult(driver.getContentHandler());

            //Start XSLT transformation and FOP
processing
            transformer.transform(new
StreamSource("c:/temp/DummyXML.xml"), result);
            
                  
            byte[] content = out.toByteArray();


            res.setContentLength(content.length);
            res.getOutputStream().write(content);
            res.getOutputStream().flush();

            
        } finally {
            out.close();
        }


        } catch (Exception ex) {
            throw new ServletException(ex);
        }

  	}
  
       ...
  
}

//new servlet to return byte stream to DisplayImage
servlet

public class DisplayImage extends HttpServlet {
   ...
 private void sendBinaryResponse(HttpServletResponse
res,
                                  HttpServletRequest
req, byte[] bt,
                                  String
sContTypeHeader,
                                  String
sEncodingHeader, String encoding) {
                                  	
             	
  
    res.addHeader("Expires", "Wed, 26 Feb 1970
08:21:57 GMT");
    res.addHeader("Cache-Control", "no-cache");

    res.setContentType(sContTypeHeader);
    try {
      OutputStream out = null;
      	res.setContentType(sContTypeHeader);

      
              if (sEncodingHeader != null) {
          res.setHeader("Content-Encoding",
sEncodingHeader);
        }
        res.setContentLength(bt.length);
        out = res.getOutputStream();
          
        out.write(bt);
     
      out.flush();
      out.close();
    }
    catch (Throwable e) {}
  }

  ...

}

//here is my XSL file
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fo">

<xsl:template match="/">


	<fo:root font-family="Times Roman" font-size="12pt"
text-align="center"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

		<fo:layout-master-set>
    	<fo:simple-page-master
  margin-right="1.5cm"
  margin-left="1.5cm"
  margin-bottom="2cm"
  margin-top="1cm"
  page-width="21cm"
  page-height="29.7cm"
  master-name="left">
      <fo:region-before extent="1cm"/>
      <fo:region-body margin-top="1cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>

</fo:layout-master-set>

<fo:page-sequence id="N2528" master-reference="left">

<fo:static-content flow-name="xsl-region-after">
  <fo:block text-align-last="center" font-size="10pt">
    <fo:page-number/>
  </fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">
<fo:block font-size="18pt" font-weight="bold">Copy
Only</fo:block>
<fo:block>

  <fo:block>
	<fo:external-graphic width="50pt" height="50pt"
overflow="hidden" src="url('{@image}')"/>
  </fo:block>
  
  
  <fo:block font-size="16pt" font-weight="bold"
space-before.minimum="1em"
space-before.optimum="1.5em"
space-before.maximum="2em"/>
  This document is just Copy only, Non Negotiable
</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>
</xsl:template>

</xsl:stylesheet>


--- Jerry <je...@yahoo.com> wrote:
> Jeremias,
> 
> Thank you so much for your detailed information. It
> really helps me a lot.
> 
> Based on your suggestion, I am going to implement
> it.
> I will let you know what I get.
> 
> Best regards,
> 
> 
> 
> Jerry 
> --- Jeremias Maerki <de...@greenmail.ch>
> wrote:
> > Hello Jerry,
> > 
> > On 07.04.2004 19:07:05 Jerry wrote:
> > > Jeremias,
> > > 
> > > Thank you for your suggestions.
> > > 
> > > The soultion you gave me here is very intrigue
> to
> > me.
> > > However, I cannot fully understand your point.
> > Would
> > > you please clarify for me if the following
> > approach is
> > > not what you mean?
> > > 
> > > 1. I need to write a new servlet which will
> return
> > a
> > > ByteArrayInputStream which take the binary tiff
> > data
> > > from database. 
> > 
> > Just nitpicking: Your new servlet writes the TIFF
> > file byte by byte to
> > the Request's OutputStream.
> > 
> > > 2. Modify my current servlet and set the URL to
> my
> > new
> > > servlet as a parameter to the XSL file using the
> > > following:
> > > 
> > > //assume the new servlet is GetByteStreamServlet
> > > String
> > NewServletURL="/GetByteStreamServlet?id=123"  
> > 
> > Right! Something like that, if the base URL is
> set.
> > YOu might have to
> > use http://localhost/....
> > 
> > > TransformerFactory factory =
> > > TransformerFactory.newInstance();
> > >             Transformer transformer =
> > > factory.newTransformer(new
> > StreamSource(xsltfile));
> > >         
> > >         	
> > >         	//pass NewServletURL to image variable
> in
> > > xsltfile, is this corect?
> > >         	transformer.setParameter("image",
> > > NewServlet);
> > 
> > Correct.
> > 
> > > 
> > > If above correct, I also modify XSL file like
> > this:
> > >   ...
> > >  <fo:external-graphic width="50pt" height="50pt"
> > > overflow="hidden" src="URL('{@image}')"/>
> > >  ...
> > 
> > Correct.
> > 
> > > If I use this way, how can set Source parameter
> of
> > > transformer.transform((Source)?, res)? I am not
> > sure
> > > of this part.
> > 
> > The source document is probably a dummy XML
> > document, just like this:
> > 
> > <dummy/>
> > 
> > That's enough.
> > 
> > > Please correct me if I misunderstood your point.
> > 
> > No, you did alright. The XSLT you posted on the
> list
> > earlier will
> > probably not work however. It doesn't look right.
> At
> > least an embracing
> > xsl:template is missing:
> > 
> > <xsl:template match="/">
> >    <!-- your xsl-fo code here -->
> > </xsl:template>
> > 
> > 
> > Create the TIFF-serving Servlet first and then get
> > your XSLT stylesheet
> > together from the command-line. You can test the
> > TIFF-Servlet from your
> > browser. If both are working go back to your
> > original servlet and finish.
> > 
> > For the next time, please don't write directly to
> > those who answer
> > questions. Others won't be able to profit from the
> > solutions I'm giving
> > you, as I can't tell whether you'd agree if I
> simply
> > sent my answer to
> > the list again.
> > -- 
> > Jeremias Maerki <de...@greenmail.ch>
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway 
> http://promotions.yahoo.com/design_giveaway/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text but still cannot display the image

Posted by Jerry <je...@yahoo.com>.
Clay,

You are absolutely right. I learned a lot from the
steps you provided me here. So, I am clear how I
solved the problem. I already wrote a short summary
for others to benefit.

best regards,


Jerry 
--- Clay Leeds <cl...@medata.com> wrote:
> Jerry,
> 
> I think I speak for Jeremias (and the rest of us
> here) when I say we're 
> glad we could help. One thing you could do, is
> document the 'steps' you 
> take to resolve your problem, so that others who
> have a similar problem 
> can benefit.
> 
> Web Maestro Clay
> 
> On Apr 9, 2004, at 10:30 AM, Jerry wrote:
> > Jeremias,
> >
> > I cannot thank you enough. You spent so much time
> > helping me with this.
> >
> > I added the line right before "xsl:template". This
> > time the browser can show the text(COPY ONLY)
> which is
> > from XSL and still does not show the image.
> >
> > I checked WSAD console. The error is as followed:
> >
> > Error while creating area : Error with image URL:
> > parameter not set (The system cannot find the file
> > specified) and no base URL is specified
> >
> >
> > Thank you very much for your continous help.
> However,
> > I did not take your help for grant. Every time I
> asked
> > for help, my heart was full of gratitude. I have
> less
> > experience with FOP and XSL. This task is a little
> > special. I really cannot get too much hint from
> the
> > standard FOP/XSL examples. Without your help and
> > direction, I really do not know how far I can go.
> >
> > Many thanks,
> >
> > Jerry
> > --- Jeremias Maerki <de...@greenmail.ch>
> wrote:
> >> Ah, then add the following near the top of your
> >> stylesheet (before the
> >> first "xsl:template"):
> >>
> >> <xsl:variable name="image" select="'parameter not
> >> set'"/>
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Small Business $15K Web Design Giveaway
> > http://promotions.yahoo.com/design_giveaway/
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail:
> fop-user-help@xml.apache.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text but still cannot display the image

Posted by Clay Leeds <cl...@medata.com>.
Jerry,

I think I speak for Jeremias (and the rest of us here) when I say we're 
glad we could help. One thing you could do, is document the 'steps' you 
take to resolve your problem, so that others who have a similar problem 
can benefit.

Web Maestro Clay

On Apr 9, 2004, at 10:30 AM, Jerry wrote:
> Jeremias,
>
> I cannot thank you enough. You spent so much time
> helping me with this.
>
> I added the line right before "xsl:template". This
> time the browser can show the text(COPY ONLY) which is
> from XSL and still does not show the image.
>
> I checked WSAD console. The error is as followed:
>
> Error while creating area : Error with image URL:
> parameter not set (The system cannot find the file
> specified) and no base URL is specified
>
>
> Thank you very much for your continous help. However,
> I did not take your help for grant. Every time I asked
> for help, my heart was full of gratitude. I have less
> experience with FOP and XSL. This task is a little
> special. I really cannot get too much hint from the
> standard FOP/XSL examples. Without your help and
> direction, I really do not know how far I can go.
>
> Many thanks,
>
> Jerry
> --- Jeremias Maerki <de...@greenmail.ch> wrote:
>> Ah, then add the following near the top of your
>> stylesheet (before the
>> first "xsl:template"):
>>
>> <xsl:variable name="image" select="'parameter not
>> set'"/>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


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


only display the text but still cannot display the image

Posted by Jerry <je...@yahoo.com>.
Jeremias,

I cannot thank you enough. You spent so much time
helping me with this.

I added the line right before "xsl:template". This
time the browser can show the text(COPY ONLY) which is
from XSL and still does not show the image.

I checked WSAD console. The error is as followed:

Error while creating area : Error with image URL:
parameter not set (The system cannot find the file
specified) and no base URL is specified


Thank you very much for your continous help. However,
I did not take your help for grant. Every time I asked
for help, my heart was full of gratitude. I have less
experience with FOP and XSL. This task is a little
special. I really cannot get too much hint from the
standard FOP/XSL examples. Without your help and
direction, I really do not know how far I can go.

Many thanks,

Jerry
--- Jeremias Maerki <de...@greenmail.ch> wrote:
> Ah, then add the following near the top of your
> stylesheet (before the
> first "xsl:template"):
> 
> <xsl:variable name="image" select="'parameter not
> set'"/>


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Jeremias Maerki <de...@greenmail.ch>.
Ah, then add the following near the top of your stylesheet (before the
first "xsl:template"):

<xsl:variable name="image" select="'parameter not set'"/>


On 09.04.2004 18:04:34 Jerry wrote:
> Jeremias,
> 
> This time, I got this error:
> 
> Error 500:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException:
> org.apache.xml.utils.WrappedRuntimeException: Could
> not find variable with the name of image 
> 
> I replaced src="url('{@image}')" with
> src="url('{$image}')".
> 
> I set the parameter using this:
> 
> String GetByteStreamServletURL="http://" +
> req.getServerName() + ":" + req.getServerPort() +
> "/MaxTradDownload" + "/GetByteStream?" +
> req.getQueryString();
> 
> transformer.setParameter("image",
> GetByteStreamServletURL);


Jeremias Maerki


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


Re: only display the text in XSL file but does not display the image

Posted by Clay Leeds <cl...@medata.com>.
Thanks, Jeremias,

I remember seeing that, as well as your subsequent msg indicating 
*that* is where Jerry should look, but I missed it too.

Have a nice day/evening/sleep!

Web Maestro Clay

On Apr 9, 2004, at 8:15 AM, Jeremias Maerki wrote:
> Ok, here's the relevant part again:
>
>>> 	<fo:external-graphic width="50pt" height="50pt"
>>> overflow="hidden" src="url('{@image}')"/>
>>
>> This is wrong: Use {$image} instead because @image accesses the 
>> "image"
>> attribute of the context node, not the parameter.
>
> On 09.04.2004 15:37:55 Jerry wrote:
>> I am still researching on this part. Jeremias, do you
>> have suggestion for this?
>
>
> Jeremias Maerki


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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Jeremias,

This time, I got this error:

Error 500:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
org.apache.xml.utils.WrappedRuntimeException: Could
not find variable with the name of image 

I replaced src="url('{@image}')" with
src="url('{$image}')".

I set the parameter using this:

String GetByteStreamServletURL="http://" +
req.getServerName() + ":" + req.getServerPort() +
"/MaxTradDownload" + "/GetByteStream?" +
req.getQueryString();

transformer.setParameter("image",
GetByteStreamServletURL);


thanks,

Jerry


--- Jeremias Maerki <de...@greenmail.ch> wrote:
> Ok, here's the relevant part again:
> 
> > > 	<fo:external-graphic width="50pt" height="50pt"
> > > overflow="hidden" src="url('{@image}')"/>
> > 
> > This is wrong: Use {$image} instead because @image
> accesses the "image"
> > attribute of the context node, not the parameter.
> 
> On 09.04.2004 15:37:55 Jerry wrote:
> > I am still researching on this part. Jeremias, do
> you
> > have suggestion for this?
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Jeremias Maerki <de...@greenmail.ch>.
Ok, here's the relevant part again:

> > 	<fo:external-graphic width="50pt" height="50pt"
> > overflow="hidden" src="url('{@image}')"/>
> 
> This is wrong: Use {$image} instead because @image accesses the "image"
> attribute of the context node, not the parameter.

On 09.04.2004 15:37:55 Jerry wrote:
> I am still researching on this part. Jeremias, do you
> have suggestion for this?


Jeremias Maerki


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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Clay,

Thank you for your suggestion.

I tried using both .tif and .pdf. The problem seems
like it is still the way of passing XSL parameter. For
some reason, xsl does not recongnize the passing
servlet.

I am still researching on this part. Jeremias, do you
have suggestion for this?

thanks and have a Good Friday!,


Jerry
--- Clay Leeds <cl...@medata.com> wrote:
> I doubt if it'll work (READ: grasping at straws?),
> but perhaps ending  
> the URL with the .tif extension in the same way that
> adding .pdf to the  
> end of a PDF file helps. Something like:
> 
> >
> http://localhost:9080/MaxTradDownload/GetByteStream?
> 
> >
>
guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1
> 
> >
>
79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost&ext=filename.tif
> 
> IOW, maybe the problem isn't just with IE displaying
> PDF files, but  
> perhaps TIFF files as well.
> 
> Web Maestro Clay
> 
> On Apr 8, 2004, at 1:25 PM, Jerry wrote:
> > Clay,
> >
> > Thank you for your info.
> >
> > My servlet can render static tiff image file to
> PDF
> > format. I already implemented that part. My IE 6.0
> can
> > display it correctly. I guess something is wrong
> with
> > the way I passed the servlet URL to XSL file. I
> just
> > couldnot figure it out.
> >
> > thanks,
> >
> >
> > Jerry
> > --- Clay Leeds <cl...@medata.com> wrote:
> >> Jerry,
> >>
> >> I don't know if this'll help (apologies if it's a
> >> wild goose chase),
> >> but there's this info RE: IE-specific problems:
> >>
> >>    http://xml.apache.org/fop/servlets.html#ie
> >>
> >> Perhaps something in there might help as a
> >> workaround...
> >>
> >> Web Maestro Clay
> >>
> >> On Apr 8, 2004, at 12:34 PM, Jerry wrote:
> >>> Jeremias,
> >>>
> >>> Still stuch by the issue of empty image url.
> >> Before I
> >>> pass the value of GetByteStreamServletURL to
> XSL,
> >> I
> >>> printed it
> >>>
> >>
> >
>
out(http://localhost:9080/MaxTradDownload/GetByteStream?
> >>
> >>>
> >>
> >
>
guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1
> >>
> >>>
> >>
> >
>
79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost).
> >>> It looks fine. However, my XSL file always got
> >> empty
> >>> string. Do you have any idea about it?
> >>>
> >>> I also tried to use command line to test it
> under
> >> the
> >>> lib dir of my working directory, I got error:
> >>>
> >>> java org.apache.xalan.xslt.Process -IN
> >> DummyXML.xml
> >>> -XSL Tiff2Pdf.xsl -OUT T
> >>> iff2Pdf.fo  -PARAM image
> >>>
> >>
> >
>
http://localhost:9080/MaxTradDownload/GetByteStream?gui
> >>>
> >>
> >
>
d=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B
> >>
> >>> 62F3F11E2
> >>> 7D&ImageFormat=pdf&ImageSource=localhost
> >>> Registry key 'Software\JavaSoft\Java Runtime
> >>> Environment\CurrentVersion'
> >>> has value '1.1', but '1.3' is required.
> >>> Error: could not find java.dll
> >>> Error: could not find Java 2 Runtime
> Environment.
> >>> 'ImageFormat' is not recognized as an internal
> or
> >>> external command,
> >>> operable program or batch file.
> >>> 'ImageSource' is not recognized as an internal
> or
> >>> external command,
> >>> operable program or batch file.
> >>>
> >>> It tells me I need higher JRE version. I use
> WSAD
> >> 5.0.
> >>> I checked my JRE version, it is 1.3.1. I do not
> >> know
> >>> why. I ran this from the lib dir of my working
> >>> directory. I put xalan.jar, xml-apis.jar, and
> >>> xercesImpl.jar in my lib directory and also set
> up
> >> the
> >>> classpathes for them.
> >>>
> >>> Is there any other way which can help me out why
> >> it
> >>> passed an empty string? Please help.
> >>>
> >>> Jerry
> >>>
> >>>
> >>>
> >>> --- Jerry <je...@yahoo.com> wrote:
> >>>> Jeremias and Clay,
> >>>>
> >>>> Thanks. I will work on the URL parameter first
> to
> >>>> check why it is empty even if I already set the
> >>>> value
> >>>> url as "http://...".
> >>>>
> >>>> If I still have a problem, I will check the
> >>>> reference
> >>>> you gave  and use command line to test it.
> >>>>
> >>>> thanks,
> >>>>
> >>>>
> >>>> Jerry
> >>>> --- Jeremias Maerki <de...@greenmail.ch>
> >>>> wrote:
> >>>>>
> >>>>> On 08.04.2004 16:37:04 Jerry wrote:
> >>>>>> Jeremias,
> >>>>>>
> >>>>>> thanks a lot for your input.
> >>>>>
> >>>>> You're welcome.
> >>>>>
> >>>>>> 1.
> >>>>>> I set it into LEVEL_DEBUG and checked the
> >>>> console.
> >>>>> It
> >>>>>> looks like it is image url path setting's
> >>>> problem.
> >>>>>> What does that mean by "no base directory is
> >>>>>> specified"?
> >>>>>
> >>>>> The base directory is used to convert relative
> >>>> URLs
> >>>>> to absolute ones.
> >>>>> See
> >>>>>
> >>>>
> >>>
> >>
> >
>
http://xml.apache.org/fop/embedding.html#config-internal
> >>>>>
> >>>>> Example:
> >>>>> Relative URL: images/myimage.tif
> >>>>> Base URL (or dir): http://localhost:8080/
> >>>>> Resulting URL:
> >>>>> http://localhost:8080/images/myimage.tif
> >>>>>
> >>>>>> I am wondering if the way or syntax I use
> >>>>>> to set Image url vriable is right.
> >>>>>
> >>>>> Your intentions were totally alright, it's
> just
> >>>> that
> >>>>> you set an empty
> >>>>> String as URL. See me previous mail further
> >> down.
> >>>>> Looks like you missed
> >>>>> my key comment.
> >>>>>
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Clay Leeds <cl...@medata.com>.
I doubt if it'll work (READ: grasping at straws?), but perhaps ending  
the URL with the .tif extension in the same way that adding .pdf to the  
end of a PDF file helps. Something like:

> http://localhost:9080/MaxTradDownload/GetByteStream? 
> guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1 
> 79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost&ext=filename.tif

IOW, maybe the problem isn't just with IE displaying PDF files, but  
perhaps TIFF files as well.

Web Maestro Clay

On Apr 8, 2004, at 1:25 PM, Jerry wrote:
> Clay,
>
> Thank you for your info.
>
> My servlet can render static tiff image file to PDF
> format. I already implemented that part. My IE 6.0 can
> display it correctly. I guess something is wrong with
> the way I passed the servlet URL to XSL file. I just
> couldnot figure it out.
>
> thanks,
>
>
> Jerry
> --- Clay Leeds <cl...@medata.com> wrote:
>> Jerry,
>>
>> I don't know if this'll help (apologies if it's a
>> wild goose chase),
>> but there's this info RE: IE-specific problems:
>>
>>    http://xml.apache.org/fop/servlets.html#ie
>>
>> Perhaps something in there might help as a
>> workaround...
>>
>> Web Maestro Clay
>>
>> On Apr 8, 2004, at 12:34 PM, Jerry wrote:
>>> Jeremias,
>>>
>>> Still stuch by the issue of empty image url.
>> Before I
>>> pass the value of GetByteStreamServletURL to XSL,
>> I
>>> printed it
>>>
>>
> out(http://localhost:9080/MaxTradDownload/GetByteStream?
>>
>>>
>>
> guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1
>>
>>>
>>
> 79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost).
>>> It looks fine. However, my XSL file always got
>> empty
>>> string. Do you have any idea about it?
>>>
>>> I also tried to use command line to test it under
>> the
>>> lib dir of my working directory, I got error:
>>>
>>> java org.apache.xalan.xslt.Process -IN
>> DummyXML.xml
>>> -XSL Tiff2Pdf.xsl -OUT T
>>> iff2Pdf.fo  -PARAM image
>>>
>>
> http://localhost:9080/MaxTradDownload/GetByteStream?gui
>>>
>>
> d=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B
>>
>>> 62F3F11E2
>>> 7D&ImageFormat=pdf&ImageSource=localhost
>>> Registry key 'Software\JavaSoft\Java Runtime
>>> Environment\CurrentVersion'
>>> has value '1.1', but '1.3' is required.
>>> Error: could not find java.dll
>>> Error: could not find Java 2 Runtime Environment.
>>> 'ImageFormat' is not recognized as an internal or
>>> external command,
>>> operable program or batch file.
>>> 'ImageSource' is not recognized as an internal or
>>> external command,
>>> operable program or batch file.
>>>
>>> It tells me I need higher JRE version. I use WSAD
>> 5.0.
>>> I checked my JRE version, it is 1.3.1. I do not
>> know
>>> why. I ran this from the lib dir of my working
>>> directory. I put xalan.jar, xml-apis.jar, and
>>> xercesImpl.jar in my lib directory and also set up
>> the
>>> classpathes for them.
>>>
>>> Is there any other way which can help me out why
>> it
>>> passed an empty string? Please help.
>>>
>>> Jerry
>>>
>>>
>>>
>>> --- Jerry <je...@yahoo.com> wrote:
>>>> Jeremias and Clay,
>>>>
>>>> Thanks. I will work on the URL parameter first to
>>>> check why it is empty even if I already set the
>>>> value
>>>> url as "http://...".
>>>>
>>>> If I still have a problem, I will check the
>>>> reference
>>>> you gave  and use command line to test it.
>>>>
>>>> thanks,
>>>>
>>>>
>>>> Jerry
>>>> --- Jeremias Maerki <de...@greenmail.ch>
>>>> wrote:
>>>>>
>>>>> On 08.04.2004 16:37:04 Jerry wrote:
>>>>>> Jeremias,
>>>>>>
>>>>>> thanks a lot for your input.
>>>>>
>>>>> You're welcome.
>>>>>
>>>>>> 1.
>>>>>> I set it into LEVEL_DEBUG and checked the
>>>> console.
>>>>> It
>>>>>> looks like it is image url path setting's
>>>> problem.
>>>>>> What does that mean by "no base directory is
>>>>>> specified"?
>>>>>
>>>>> The base directory is used to convert relative
>>>> URLs
>>>>> to absolute ones.
>>>>> See
>>>>>
>>>>
>>>
>>
> http://xml.apache.org/fop/embedding.html#config-internal
>>>>>
>>>>> Example:
>>>>> Relative URL: images/myimage.tif
>>>>> Base URL (or dir): http://localhost:8080/
>>>>> Resulting URL:
>>>>> http://localhost:8080/images/myimage.tif
>>>>>
>>>>>> I am wondering if the way or syntax I use
>>>>>> to set Image url vriable is right.
>>>>>
>>>>> Your intentions were totally alright, it's just
>>>> that
>>>>> you set an empty
>>>>> String as URL. See me previous mail further
>> down.
>>>>> Looks like you missed
>>>>> my key comment.
>>>>>
>>>>>> The detailed
>>>>>> console info is as followed:
>>>>>>
>>>>>> [INFO] building formatting object tree
>>>>>> [DEBUG] setting up fonts [INFO] [1]
>>>>>> [ERROR] Error while creating area : Error with
>>>>> image
>>>>>> URL:  (The system cannot find the path
>>>> specified)
>>>>> and
>>>>>
>>>>> See the emptyness between "URL:" and "(The
>>>>> system..."? No URL set.
>>>>>
>>>>>> no base directory is specified
>>>>>> [DEBUG] Last page-sequence produced 1 pages.
>>>>>> [INFO] Parsing of document complete, stopping
>>>>> renderer
>>>>>> [DEBUG] Initial heap size: 30061Kb
>>>>>> [DEBUG] Current heap size: 35273Kb
>>>>>> [DEBUG] Total memory used: 5212Kb
>>>>>> [DEBUG]   Memory use is indicative; no GC was
>>>>>> performed
>>>>>> [DEBUG]   These figures should not be used
>>>>>> comparatively
>>>>>> [DEBUG] Total time used: 741ms
>>>>>> [DEBUG] Pages rendered: 1
>>>>>> [DEBUG] Avg render time: 741ms/page
>>>>>>
>>>>>> 2.
>>>>>>> It also helps if you just do the XSLT
>>>>> transformation
>>>>>>> on the command line
>>>>>>> (as I suggested earlier). By checking the
>>>>> generated
>>>>>>> FO afterwards you
>>>>>>> can see if everything is alright.
>>>>>>
>>>>>> Sorry I am not sure how to use XSLT to test it
>>>>> from
>>>>>> command line.
>>>>>
>>>>> If you use Xalan-J as XSLT processor (default in
>>>> JDK
>>>>> 1.4 and later), see
>>>>> here:
>>>>> http://xml.apache.org/xalan-j/commandline.html
>>>>>
>>>>>> 3.
>>>>>> If I ran GetByteStream servlet, it can display
>>>> the
>>>>>> image in tiff format. You mentioned this
>> servlet
>>>>>> should write the TIFF file byte by byte to
>>>>>> the Request's OutputStream. Can you take a look
>>>> to
>>>>> if
>>>>>> I did right?
>>>>>
>>>>> I already did last time. I snipped it out
>> because
>>>> it
>>
> === message truncated ===
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Clay,

Thank you for your info.

My servlet can render static tiff image file to PDF
format. I already implemented that part. My IE 6.0 can
display it correctly. I guess something is wrong with
the way I passed the servlet URL to XSL file. I just
couldnot figure it out.

thanks,


Jerry
--- Clay Leeds <cl...@medata.com> wrote:
> Jerry,
> 
> I don't know if this'll help (apologies if it's a
> wild goose chase),  
> but there's this info RE: IE-specific problems:
> 
>    http://xml.apache.org/fop/servlets.html#ie
> 
> Perhaps something in there might help as a
> workaround...
> 
> Web Maestro Clay
> 
> On Apr 8, 2004, at 12:34 PM, Jerry wrote:
> > Jeremias,
> >
> > Still stuch by the issue of empty image url.
> Before I
> > pass the value of GetByteStreamServletURL to XSL,
> I
> > printed it
> >
>
out(http://localhost:9080/MaxTradDownload/GetByteStream?
> 
> >
>
guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1
> 
> >
>
79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost).
> > It looks fine. However, my XSL file always got
> empty
> > string. Do you have any idea about it?
> >
> > I also tried to use command line to test it under
> the
> > lib dir of my working directory, I got error:
> >
> > java org.apache.xalan.xslt.Process -IN
> DummyXML.xml
> > -XSL Tiff2Pdf.xsl -OUT T
> > iff2Pdf.fo  -PARAM image
> >
>
http://localhost:9080/MaxTradDownload/GetByteStream?gui
> >
>
d=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B
> 
> > 62F3F11E2
> > 7D&ImageFormat=pdf&ImageSource=localhost
> > Registry key 'Software\JavaSoft\Java Runtime
> > Environment\CurrentVersion'
> > has value '1.1', but '1.3' is required.
> > Error: could not find java.dll
> > Error: could not find Java 2 Runtime Environment.
> > 'ImageFormat' is not recognized as an internal or
> > external command,
> > operable program or batch file.
> > 'ImageSource' is not recognized as an internal or
> > external command,
> > operable program or batch file.
> >
> > It tells me I need higher JRE version. I use WSAD
> 5.0.
> > I checked my JRE version, it is 1.3.1. I do not
> know
> > why. I ran this from the lib dir of my working
> > directory. I put xalan.jar, xml-apis.jar, and
> > xercesImpl.jar in my lib directory and also set up
> the
> > classpathes for them.
> >
> > Is there any other way which can help me out why
> it
> > passed an empty string? Please help.
> >
> > Jerry
> >
> >
> >
> > --- Jerry <je...@yahoo.com> wrote:
> >> Jeremias and Clay,
> >>
> >> Thanks. I will work on the URL parameter first to
> >> check why it is empty even if I already set the
> >> value
> >> url as "http://...".
> >>
> >> If I still have a problem, I will check the
> >> reference
> >> you gave  and use command line to test it.
> >>
> >> thanks,
> >>
> >>
> >> Jerry
> >> --- Jeremias Maerki <de...@greenmail.ch>
> >> wrote:
> >>>
> >>> On 08.04.2004 16:37:04 Jerry wrote:
> >>>> Jeremias,
> >>>>
> >>>> thanks a lot for your input.
> >>>
> >>> You're welcome.
> >>>
> >>>> 1.
> >>>> I set it into LEVEL_DEBUG and checked the
> >> console.
> >>> It
> >>>> looks like it is image url path setting's
> >> problem.
> >>>> What does that mean by "no base directory is
> >>>> specified"?
> >>>
> >>> The base directory is used to convert relative
> >> URLs
> >>> to absolute ones.
> >>> See
> >>>
> >>
> >
>
http://xml.apache.org/fop/embedding.html#config-internal
> >>>
> >>> Example:
> >>> Relative URL: images/myimage.tif
> >>> Base URL (or dir): http://localhost:8080/
> >>> Resulting URL:
> >>> http://localhost:8080/images/myimage.tif
> >>>
> >>>> I am wondering if the way or syntax I use
> >>>> to set Image url vriable is right.
> >>>
> >>> Your intentions were totally alright, it's just
> >> that
> >>> you set an empty
> >>> String as URL. See me previous mail further
> down.
> >>> Looks like you missed
> >>> my key comment.
> >>>
> >>>> The detailed
> >>>> console info is as followed:
> >>>>
> >>>> [INFO] building formatting object tree
> >>>> [DEBUG] setting up fonts [INFO] [1]
> >>>> [ERROR] Error while creating area : Error with
> >>> image
> >>>> URL:  (The system cannot find the path
> >> specified)
> >>> and
> >>>
> >>> See the emptyness between "URL:" and "(The
> >>> system..."? No URL set.
> >>>
> >>>> no base directory is specified
> >>>> [DEBUG] Last page-sequence produced 1 pages.
> >>>> [INFO] Parsing of document complete, stopping
> >>> renderer
> >>>> [DEBUG] Initial heap size: 30061Kb
> >>>> [DEBUG] Current heap size: 35273Kb
> >>>> [DEBUG] Total memory used: 5212Kb
> >>>> [DEBUG]   Memory use is indicative; no GC was
> >>>> performed
> >>>> [DEBUG]   These figures should not be used
> >>>> comparatively
> >>>> [DEBUG] Total time used: 741ms
> >>>> [DEBUG] Pages rendered: 1
> >>>> [DEBUG] Avg render time: 741ms/page
> >>>>
> >>>> 2.
> >>>>> It also helps if you just do the XSLT
> >>> transformation
> >>>>> on the command line
> >>>>> (as I suggested earlier). By checking the
> >>> generated
> >>>>> FO afterwards you
> >>>>> can see if everything is alright.
> >>>>
> >>>> Sorry I am not sure how to use XSLT to test it
> >>> from
> >>>> command line.
> >>>
> >>> If you use Xalan-J as XSLT processor (default in
> >> JDK
> >>> 1.4 and later), see
> >>> here:
> >>> http://xml.apache.org/xalan-j/commandline.html
> >>>
> >>>> 3.
> >>>> If I ran GetByteStream servlet, it can display
> >> the
> >>>> image in tiff format. You mentioned this
> servlet
> >>>> should write the TIFF file byte by byte to
> >>>> the Request's OutputStream. Can you take a look
> >> to
> >>> if
> >>>> I did right?
> >>>
> >>> I already did last time. I snipped it out
> because
> >> it
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Clay Leeds <cl...@medata.com>.
Jerry,

I don't know if this'll help (apologies if it's a wild goose chase),  
but there's this info RE: IE-specific problems:

   http://xml.apache.org/fop/servlets.html#ie

Perhaps something in there might help as a workaround...

Web Maestro Clay

On Apr 8, 2004, at 12:34 PM, Jerry wrote:
> Jeremias,
>
> Still stuch by the issue of empty image url. Before I
> pass the value of GetByteStreamServletURL to XSL, I
> printed it
> out(http://localhost:9080/MaxTradDownload/GetByteStream? 
> guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B1 
> 79B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost).
> It looks fine. However, my XSL file always got empty
> string. Do you have any idea about it?
>
> I also tried to use command line to test it under the
> lib dir of my working directory, I got error:
>
> java org.apache.xalan.xslt.Process -IN DummyXML.xml
> -XSL Tiff2Pdf.xsl -OUT T
> iff2Pdf.fo  -PARAM image
> http://localhost:9080/MaxTradDownload/GetByteStream?gui
> d=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B 
> 62F3F11E2
> 7D&ImageFormat=pdf&ImageSource=localhost
> Registry key 'Software\JavaSoft\Java Runtime
> Environment\CurrentVersion'
> has value '1.1', but '1.3' is required.
> Error: could not find java.dll
> Error: could not find Java 2 Runtime Environment.
> 'ImageFormat' is not recognized as an internal or
> external command,
> operable program or batch file.
> 'ImageSource' is not recognized as an internal or
> external command,
> operable program or batch file.
>
> It tells me I need higher JRE version. I use WSAD 5.0.
> I checked my JRE version, it is 1.3.1. I do not know
> why. I ran this from the lib dir of my working
> directory. I put xalan.jar, xml-apis.jar, and
> xercesImpl.jar in my lib directory and also set up the
> classpathes for them.
>
> Is there any other way which can help me out why it
> passed an empty string? Please help.
>
> Jerry
>
>
>
> --- Jerry <je...@yahoo.com> wrote:
>> Jeremias and Clay,
>>
>> Thanks. I will work on the URL parameter first to
>> check why it is empty even if I already set the
>> value
>> url as "http://...".
>>
>> If I still have a problem, I will check the
>> reference
>> you gave  and use command line to test it.
>>
>> thanks,
>>
>>
>> Jerry
>> --- Jeremias Maerki <de...@greenmail.ch>
>> wrote:
>>>
>>> On 08.04.2004 16:37:04 Jerry wrote:
>>>> Jeremias,
>>>>
>>>> thanks a lot for your input.
>>>
>>> You're welcome.
>>>
>>>> 1.
>>>> I set it into LEVEL_DEBUG and checked the
>> console.
>>> It
>>>> looks like it is image url path setting's
>> problem.
>>>> What does that mean by "no base directory is
>>>> specified"?
>>>
>>> The base directory is used to convert relative
>> URLs
>>> to absolute ones.
>>> See
>>>
>>
> http://xml.apache.org/fop/embedding.html#config-internal
>>>
>>> Example:
>>> Relative URL: images/myimage.tif
>>> Base URL (or dir): http://localhost:8080/
>>> Resulting URL:
>>> http://localhost:8080/images/myimage.tif
>>>
>>>> I am wondering if the way or syntax I use
>>>> to set Image url vriable is right.
>>>
>>> Your intentions were totally alright, it's just
>> that
>>> you set an empty
>>> String as URL. See me previous mail further down.
>>> Looks like you missed
>>> my key comment.
>>>
>>>> The detailed
>>>> console info is as followed:
>>>>
>>>> [INFO] building formatting object tree
>>>> [DEBUG] setting up fonts [INFO] [1]
>>>> [ERROR] Error while creating area : Error with
>>> image
>>>> URL:  (The system cannot find the path
>> specified)
>>> and
>>>
>>> See the emptyness between "URL:" and "(The
>>> system..."? No URL set.
>>>
>>>> no base directory is specified
>>>> [DEBUG] Last page-sequence produced 1 pages.
>>>> [INFO] Parsing of document complete, stopping
>>> renderer
>>>> [DEBUG] Initial heap size: 30061Kb
>>>> [DEBUG] Current heap size: 35273Kb
>>>> [DEBUG] Total memory used: 5212Kb
>>>> [DEBUG]   Memory use is indicative; no GC was
>>>> performed
>>>> [DEBUG]   These figures should not be used
>>>> comparatively
>>>> [DEBUG] Total time used: 741ms
>>>> [DEBUG] Pages rendered: 1
>>>> [DEBUG] Avg render time: 741ms/page
>>>>
>>>> 2.
>>>>> It also helps if you just do the XSLT
>>> transformation
>>>>> on the command line
>>>>> (as I suggested earlier). By checking the
>>> generated
>>>>> FO afterwards you
>>>>> can see if everything is alright.
>>>>
>>>> Sorry I am not sure how to use XSLT to test it
>>> from
>>>> command line.
>>>
>>> If you use Xalan-J as XSLT processor (default in
>> JDK
>>> 1.4 and later), see
>>> here:
>>> http://xml.apache.org/xalan-j/commandline.html
>>>
>>>> 3.
>>>> If I ran GetByteStream servlet, it can display
>> the
>>>> image in tiff format. You mentioned this servlet
>>>> should write the TIFF file byte by byte to
>>>> the Request's OutputStream. Can you take a look
>> to
>>> if
>>>> I did right?
>>>
>>> I already did last time. I snipped it out because
>> it
>>> looked good.
>>> If you can download the TIFF via your browser then
>>> everything's ok.
>>>
>>> <snip what="GetByteStream servlet"/>
>>>
>>>
>>> Jeremias Maerki
>>>
>>>
>>>
>>
> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> fop-user-unsubscribe@xml.apache.org
>>> For additional commands, e-mail:
>>> fop-user-help@xml.apache.org
>>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Small Business $15K Web Design Giveaway
>> http://promotions.yahoo.com/design_giveaway/
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> fop-user-unsubscribe@xml.apache.org
>> For additional commands, e-mail:
>> fop-user-help@xml.apache.org
>>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Jeremias,

Still stuch by the issue of empty image url. Before I
pass the value of GetByteStreamServletURL to XSL, I
printed it
out(http://localhost:9080/MaxTradDownload/GetByteStream?guid=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B62F3F11E27D&ImageFormat=pdf&ImageSource=localhost).
It looks fine. However, my XSL file always got empty
string. Do you have any idea about it?

I also tried to use command line to test it under the
lib dir of my working directory, I got error:

java org.apache.xalan.xslt.Process -IN DummyXML.xml
-XSL Tiff2Pdf.xsl -OUT T
iff2Pdf.fo  -PARAM image
http://localhost:9080/MaxTradDownload/GetByteStream?gui
d=6486EDDFADDF7B7B8940B3159706C919D8DB0878B0F8EF60D59F34FC293306C1B179B62F3F11E2
7D&ImageFormat=pdf&ImageSource=localhost
Registry key 'Software\JavaSoft\Java Runtime
Environment\CurrentVersion'
has value '1.1', but '1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
'ImageFormat' is not recognized as an internal or
external command,
operable program or batch file.
'ImageSource' is not recognized as an internal or
external command,
operable program or batch file.

It tells me I need higher JRE version. I use WSAD 5.0.
I checked my JRE version, it is 1.3.1. I do not know
why. I ran this from the lib dir of my working
directory. I put xalan.jar, xml-apis.jar, and
xercesImpl.jar in my lib directory and also set up the
classpathes for them.

Is there any other way which can help me out why it
passed an empty string? Please help.

Jerry 



--- Jerry <je...@yahoo.com> wrote:
> Jeremias and Clay,
> 
> Thanks. I will work on the URL parameter first to
> check why it is empty even if I already set the
> value
> url as "http://...".
> 
> If I still have a problem, I will check the
> reference
> you gave  and use command line to test it.
> 
> thanks,
> 
> 
> Jerry 
> --- Jeremias Maerki <de...@greenmail.ch>
> wrote:
> > 
> > On 08.04.2004 16:37:04 Jerry wrote:
> > > Jeremias,
> > > 
> > > thanks a lot for your input.
> > 
> > You're welcome.
> > 
> > > 1.
> > > I set it into LEVEL_DEBUG and checked the
> console.
> > It
> > > looks like it is image url path setting's
> problem.
> > > What does that mean by "no base directory is
> > > specified"? 
> > 
> > The base directory is used to convert relative
> URLs
> > to absolute ones.
> > See
> >
>
http://xml.apache.org/fop/embedding.html#config-internal
> > 
> > Example:
> > Relative URL: images/myimage.tif
> > Base URL (or dir): http://localhost:8080/
> > Resulting URL:
> > http://localhost:8080/images/myimage.tif
> > 
> > > I am wondering if the way or syntax I use
> > > to set Image url vriable is right.
> > 
> > Your intentions were totally alright, it's just
> that
> > you set an empty
> > String as URL. See me previous mail further down.
> > Looks like you missed
> > my key comment.
> > 
> > > The detailed
> > > console info is as followed:
> > > 
> > > [INFO] building formatting object tree
> > > [DEBUG] setting up fonts [INFO] [1]
> > > [ERROR] Error while creating area : Error with
> > image
> > > URL:  (The system cannot find the path
> specified)
> > and
> > 
> > See the emptyness between "URL:" and "(The
> > system..."? No URL set.
> > 
> > > no base directory is specified
> > > [DEBUG] Last page-sequence produced 1 pages.
> > > [INFO] Parsing of document complete, stopping
> > renderer
> > > [DEBUG] Initial heap size: 30061Kb
> > > [DEBUG] Current heap size: 35273Kb
> > > [DEBUG] Total memory used: 5212Kb
> > > [DEBUG]   Memory use is indicative; no GC was
> > > performed
> > > [DEBUG]   These figures should not be used
> > > comparatively
> > > [DEBUG] Total time used: 741ms
> > > [DEBUG] Pages rendered: 1
> > > [DEBUG] Avg render time: 741ms/page
> > > 
> > > 2.
> > > > It also helps if you just do the XSLT
> > transformation
> > > > on the command line
> > > > (as I suggested earlier). By checking the
> > generated
> > > > FO afterwards you
> > > > can see if everything is alright.
> > > 
> > > Sorry I am not sure how to use XSLT to test it
> > from
> > > command line.
> > 
> > If you use Xalan-J as XSLT processor (default in
> JDK
> > 1.4 and later), see
> > here:
> > http://xml.apache.org/xalan-j/commandline.html
> > 
> > > 3.
> > > If I ran GetByteStream servlet, it can display
> the
> > > image in tiff format. You mentioned this servlet
> > > should write the TIFF file byte by byte to
> > > the Request's OutputStream. Can you take a look
> to
> > if
> > > I did right?
> > 
> > I already did last time. I snipped it out because
> it
> > looked good.
> > If you can download the TIFF via your browser then
> > everything's ok.
> > 
> > <snip what="GetByteStream servlet"/>
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > fop-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail:
> > fop-user-help@xml.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway 
> http://promotions.yahoo.com/design_giveaway/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Jeremias and Clay,

Thanks. I will work on the URL parameter first to
check why it is empty even if I already set the value
url as "http://...".

If I still have a problem, I will check the reference
you gave  and use command line to test it.

thanks,


Jerry 
--- Jeremias Maerki <de...@greenmail.ch> wrote:
> 
> On 08.04.2004 16:37:04 Jerry wrote:
> > Jeremias,
> > 
> > thanks a lot for your input.
> 
> You're welcome.
> 
> > 1.
> > I set it into LEVEL_DEBUG and checked the console.
> It
> > looks like it is image url path setting's problem.
> > What does that mean by "no base directory is
> > specified"? 
> 
> The base directory is used to convert relative URLs
> to absolute ones.
> See
>
http://xml.apache.org/fop/embedding.html#config-internal
> 
> Example:
> Relative URL: images/myimage.tif
> Base URL (or dir): http://localhost:8080/
> Resulting URL:
> http://localhost:8080/images/myimage.tif
> 
> > I am wondering if the way or syntax I use
> > to set Image url vriable is right.
> 
> Your intentions were totally alright, it's just that
> you set an empty
> String as URL. See me previous mail further down.
> Looks like you missed
> my key comment.
> 
> > The detailed
> > console info is as followed:
> > 
> > [INFO] building formatting object tree
> > [DEBUG] setting up fonts [INFO] [1]
> > [ERROR] Error while creating area : Error with
> image
> > URL:  (The system cannot find the path specified)
> and
> 
> See the emptyness between "URL:" and "(The
> system..."? No URL set.
> 
> > no base directory is specified
> > [DEBUG] Last page-sequence produced 1 pages.
> > [INFO] Parsing of document complete, stopping
> renderer
> > [DEBUG] Initial heap size: 30061Kb
> > [DEBUG] Current heap size: 35273Kb
> > [DEBUG] Total memory used: 5212Kb
> > [DEBUG]   Memory use is indicative; no GC was
> > performed
> > [DEBUG]   These figures should not be used
> > comparatively
> > [DEBUG] Total time used: 741ms
> > [DEBUG] Pages rendered: 1
> > [DEBUG] Avg render time: 741ms/page
> > 
> > 2.
> > > It also helps if you just do the XSLT
> transformation
> > > on the command line
> > > (as I suggested earlier). By checking the
> generated
> > > FO afterwards you
> > > can see if everything is alright.
> > 
> > Sorry I am not sure how to use XSLT to test it
> from
> > command line.
> 
> If you use Xalan-J as XSLT processor (default in JDK
> 1.4 and later), see
> here:
> http://xml.apache.org/xalan-j/commandline.html
> 
> > 3.
> > If I ran GetByteStream servlet, it can display the
> > image in tiff format. You mentioned this servlet
> > should write the TIFF file byte by byte to
> > the Request's OutputStream. Can you take a look to
> if
> > I did right?
> 
> I already did last time. I snipped it out because it
> looked good.
> If you can download the TIFF via your browser then
> everything's ok.
> 
> <snip what="GetByteStream servlet"/>
> 
> 
> Jeremias Maerki
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 08.04.2004 16:37:04 Jerry wrote:
> Jeremias,
> 
> thanks a lot for your input.

You're welcome.

> 1.
> I set it into LEVEL_DEBUG and checked the console. It
> looks like it is image url path setting's problem.
> What does that mean by "no base directory is
> specified"? 

The base directory is used to convert relative URLs to absolute ones.
See http://xml.apache.org/fop/embedding.html#config-internal

Example:
Relative URL: images/myimage.tif
Base URL (or dir): http://localhost:8080/
Resulting URL: http://localhost:8080/images/myimage.tif

> I am wondering if the way or syntax I use
> to set Image url vriable is right.

Your intentions were totally alright, it's just that you set an empty
String as URL. See me previous mail further down. Looks like you missed
my key comment.

> The detailed
> console info is as followed:
> 
> [INFO] building formatting object tree
> [DEBUG] setting up fonts [INFO] [1]
> [ERROR] Error while creating area : Error with image
> URL:  (The system cannot find the path specified) and

See the emptyness between "URL:" and "(The system..."? No URL set.

> no base directory is specified
> [DEBUG] Last page-sequence produced 1 pages.
> [INFO] Parsing of document complete, stopping renderer
> [DEBUG] Initial heap size: 30061Kb
> [DEBUG] Current heap size: 35273Kb
> [DEBUG] Total memory used: 5212Kb
> [DEBUG]   Memory use is indicative; no GC was
> performed
> [DEBUG]   These figures should not be used
> comparatively
> [DEBUG] Total time used: 741ms
> [DEBUG] Pages rendered: 1
> [DEBUG] Avg render time: 741ms/page
> 
> 2.
> > It also helps if you just do the XSLT transformation
> > on the command line
> > (as I suggested earlier). By checking the generated
> > FO afterwards you
> > can see if everything is alright.
> 
> Sorry I am not sure how to use XSLT to test it from
> command line.

If you use Xalan-J as XSLT processor (default in JDK 1.4 and later), see
here:
http://xml.apache.org/xalan-j/commandline.html

> 3.
> If I ran GetByteStream servlet, it can display the
> image in tiff format. You mentioned this servlet
> should write the TIFF file byte by byte to
> the Request's OutputStream. Can you take a look to if
> I did right?

I already did last time. I snipped it out because it looked good.
If you can download the TIFF via your browser then everything's ok.

<snip what="GetByteStream servlet"/>


Jeremias Maerki


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


Re: only display the text in XSL file but does not display the image

Posted by Clay Leeds <cl...@medata.com>.
On Apr 8, 2004, at 7:37 AM, Jerry wrote:
> 2.
>> It also helps if you just do the XSLT transformation
>> on the command line
>> (as I suggested earlier). By checking the generated
>> FO afterwards you
>> can see if everything is alright.
>
> Sorry I am not sure how to use XSLT to test it from
> command line.

Assuming you are using fop-0.20.5, xalan.bat (or xalan.sh on Un*x a.k.a 
'xalan' in this post) can be used to generate (and review!) the 
'intermediate' XSL-FO file. Running xalan with no arguments gives you 
the help you should need to run xalan properly.

Here's a boost:

./xalan.sh -IN [input.xml] -XSL [input.xsl] -OUT [output.fo]

(without any of the '[' and ']' of course!)

That should to it! Look at the 'output.fo' file, to 'see if everything 
is alright'... I don't know the answers to the other questions, but 
hopefully this answers *this* question.

Web Maestro Clay - cleeds@medata.com
-- 
Web Developer - Medata, Inc. - <http://www.medata.com/>
PGP Public Key: <https://mail.medata.com/pgp/cleeds.asc>


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


Re: only display the text in XSL file but does not display the image

Posted by Jerry <je...@yahoo.com>.
Jeremias,

thanks a lot for your input.

1.
I set it into LEVEL_DEBUG and checked the console. It
looks like it is image url path setting's problem.
What does that mean by "no base directory is
specified"?  I am wondering if the way or syntax I use
to set Image url vriable is right. The detailed
console info is as followed:

[INFO] building formatting object tree
[DEBUG] setting up fonts [INFO] [1]
[ERROR] Error while creating area : Error with image
URL:  (The system cannot find the path specified) and
no base directory is specified
[DEBUG] Last page-sequence produced 1 pages.
[INFO] Parsing of document complete, stopping renderer
[DEBUG] Initial heap size: 30061Kb
[DEBUG] Current heap size: 35273Kb
[DEBUG] Total memory used: 5212Kb
[DEBUG]   Memory use is indicative; no GC was
performed
[DEBUG]   These figures should not be used
comparatively
[DEBUG] Total time used: 741ms
[DEBUG] Pages rendered: 1
[DEBUG] Avg render time: 741ms/page

2.
> It also helps if you just do the XSLT transformation
> on the command line
> (as I suggested earlier). By checking the generated
> FO afterwards you
> can see if everything is alright.

Sorry I am not sure how to use XSLT to test it from
command line.

3.
If I ran GetByteStream servlet, it can display the
image in tiff format. You mentioned this servlet
should write the TIFF file byte by byte to
the Request's OutputStream. Can you take a look to if
I did right?

public class GetByteStream extends HttpServlet {
   ...
 private void sendBinaryResponse(HttpServletResponse
res,
                                  HttpServletRequest
req, byte[] bt,
                                  String
sContTypeHeader,
                                  String
sEncodingHeader, String encoding) {
                                  	
             	
  
    res.addHeader("Expires", "Wed, 26 Feb 1970
08:21:57 GMT");
    res.addHeader("Cache-Control", "no-cache");

    //set content type to image/tiff
    res.setContentType(sContTypeHeader);
    try {
      OutputStream out = null;
      	res.setContentType(sContTypeHeader);

      
              if (sEncodingHeader != null) {
          res.setHeader("Content-Encoding",
sEncodingHeader);
        }
        res.setContentLength(bt.length);
        out = res.getOutputStream();
          
        out.write(bt);
     
      out.flush();
      out.close();
    }
    catch (Throwable e) {}
  }

  ...

}




__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: only display the text in XSL file but does not display the image

Posted by Jeremias Maerki <de...@greenmail.ch>.
(comments inline)

On 08.04.2004 00:33:21 Jerry wrote:
> Jeremias and folks,
> 
> I rewrote my servlet and got a little progress even if
> it still cannot display the tiff data.
> 
> When I ran my servlet, from web browser, I can see the
> text(i.e. COPY ONLY etc) in PDF format. Those text are
> from my XSL file.  But it does not show the image. I
> ran my new servlet--GetByteStream seperately, it can
> display tiff image.  It seems like the byte stream
> which takes the binary data did not pass to XSL. 
> 
> I enclosed the codes here. Can you please tell me
> anything wrong with my codes?
> 
> Many thanks,
> 
> Jerry
> 
> //servlet to display tiff data in PDF format 
> public class DisplayImage extends HttpServlet {
>     ...
>    private void
> sendPDFBinaryResponse(HttpServletResponse
> res,HttpServletRequest req) throws IOException,
> ServletException{
>                          	
> 
> 		if (log == null) {
> 	        log = new
> ConsoleLogger(ConsoleLogger.LEVEL_WARN);
>             MessageHandler.setScreenLogger(log);

Set the log level to LEVEL_DEBUG so you get more hints about what's
wrong when you're having problems. And check the the output written to
the console by the servlet. If you had, you would surely have seen that
FOP complains about not having found the image.

It also helps if you just do the XSLT transformation on the command line
(as I suggested earlier). By checking the generated FO afterwards you
can see if everything is alright.

<snip reason="nothing wrong with these parts"/>

> //here is my XSL file
> <?xml version="1.0" encoding="utf-8"?>
> 
> <xsl:stylesheet version="1.1"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> exclude-result-prefixes="fo">
> 
> <xsl:template match="/">
> 
> 
> 	<fo:root font-family="Times Roman" font-size="12pt"
> text-align="center"
> xmlns:fo="http://www.w3.org/1999/XSL/Format">
> 
> 		<fo:layout-master-set>
>     	<fo:simple-page-master
>   margin-right="1.5cm"
>   margin-left="1.5cm"
>   margin-bottom="2cm"
>   margin-top="1cm"
>   page-width="21cm"
>   page-height="29.7cm"
>   master-name="left">
>       <fo:region-before extent="1cm"/>
>       <fo:region-body margin-top="1cm"/>
>       <fo:region-after extent="1.5cm"/>
>     </fo:simple-page-master>
> 
> </fo:layout-master-set>
> 
> <fo:page-sequence id="N2528" master-reference="left">
> 
> <fo:static-content flow-name="xsl-region-after">
>   <fo:block text-align-last="center" font-size="10pt">
>     <fo:page-number/>
>   </fo:block>
> </fo:static-content>
> 
> <fo:flow flow-name="xsl-region-body">
> <fo:block font-size="18pt" font-weight="bold">Copy
> Only</fo:block>
> <fo:block>
> 
>   <fo:block>
> 	<fo:external-graphic width="50pt" height="50pt"
> overflow="hidden" src="url('{@image}')"/>

This is wrong: Use {$image} instead because @image accesses the "image"
attribute of the context node, not the parameter.


>   </fo:block>
>   
>   
>   <fo:block font-size="16pt" font-weight="bold"
> space-before.minimum="1em"
> space-before.optimum="1.5em"
> space-before.maximum="2em"/>
>   This document is just Copy only, Non Negotiable
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
> 
> </fo:root>
> </xsl:template>
> 
> </xsl:stylesheet>



Jeremias Maerki


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