(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('[EMAIL PROTECTED]')"/>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]