RE: fop build questions...newbie.
jdk 1.3 worked...thanks. I was able to rebuild fop.jar and it reflected changes made in driver.java will -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:49 PM To: [EMAIL PROTECTED] Subject: Re: fop build questions...newbie. Carter, Will wrote: 1. I just downloaded fop-0.20.3-src.tar.gz and unzipped it into a dir called c:\fopsrc. 2. When I execute build.bat at my command line, it starts chugging away but then gets the following compiling error. [javac] Compiling 720 source files to C:\fopsrc\fop-0.20.3\build\classes [javac] C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\render\awt\AWTFontMetrics.java :287: No variable TRUETYPE_FONT defined in class java.awt.Font. [javac] cashedFont = Font.createFont(Font.TRUETYPE_FONT,fontStream); [javac] ^ [javac] Note: C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\tools\anttasks\CompileXMLFiles .java uses or overrides a deprecated API. Recompile with -deprecation for details. [javac] 1 error, 1 warning BUILD FAILED C:\fopsrc\fop-0.20.3\build.xml:589: Compile failed, messages should have been provided. Total time: 3 minutes 13 seconds 3. Why do I get this error? Which jdk version are you using? That is probably the old one, try 1.3. 4. Does this build.bat recompile all the java files that are part of the fop application to make a new fop.jar? Yes, it's supposed to create fop.jar in build directory. 5. Say if I edit Driver.java and want to see the results of changes, I would run this build.bat to recompile and get a fop.jar that reflects changes? Right and don't edit java sources in build/src directory - they are copied from src directory during build process. 6. Should this question be in the developer listserv instead? They say fop-dev list is indented for the fop developers, not for developers dealing with fop :), so the answer depends on what are you trying to achieve - or just customize fop for you own needs or to patch it or to improve somehow. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: White space between table-rows. HOW?
you could just add a spacer row between your dynamic rows... fo:table-row fo:table-cell fo:block padding=5pt/fo:block /fo:table-cell fo:table-cell fo:block padding=5pt/fo:block /fo:table-cell /fo:table-row will -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 13, 2002 4:28 AM To: [EMAIL PROTECTED] Subject: RE: White space between table-rows. HOW? this may help you.. fo:table-row . fo:block color=whitespace/fo:block fo:block color=whitespace/fo:block /fo:table-row -Original Message- From: Hahn Kurt (CHA) [mailto:[EMAIL PROTECTED] Sent: Thursday, June 13, 2002 1:14 PM To: '[EMAIL PROTECTED]' Subject: TR: White space between table-rows. HOW? I still haven't figured out how I can insert space between table-rows. I would like to have a property that applies on a table-row. The various padding properties didn't seem to produce any effect, no matter what values I gave. One temporary solution I'm using is to specify the height of the row, but I need to achieve that dynamically, since not every table-row will have the same height. Thx Kurt -Message d'origine- De : J.Pietschmann [mailto:[EMAIL PROTECTED] Envoyé : jeudi, 6. juin 2002 01:09 À : [EMAIL PROTECTED] Objet : Re: White space between table-rows. HOW? Hahn Kurt (CHA) wrote: Below is a code sample from a table I'm displaying. I need to have some space between 2 rows, in order to separate them visually. I tried a number of things, especially the various padding-properties but also other things, but no clue so far. The only thing that worked (a little, not really well), was to add an empty row, or to fix the row-heigth, but that's not dynamic, so it isn't really that... You can use space-before=... on the elements each table cell in the row following the space, like fo:table-row height=35pt font-weight=bold font-size=12pt fo:table-cell text-align=center number-columns-spanned=4 fo:blockLe procès-verbal de la session du 24 et 25 janvier 2002 est adopté. /fo:block /fo:table-cell /fo:table-row fo:table-row height=35pt font-weight=bold font-size=12pt fo:table-cell fo:block space-before=30pt4/fo:block /fo:table-cell fo:table-cell text-align=left number-columns-spanned=4 fo:block space-before=30ptDISCUSSIONS ET APPROBATION DE L'ORDRE DU JOUR/fo:block /fo:table-cell /fo:table-row fo:table-row J.Pietschmann This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
embedded fop...show progress?
Hi, I am using fop in a servlet. Has anyone ever come up with a way to report back to the browser where it's at in the converting process from an fo file to a to pdf? when I run fop at my command line in debug mode, it reports along the way when a page is completes. Anybody know how I could get that info when fop is running in a servlet? just wondering... will
RE: xalan-2.0.0.jar and xerces-1.2.3.jar in classpath not working ...
thanks for the response... I have doublechecked my classpath and am certain that these are the only jars it picks up: these files are in my only classpath (C:\Program Files\Allaire\JRun\servers\lib): ant.jar (289k 3/2/2002) avalon-framework-4.0.jar (35k3/2/2002) batik.jar (1896k 3/2/2002) fop.jar (1806k 3/2/2002) logkit-1.0.jar(69k3/2/2002) xalanj1compat.jar (37k3/2/2002) if I put these to files in the above classpath, my servlet doesn't work. xerces-1.2.3.jar (749k 3/2/2002) xalan-2.0.0.jar (687k 3/2/2002) but if I put these 2 in my C:\jdk1.3.1_02\jre\lib\ext folder, the servlet does. I think this message speaks to my problem. http://www.opencms.org/majordomo/opencms-dev/0107/msg00020.html excerpt from above message -- I have Cocoon (see: xml.apache.org) running on this W2000 system. For this to work, I had to tackle the parser problem, i.e. replace the JRUN parser with Xerces. I followed the instructions specific for Cocoon on the Allaire website. Since Cocoon is running now, I am confident that I solved this problem (There were some emails on this list dealing with this same problem). I also passed the famous step 6 in the installation procedure. end excerpt from above message -- At present, I can't find the directions to replace the JRUN parser with Xerces. Do you all think I am barking up the wrong tree with this solution? thanks, will -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 11:59 AM To: [EMAIL PROTECTED] Subject: Re: xalan-2.0.0.jar and xerces-1.2.3.jar in classpath not working... Carter, Will wrote: Hi, I am running fop in a servlet with jrun 3.1 as the servlet container. the only way I can get it to work is if I put xalan-2.0.0.jar and xerces-1.2.3.jar into my jdk/jre/lib/ext folder. I have all the other fop jars in my WEB-INF/lib folder. as long as I have xalan-2.0.0.jar and xerces-1.2.3.jar in the jdk/jre/lib/ext folder my servlet works, but if I move these to to the WEB-INF/lib it doesn't and I get this error: 500 Internal Server Error /servlet/FotoPDF: null java.lang.NoSuchMethodError at org.apache.fop.svg.SVGElement.init(SVGElement.java:199) That sounds very bizarre to me, but I guess it has something to do with batik.jar. Chances are you have another (old?) batik (or another svg lib?) somewhere in the classpath. -- Oleg Tkachenko Multiconn International, Israel
RE: xalan-2.0.0.jar and xerces-1.2.3.jar in classpath not working ...
yes, this is the solution. I have replaced jaxp.jar and parser.jar with xalan.jar and xerces.jar and it worked. thank you very much. will -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 1:55 PM To: [EMAIL PROTECTED] Subject: Re: xalan-2.0.0.jar and xerces-1.2.3.jar in classpath not working ... Hello! Yes, that's probably the case. Well, it seems to me, JRun 3.1 uses rather old xml parser and xslt processor by default, (like websphere 3.5 does, btw), so you have to upgrade them (see http://www.macromedia.com/v1/Handlers/index.cfm?ID=22729Method=Full) or override them by adding new versions in %JAVA_HOME%\jre\lib\ext directory, what you have done successfully. Carter, Will wrote: thanks for the response... I have doublechecked my classpath and am certain that these are the only jars it picks up: these files are in my only classpath (C:\Program Files\Allaire\JRun\servers\lib): ant.jar (289k 3/2/2002) avalon-framework-4.0.jar (35k3/2/2002) batik.jar (1896k 3/2/2002) fop.jar (1806k 3/2/2002) logkit-1.0.jar(69k3/2/2002) xalanj1compat.jar (37k3/2/2002) if I put these to files in the above classpath, my servlet doesn't work. xerces-1.2.3.jar (749k 3/2/2002) xalan-2.0.0.jar (687k 3/2/2002) but if I put these 2 in my C:\jdk1.3.1_02\jre\lib\ext folder, the servlet does. I think this message speaks to my problem. http://www.opencms.org/majordomo/opencms-dev/0107/msg00020.html excerpt from above message -- I have Cocoon (see: xml.apache.org) running on this W2000 system. For this to work, I had to tackle the parser problem, i.e. replace the JRUN parser with Xerces. I followed the instructions specific for Cocoon on the Allaire website. Since Cocoon is running now, I am confident that I solved this problem (There were some emails on this list dealing with this same problem). I also passed the famous step 6 in the installation procedure. end excerpt from above message -- At present, I can't find the directions to replace the JRUN parser with Xerces. Do you all think I am barking up the wrong tree with this solution? thanks, will -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 11:59 AM To: [EMAIL PROTECTED] Subject: Re: xalan-2.0.0.jar and xerces-1.2.3.jar in classpath not working... Carter, Will wrote: Hi, I am running fop in a servlet with jrun 3.1 as the servlet container. the only way I can get it to work is if I put xalan-2.0.0.jar and xerces-1.2.3.jar into my jdk/jre/lib/ext folder. I have all the other fop jars in my WEB-INF/lib folder. as long as I have xalan-2.0.0.jar and xerces-1.2.3.jar in the jdk/jre/lib/ext folder my servlet works, but if I move these to to the WEB-INF/lib it doesn't and I get this error: 500 Internal Server Error /servlet/FotoPDF: null java.lang.NoSuchMethodError at org.apache.fop.svg.SVGElement.init(SVGElement.java:199) That sounds very bizarre to me, but I guess it has something to do with batik.jar. Chances are you have another (old?) batik (or another svg lib?) somewhere in the classpath. -- Oleg Tkachenko Multiconn International, Israel
stress test FOP in a servlet?
What is the best way to stress test fop in a servlet find out how many users it would take to produce out of memory errors? is there an easy way to send multiple concurrent requests to a servlet? thanks, will
RE: Why is FO(P) a superior model than what most proprietary tool s propose
how do you get the server to queue other requests? will -Original Message- From: Scott Moore [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 4:29 PM To: '[EMAIL PROTECTED]' Subject: RE: Why is FO(P) a superior model than what most proprietary tool s propose The short answer is you can't expect a large number of users to ask for reports at the same time and not run into memory problems. Believe me, I've stress tested my report server and hit this wall quickly. However, if you write your server to only run X number of reports at once and queue any other requests until other reports are finished, you can avoid those problems and achieve a robust and stable FOP server. At that point, adding more servers can get you better scalability. So far, this has worked well for me. -Original Message- From: Carter, Will [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 5:29 PM To: '[EMAIL PROTECTED]' Subject: RE: Why is FO(P) a superior model than what most proprietary tool s propose This one has got me scared... I am in the process of working out an embedded (servlet) FOP solution for some financial reporting. The generated pdfs are probably around 20 pages.. does anyone have any info about memory requirements or problems I will run into with multiple concurrent users?
RE: Why is FO(P) a superior model than what most proprietary tool s propose
This one has got me scared... I am in the process of working out an embedded (servlet) FOP solution for some financial reporting. The generated pdfs are probably around 20 pages.. does anyone have any info about memory requirements or problems I will run into with multiple concurrent users? thanks, will carter http://www.envestnetpmc.com -Original Message- From: Savino, Matt C [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 4:01 PM To: '[EMAIL PROTECTED]' Subject: RE: Why is FO(P) a superior model than what most proprietary tool s propose We're using FOP in a production environment to render some management reports and a very complicated lab report. We've had to limit the management reports to about 2000 rows (~50 page PDF) because of FOP's memory issues w/large PDFs. Also I worry about serious slowdown if we ever get 3 or 4 users on the same instance of the app server all running a decent sized PDF at once. Does anyone know if wrapping FOP in a session bean would allow me to distribute processing around to unused servers or otherwise handle the java.lang.outOfMemoryError better? (We're on Weblogic 6.1) I compared FOP to RenderX from XEP. RenderX was the only solution that really mathces FOP's profile (XSL:FO based, java-based or at least platform neutral, no extra servers to run or programs to install - if there are any more out there, please post). For the report I was running, FOP was about 10 times faster than RenderX. But from most accounts performance between the two should similar. I figure there must be something particular about my stylesheet that RenderX didn't like. So I called XEP to see what kind of support my interest in purchasing their $5k/cpu product might garner. They weren't very helpful but did say they were insanely busy. I have a feeling if you could come up with a high-performing commerical all Java FO-PDF engine, you'd be very rich very quick. Matt Savino
RE: Why is FO(P) a superior model than what most proprietary tool s propose
this is interesting... can the servlet report how many threads it has at any given time? Do you know of any code examples of how this is done? thanks for the good idea... will -Original Message- From: Scott Moore [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 4:39 PM To: '[EMAIL PROTECTED]' Subject: RE: Why is FO(P) a superior model than what most proprietary tool s propose Each request comes into the servlet on a separate Java Thread. I keep track of the number of reports currently being generated and Thread.sleep(1000) the queued threads. Every second or so the threads wake up, check to see if they should run (next in line and # reports running MAX) otherwise they go back to sleep for another second. It's a little more complicated than that, but that's the general gist. Scott -Original Message- From: Savino, Matt C [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 5:39 PM To: '[EMAIL PROTECTED]' Subject: RE: Why is FO(P) a superior model than what most proprietary tool s propose Thanks Scott. Can you share a little more detail on how you queue the reports? Matt Savino
support for PS printer-specific options using PPDs
I currently use PJ for PDF output from a homegrown customer/member management system, built on JBoss/Postgresql/etc. There are two basic uses for the PDF output: 1) letters that use standard fonts to produce a mail merged PDF form letter - starting with a blank PDF document and text grabbed from client database 2) forms that fill in PDF form template with fields from client database - this was accomplished using jakarta-ORO and string substitution - we use several fonts, including a barcode font, on the writable areas of these forms. I'm thinking of moving to iText or FOP for #1, but there's one particular problem that I can't seem to solve. When the client prints letters, they always want the first page to print on letterhead paper and the second and following pages to print on plain paper. With PS, you have the ability to set printer-specific options like paper-tray/type, but PDF doesn't have this capability as far as I know (I've read both specs pretty carefully). Unfortunately, it's not a clean switch trays every page situation, because some letters end up 3 pages rather than 2 (longer address, extra paragraph, etc.). So there's no way to render PDF ---ghostscript-PS, adding change trays every page to the PS at the end. In other words, I have to add the use tray x flag at the time of rendering, which means I must render to PS rather than PDF. Ideally, I would be able to use FOP and grab the proper use tray x flag from the PPD for the HP printer I'm using - I've even looked at a Canon machine called the imageRunner 5000 that allows you to set flags for switching trays, stapling, and folding (which would be nice for 1000+ person mailings). From checking the main fop page and the fop-dev archive, it seems that PS output in general, and any PPD capability specifically, is pretty far off. From what I can tell, renderX doesn't have PPD features either. Does anyone have any other ideas? Nathan
Re: support for PS printer-specific options using PPDs
Jeremias, Thanks for your thoughtful response. Jeremias Maerki wrote: Being the one who wrote the PS renderer in the first place, I can comment on a few things: - The PS renderer, as it is now, is more of a proof of concept, than anything else. Some people are using it productively, though. - As you gathered, there are a few things that still need to be done. Here's the todo list from the PSRenderer's javadocs: Character size/spacing, configuration, move to PrintRenderer, maybe improve filters (I'm not very proud of them), add a RunLengthEncode filter (useful for Level 2 Postscript), Improve DocumentProcessColors stuff (probably needs to be configurable, then maybe add a color to grayscale conversion for bitmaps to make output smaller (See PCLRenderer), font embedding, support different character encodings, try to implement image transparency, positioning of images is wrong etc. And of course, there's the missing PPD functionality. I'll spend some time looking at the code today or tomorrow - I'm assuming that I should look in CVS, and that there is not any wholesale rewrite of at least the PS renderer portion going on outside of CVS (I saw some confusion about outside of CVS rewrites on the fop-dev list). - There's also another problem: XSL:FO does not provide any means to specify things like tray selection. These will have to be proprietary solutions. And that means some work as well. What's important here is to have mechanisms that can be reused for PCL later. Hmm. I was thinking this morning that it would be ideal to make it fully configurable by the client, so that I'm not changing code every time they buy a new printer. What would be ideal is to have some sort of web-based strict equivalent to GPR (http://www.compumetric.com/linux.html ) or XPP ( http://cups.sourceforge.net/xpp/ ) that would allow me to set paper tray, stapling, and folding on a per-document (per-letter) level. Is there a PCL equivalent of PPD, or would this have to be built separately for PS and PCL? (Uggh - this is beginning to sound like a big project). At present, we're using PJ to concatenate PDF documents (so that the client can print out hundreds of letters in one print job, a critical usability feature). With the system from the preceding paragraph in place, I could just concatenate PostScript letter that had already been generated with the proper tray/staple/fold settings (which may or may not work very well given our experience below). [[Side Note: At present, we're having plenty of problems using PJ to concatenate PDF document. In addition to the letters and forms PDF documents mentioned in my original posting, there are two sources of PDF documents that we sometimes integrate into the print stream - 1) a document scanning system that produces TIFF, that we then convert to PDF using ImageMagick/Ghostscript 2) Word documents that we convert to PDF using Abiword ( http://www.abiword.org ) and Ghostscript. We've determined that the concatenation problems are from poor conversion of Word--PDF, so we're hoping to move to OpenOffice or activePDF for this conversion in the not-too-distanct future ]] - Conclusion: Any help is welcome! (Because I haven't got the time yet, to do it. At least, it's on my todo list, because we're currently working with the PDF renderer, then using Acrobat Reader to produce PostScript, which is finally patched with code for tray selection and OMR marks. And this is a suboptimal solution especially since the Acrobat Reader takes between 20 to 50 percent of processing time for a job.) This is something you're doing for a client/production system? Is there any way I could look at the code for tray selection and OMR marks that you mention? I'm in New York, not a competitor next door in Germany :) ( the gmx email is probably confusing). Many thanks for your thoughts - feel free to move this discussion to fop-dev if needed (copying me since I'm not currently subscribed there). Nathan On 25.04.2002 09:03:41 Nathan Carter wrote: I currently use PJ for PDF output from a homegrown customer/member management system, built on JBoss/Postgresql/etc. There are two basic uses for the PDF output: 1) letters that use standard fonts to produce a mail merged PDF form letter - starting with a blank PDF document and text grabbed from client database 2) forms that fill in PDF form template with fields from client database - this was accomplished using jakarta-ORO and string substitution - we use several fonts, including a barcode font, on the writable areas of these forms. I'm thinking of moving to iText or FOP for #1, but there's one particular problem that I can't seem to solve. When the client prints letters, they always want the first page to print on letterhead paper and the second and following pages to print on plain paper. With PS, you have the ability to set printer-specific options like paper-tray/type, but PDF doesn't
Re: tiff to pdf: getting empty pdf-focument
Andre, I'm new to Fop, but I've used ImageMagick/Ghostscript for this purpose and gotten quite good results, especially with PDF compression enabled (I'm assuming that you're talking about full-page TIFF -- PDF conversion). The convert module of ImageMagick is the one that you want. Nathan [EMAIL PROTECTED] wrote: hello all, I´m trying to convert a tiff to pdf. Fop(0.20.3 including Jimi) runs without any errors but the resulting pdf-document is empty. All other formats (gif,bmp etc) will succesfully rendered.. I tried this with many kinds of tiff-files: uncompressed, g3, g4 etc. But it always results in an empty pdf-document. So I thing it´s not a problem of the type. The line in the fo-file is: fo:external-graphic src=C:/Logo.tif/ But I think thats right. May be I have to change something more than the jimi-package-name in the source code? Has anyone an idea? thx for your regard. André
SVG external graphic doesn't show in FopServlet?
Hi, I am having problems with external svg files in my fo file when generating PDFs using FopServlet. I am using fop-0.20.3 specifically, I have these refs to external graphics in my fo file. This works: fo:block fo:external-graphic src= file:C:\Progra~1\Allaire\JRun\servers\default\default-app\WEB-INF\classes\g eneratedjpg.jpg/ /fo:block This doesn't workgeneratedsvg.svg is in the same directory as generatedjpg.jpg. the resulting pdf has a blank space where the svg should be. fo:block fo:external-graphic src=file:C:\Progra~1\Allaire\JRun\servers\default\default-app\WEB-INF\class es\generatedsvg.svg/ /fo:block This doesn't workgeneratedsvg.svg is in the same directory as generatedjpg.jpg. the resulting pdf has a blank space where the svg should be. fo:block fo:external-graphic src=file:///c:/Progra~1/Allaire/JRun/servers/default/default-app/WEB-INF/cl asses/generatedsvg.svg/ /fo:block any help would be greatly appreciated. Will Carter
RE: JPEG external graphic works, but SVG external graphic doesn't .
Hi and thanks for the help. I tried your suggestions but am still having problems. I have new.jpg in my c:\inetpub\wwwroot directory and it is accessible in my browser with: http://localhost/new.jpg I have new.svg in my c:\inetpub\wwwroot directory and it is accessible in my browser with: http://localhost/new.svg this JPG works in my fo file: fo:block fo:external-graphic src=http://localhost/new.jpg/ /fo:block this SVG doesn't: fo:block fo:external-graphic src=http://localhost/new.svg/ /fo:block if I try all these workarounds...I get a java error (see below) fo:instream-foreign-object image width=100 height=100 xsl:attribute name=xlink:hrefhttp://localhost/new.svg/xsl:attribute /image /fo:instream-foreign-object fo:instream-foreign-object image width=100 height=100 xsl:attribute name=xlink:hrefC:\inetpub\wwwroot\new.svg/xsl:attribute /image /fo:instream-foreign-object fo:instream-foreign-object image width=100 height=100 xsl:attribute name=xlink:hreffile:///c:/inetpub/wwwroot/new.svg/xsl:attribute /image /fo:instream-foreign-object if I substitute new.jpg for new.svg in the above examples it doesn't work either. I think I have the syntax wrong. What exactly should PathToImage.svg be? here is the java error I get in my browser based on the above tries... 500 Internal Server Error /servlet/FopServlet: null java.lang.AbstractMethodError at org.apache.fop.fo.XMLObj.addGraphic(XMLObj.java:51) at org.apache.fop.fo.XMLObj.addChild(XMLObj.java:126) at org.apache.fop.fo.UnknownXMLObj.addChild(UnknownXMLObj.java:80) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:276) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1371) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat or.java:840) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne r.java:1853) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM LDocumentScanner.java:1234) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948) at org.apache.fop.apps.Driver.render(Driver.java:481) at org.apache.fop.apps.Driver.run(Driver.java:554) at FopServlet.renderFO(FopServlet.java:102) at FopServlet.doGet(FopServlet.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417) at allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088 ) at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271) at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:39 ) at allaire.jrun.servlet.Invoker.service(Invoker.java:84) at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417) at allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088 ) at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271) at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.jav a:89) at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1557) at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1547) at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:364) at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:115) at allaire.jrun.ThreadPool.run(ThreadPool.java:272) at allaire.jrun.WorkerThread.run(WorkerThread.java:75) -Original Message- From: Sam Prokop [mailto:[EMAIL PROTECTED] Sent: Thursday, April 04, 2002 5:54 AM To: [EMAIL PROTECTED] Subject: AW: JPEG external graphic works, but SVG external graphic doesn't. i use the following workaround: fo:instream-foreign-object image width=xxx height=xxx xsl:attribute name=xlink:hrefPathToImage.svg/xsl:attribute /image /fo:instream-foreign-object -Ursprüngliche Nachricht- Von: Carter, Will [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 4. April 2002 01:17 An: '[EMAIL PROTECTED]' Betreff: JPEG external graphic works, but SVG external graphic doesn't. Hi, I am having problems with external svg files in my fo file when generating PDFs using FopServlet. I am using fop-0.20.3 specifically, I have these refs to external graphics in my fo file. This works: fo:block fo:external-graphic src=file:C:\Progra~1\Allaire\JRun\servers\default\default-app \WEB-INF\class es\generatedjpg.jpg/ /fo:block This doesn't workgeneratedsvg.svg is in the same directory as generatedjpg.jpg. the resulting pdf has a blank space where the svg should be. fo:block fo:external
write servlet response to a pdf file rather than send it to brows er?
Hi, Here is the code I am trying to use for accompleshing the task of sending the servlet response to a pdf file instead of the browser. I am not very experienced with java and the code I have added is marked below. public void renderFO(InputSource foFile,HttpServletResponse response) throws ServletException { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); response.setContentType(application/pdf); Driver driver = new Driver(foFile, out); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); driver.run(); **ADDED Start File file = new File(my.pdf); FileOutputStream fo = new FileOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.writeTo(fo); **ADDED End byte[] content = out.toByteArray(); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } } When I try to compile FopServlet, I get... FopServlettest.java:101: cannot resolve symbol symbol : constructor FileOutputStream () location: class java.io.FileOutputStream FileOutputStream fo = new FileOutputStream(); any help would be great! thanks, Will Carter