Re: bit OT but..streaming PDF to browsers

2001-07-04 Thread David Frankson

I get pdfs from servlets to work fine in IE, but I never have overcome
the 2 hits per pdf.  Is there a solution to this?


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 7:31 PM
Subject: bit OT but..streaming PDF to browsers


> Hi all,
>  i have been pulling my hair out trying to get my nicely created PDFs
> from FOP to IE4/5.5. Has anyone out there managed to bytestream a PDF to
> any version of IE. I can get it to work but the browser makes 2-3 hits to
> the server (presumably some bad hack by Bill based on the Expires Http
> header that i am sending) it all works fine in Netscape/Mozilla. As i
> cannot server a file due to security i really don't know wot else to do.
> Any help much appreciated :-)
> BTW i am serving via servlets & JSP, setting the content type to
> 'application/pdf'.
>
> cheers
> Dave
>
>
> Streamlink Pty Ltd, Level 5, 33 York Street, Sydney  NSW 2000 Australia
>
> Ph: +61 2 8243 1200   Fax: +61 2 8243 1210   Web: www.streamlink.com.au
>
> ***
> This email and any attachments is confidential and is the intellectual
> property of Streamlink Pty Ltd. If you are not the intended recipient
> you cannot use, distribute or copy this message or attachments. If this
> is the case, please notify the sender by return email immediately and
> erase all copies of the message and attachments, Thank you.
> ***
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: bit OT but..streaming PDF to browsers

2001-07-05 Thread David Frankson

Check the Microsoft Knowledge base for Article ID: Q293336   It explains the
idiotic way IE handles MIME types.

Dave


- Original Message -
From: "Alex McLintock" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 05, 2001 9:07 AM
Subject: Re: bit OT but..streaming PDF to browsers


> --- Dave Frankson <[EMAIL PROTECTED]> wrote:
> > PDFs from a servlet works in all broswers but you have to remember to do
all
> > of the following:
> >
> >
> > 1.)  Set the headers:
> >
> >response.setContentType("application/pdf");
> >response.addHeader("Content-Disposition", "inline;
filename=report.pdf");
> >
>
> Your other suggestions I've heard of before - but haven't noticed this
one.
> Does it really work? What browsers support "Content-Disposition" ?
> Where can I find out more?
>
> Presumably I ought to add it to the FAQ.
>
> Cheers
>
> Alex
>
>
> =
> Alex McLintock[EMAIL PROTECTED]Open Source Consultancy in London
> OpenWeb Analysts Ltd, http://www.OWAL.co.uk/
> DR WHO COMPETITION:
http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104
> Get Your XML T-Shirt  at http://www.inversity.co.uk/
>
> 
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: FOP Servlets being invoked twice

2001-08-08 Thread David Frankson

As far as I know, IE has always done 2 requests per mime type that it
doesn't handle internally.  See Article ID: Q293336 in the M$ knowledge
base.  Netscape and all others only do 1 request.  If anyone knows a
configuration that can get IE to behave, please let me know


I do suggest adding

response.addHeader("Content-Disposition", "inline; filename=report.pdf");

it will fix some glitches in IE5.0,  and also have you considered using a
Dom  Document rather than a string to pass your xml around?  It would save
you from having to parse it twice when you go from your business object to
Xalan, and from Xalan to FOP.

Dave


- Original Message -
From: "Alex Amies" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Tim Kearney" <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 11:15 AM
Subject: FOP Servlets being invoked twice


> I have a problem with a servlet, which serves up pdf documents,
> invoking the servlet twice for every time I request the
> url using my browser.  The pdf document is produced
> correctly in both instances.  Anybody else seen this
> problem, know what it is, or have a constructive suggestion?
>
> The servlet gets data from a database, formats into xml,
> transforms it with Xalan, then again to a pdf, sending
> the content to a byte array where it is then written to
> the output stream.  Here is a code fragment:
>
> Writer writer = new StringWriter();
>
> // Get an xslt processor factory
> TransformerFactory tFactory = TransformerFactory.newInstance();
>
> // Create the 3 objects the XSLTProcessor needs to perform the
> transformation.
> ReportInfo reportInfo = getReportData(request,res);
> String xml = reportInfo.getXml();
> StringReader stringReader = new StringReader(xml);
> Source xmlSource  = new StreamSource(stringReader);
> Source xslSheet   = getXSLInput(reportInfo.getReportNo());
> StreamResult xmlResult = new StreamResult(writer);
>
> Transformer transformer = tFactory.newTransformer(xslSheet);
>
> // Perform the transformation.
> transformer.transform(xmlSource, xmlResult);
>
> // send output from xsl transformation to a string reader
> // create a input source containing the xsl:fo file which can be fed to
> Fop
> Reader reader = new StringReader(writer.toString());
> writer.flush();
> writer.close();
>
> //set Driver methods to start Fop processing
> Driver driver = new Driver();
>
> driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",".14");
> driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
> driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
> driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");
> driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");
>
> // send pdf writer output to a byte array stream
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> PrintWriter printWriter = new PrintWriter(baos);
> driver.setWriter(printWriter);
> driver.buildFOTree(parser, new InputSource(reader));
> driver.format();
> driver.render();
>
> // send the bytes out to the servlet output stream
> res.setContentType("application/pdf");
> res.setContentLength(baos.size());
>
> long sixty = System.currentTimeMillis() + 60*1000;
> res.setDateHeader("Expires", sixty);
> baos.writeTo(res.getOutputStream());
> res.flushBuffer();
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




FOP performance enhancement

2001-10-05 Thread David Frankson

I've been following the progress of FOP since .15 and I'd like to say
that I really appreciate all the work everyone puts in.  My company produces
student administration software for k-12 schools and open-source projects
are the ideal way to put great technology in the hands of under-funded
school districts.

We currently use FOP in a servlet environment for doing pdf reporting (1 to
20 pages).  The memory consumption is a bit high, but we have had great
sucess and stability with our current usage.

Our IDEAL dream is to be able to batch print report cards and parent letters
using this technology.  This would involve taking the same simple fo
document and applying it 500-3000 times, depending on the number of
students.  We don't use anything fancy like page counting, or references to
other parts of the document.  As far as I can see, it should be possible to
format, render and stream out each page as it's completed. (Although this
probably breaks other aspects of the FO spec.)  If I am able to produce
documents like this in the near future, it will lock in Fop as a core part
of our technology architecture.

Is there any way to optimize my fo documents to make this possible?  I
remember seeing some benchmarks reaching thousands of pages by Mark
Lillywhite, but unfortunately my documents were unable to take advantage of
those enhancements.

Is anyone else currently working on something like this?

Thanks,

Dave Frankson



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: servlet called thrice on IE 4.0

2001-11-20 Thread David Frankson

It is a behavior that is unavoidable in IE.  I cache the pdf and return
it on the second hit.

Dave


- Original Message -
From: "Savino, Matt C" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 11:09 AM
Subject: servlet called thrice on IE 4.0


> I know this has been discussed here before, but I just wanted to ask in
case
> anyone has discovered a solution. Basically I'm etting that problem where
IE
> is calling the FOP servelt twice. Only on Weblogic, the second call seems
to
> be causing a socket error. The net result is that the servelt has to be
> called three times to actually work (I've pasted the output below). I've
> verified that IE 4.72 and beyond don't see this problem. Just wondering if
> anyone ever found a fix.
>
> Thanks a lot,
> Matt
>
>
> Below is the output from ONE call to
> http://localhost:7001/resultview/ReportGenerator.jsp?counter=25  (the
> 'counter=' piece is put in to avoid IE-early-version caching problem):
>
>
> servlet: session ID =
>
O1qHKkV5IXQWz0y11xfOSj8vbLdv3Uzl9lVf5mSDqcEHTJtX7mca!-2004853107!-1675706787
> !7001!7002!1006274346312
> ReportGeneratorServlet says hiTue Nov 20 09:09:49 PST 2001
> srd.contentType = pdf
> srd.reportId = 1001
> reportProps.getProperty(report1001) = lr
> Writing XML source to: C:\bea\wlserver6.1\ReportOutput.xml
>
> Writing FO source to: C:\bea\wlserver6.1\ReportOutput.xml
>
> building formatting object tree
> setting up fonts
>  [1] [2]
> Parsing of document complete, stopping renderer
> Initial heap size: 45687Kb
> Current heap size: 52679Kb
> Total memory used: 6991Kb
>   Memory use is indicative; no GC was performed
>   These figures should not be used comparatively
> Total time used: 1688ms
> Pages rendererd: 2
> Avg render time: 844ms/page
> servlet: session ID =
>
O1qHKkV5IXQWz0y11xfOSj8vbLdv3Uzl9lVf5mSDqcEHTJtX7mca!-2004853107!-1675706787
> !7001!7002!1006274346312
> ReportGeneratorServlet says hiTue Nov 20 09:09:51 PST 2001
> srd.contentType = pdf
> srd.reportId = 1001
> reportProps.getProperty(report1001) = lr
> Writing XML source to: C:\bea\wlserver6.1\ReportOutput.xml
>
> Writing FO source to: C:\bea\wlserver6.1\ReportOutput.xml
>
> building formatting object tree
> setting up fonts
>  [1] [2]
> Parsing of document complete, stopping renderer
> Initial heap size: 53805Kb
> Current heap size: 61054Kb
> Total memory used: 7249Kb
>   Memory use is indicative; no GC was performed
>   These figures should not be used comparatively
> Total time used: 1563ms
> Pages rendererd: 2
> Avg render time: 781ms/page
>   
> <[WebAppServletContext(1024240,RVWebApp1,/RVWebApp1)] Root cause of
> ServletException
> java.net.SocketException: Connection aborted by peer: socket write error
> at java.net.SocketOutputStream.socketWrite(Native Method)
> at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
> at
>
weblogic.servlet.internal.ChunkUtils.writeChunkNoTransfer(ChunkUtils.java:20
> 2)
> at
> weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:167)
> at
weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:248)
> at
> weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:306)
> at
weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:197)
> at
>
weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:1
> 25)
> at
>
weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamI
> mpl.java:155)
> at java.io.OutputStream.write(OutputStream.java:61)
> at
>
com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet.
> renderPdf(ReportGeneratorServlet.java:171)
> at
>
com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet.
> renderReport(ReportGeneratorServlet.java:120)
> at
>
com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet.
> service(ReportGeneratorServlet.java:67)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :265)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :200)
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
> ntext.java:2456)
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
> :2039)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >
> servlet: session ID =
>
O1qHKkV5IXQWz0y11xfOSj8vbLdv3Uzl9lVf5mSDqcEHTJtX7mca!-2004853107!-1675706787
> !7001!7002!1006274346312
> ReportGeneratorServlet says hiTue Nov 20 09:09:53 PST 2001
> srd.contentType = pdf
> srd.reportId = 1001
> reportProps.getProperty(report1001) = lr
> Writing XML source to: C:\bea\wlserver6.1\ReportOutput.xml
>
> Writing FO source to: C:\bea\wlserver

Re: Embedding examples (or tutorial) and new directory structure

2003-02-17 Thread David Frankson
http://xml.apache.org/fop/embedding.html lists 6 different examples of
embedding fop.

Where do I find these example files?  I can't find them in any of the
distributions.

Dave

- Original Message -
From: "Jeremias Maerki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 11, 2003 3:15 PM
Subject: Embedding examples (or tutorial) and new directory structure


Hi there

I've committed my first set set of embedding examples to the branch. I
decided not to call it a tutorial, because that's not what it is. The
intentions have stayed the same since the annoucement, though.

I intend to add the documentation for the above in the next couple of
days. Is that ok, if I just add that to the bottom of embedding.html? It
won't be much anyway.

I placed the new files in the newly created examples directory in
accordance to what we discussed around december 1st. I will relocate the
contrib stuff and the fo examples to this directory, too. I decided not
to hack away at the server side CVS directories. Too much headache
included. I'll just copy, commit, delete.

I'd like to get rid of the docs directory in the end. I think there's
still the -1 from Oleg concerning the src/foschema. How do we resolve
that? We've got:
1. src/foschema (my proposal, +1 from Keiron and Jörg)
2. src/documentation/test/foschema (Oleg's preferred location. Did I get
you right on this?)

I would also like to get src/org to src/java/org. I think it's ok to
lose history on the contrib and docs stuff when relocating. But that's
not so easy with the Java sources. I'm not going to do CVS surgery. Do
we have a volunteer? Pleeease? :-)

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




fop w/ svg HUGE pdf file sizes

2003-08-28 Thread David Frankson
I am running fop 0.20.5 w/ the included batik to create a pdf that is
about 6 pages of simple graphs.  The 6 page pdf is 6.7 megs in size!

Here is a sample of the output:
http://65.121.2.203/school1.pdf

Is there some kind of pdf file size optimization I haven't turned on?  Or a
design technique that will shrink this down?

I have a deadline about to hit and I need to have a couple thousand
pre-generated pdfs downloadable over the internet.  6 megs is just too big.
I'd appreciate a little help, otherwise I have to scrap this and start over.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: fop w/ svg HUGE pdf file sizes

2003-08-28 Thread David Frankson
To answer my own question:

org.apache.fop.configuration.Configuration.put("strokeSVGText","false");

took the size down to 70-90k.

I'm not used to having such useful information on the fop website :-)  Back
in pre 0.20 days we needed to dig through source code to figure out what
options existed :-)

Dave


- Original Message ----- 
From: "David Frankson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 28, 2003 2:26 PM
Subject: fop w/ svg HUGE pdf file sizes


> I am running fop 0.20.5 w/ the included batik to create a pdf that is
> about 6 pages of simple graphs.  The 6 page pdf is 6.7 megs in size!
>
> Here is a sample of the output:
> http://65.121.2.203/school1.pdf
>
> Is there some kind of pdf file size optimization I haven't turned on?  Or
a
> design technique that will shrink this down?
>
> I have a deadline about to hit and I need to have a couple thousand
> pre-generated pdfs downloadable over the internet.  6 megs is just too
big.
> I'd appreciate a little help, otherwise I have to scrap this and start
over.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Shrink oversized pages to paper size

2002-05-02 Thread David Frankson

I have a fo document for printing mailing labels and positioning on the
printed document needs to be exact.  FOP generates a perfectly spaced PDF
document, but when I print it, Acrobat scales it down a bit and throws the
whole thing off.  Digging around I found that unchecking "Shrink oversized
pages to paper size" makes it print exactly what I want, but "Shink" is
checked by default and all users would need to remember to uncheck it before
printing.

My page was defined with a .5in top and bottom margin and a .1875in
left/right margin, and I experimented with the margins to try to keep it
from shrinking, but had no luck.  No matter how large I make the margins, it
still shrinks it.

Is there something in a FOP PDF that tells Acrobat that there is content in
the full 8.5x11space and it needs to be scaled down?  Is there any way to
prevent the automatic shrink?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Shrink oversized pages to paper size

2002-05-02 Thread David Frankson



    I have a fo document for 
printing mailing labels and positioning on the printed document needs to be 
exact.  FOP generates a perfectly spaced PDF document, but when I print it, 
Acrobat scales it down a bit and throws the whole thing off.  Digging 
around I found that unchecking "Shrink oversized pages to paper size" makes it 
print exactly what I want, but "Shink" is checked by default and all users would 
need to remember to uncheck it before printing.
 
My page was defined with a .5in top and bottom 
margin and a .1875in left/right margin, and I experimented with the margins to 
try to keep it from shrinking, but had no luck.  No matter how large I make 
the margins, it still shrinks it.
 
Is there something in a FOP PDF that tells Acrobat 
that there is content in the full 8.5x11space and it needs to be scaled 
down?  Is there any way to prevent the automatic shrink?
 
Dave