VS: Win32

2002-03-25 Thread Teemu . Talja
Hi,


Practically you have to be a Java programmer at a basic level to be 
able to use FOP. (This is my opinion) Or maybe you can use it for 
learning XSL-FO in other case, if someone deploys the servlet on 
your machine 


Teemu Talja
[EMAIL PROTECTED]
[EMAIL PROTECTED]
työpuhelin 0307 20138
GSM 040 55 43 156

 -Alkuperäinen viesti-
 Lähettäjä:Alastair Growcott [SMTP:[EMAIL PROTECTED]
 Lähetetty:22. maaliskuuta 2002 17:55
 Vastaanottaja:[EMAIL PROTECTED]
 Aihe: Win32
 
 Hi,
 
 I am a sad person who does not have Java on my machine, or any idea how
 to use it even if I did get my hands on a copy (I actually have a very
 nice Java developer environment with lots of help files on a CD-ROM, but
 not with me for another month or so).
 
 Hence although I have downloaded the distribution release of FOP
 (including all the nice help files and read-me files), I can't really
 use it.
 
 Is there anyone out there who can give me a nice easy to use Win32
 executable built from a reasonably recent release of the FOP Java code.
 I would very appreciative. But probably not in a fiscal manner :)
 
 Alastair Growcott.
 
 
 
 


how to avoid long strings exceeding table cell borders?

2002-03-18 Thread Teemu . Talja

Hi everybody,

I am using FOP version 0.20.1 and have had a problem with long strings. 
When a word is longer than the page is wide, FOP is lending space 
from adjacent cells which is not wanted. 

I have tried using attribute hyphenate, but I noticed that hyphenation does 
not affect information fetched from a xml document using xsl xsl:value-of. 

Does anyone know, if any improvements affecting this are made in newer 
versions of FOP, or if there is any other way to solve the problem?

It would be enough to cut long words at cell borders.

-Teemu



I have a block in the XSL file

fo:block font-family=Courier font-size=10pt font-weight=bold
language=fi hyphenate=true
!-- hyphenate: tavutetaan sisalto. FOP-BUGI: xsl:value-of arvoa ei
osata tavuttaa --
xsl:value-of select=lahetyksen_tiedot/paino_yhteensa/
/fo:block

and these are the whole XML and XSL files

 palautusrahtikirja.xml  XSLfileForReturnConsignmentNote.xxx 




Teemu Talja
[EMAIL PROTECTED]
[EMAIL PROTECTED]
työpuhelin 0307 20138
GSM 040 55 43 156



palautusrahtikirja.xml
Description: Binary data


XSLfileForReturnConsignmentNote.xxx
Description: Binary data


dynamically generated PDF documents are not reloaded as they shou ld

2002-03-04 Thread Teemu . Talja

Hello, 

in the system I am building I have a following problem:
I have a form that updates the information in a database 
row AND a servlet that generates PDF using FOP. 
when I do (in following order):

1) open a PDF document
2) update the information used in the PDF document 
using a HTML form
3) open the PDF document (click the link; the Acrobat 
window is actually already open)

The problem is that a PDF document with the 
new information is not generated in the already-open Acrobat 
window unless I refresh it manually pressing 'F5'  (no menus 
containing 'refresh' found in my Acrobat window).

The problem seems to be that the PDF document is 
cached somewhere and not is refreshed even if it should. Does 
anyone have an idea where I have the old information 
causing the problem in cache: server, browser or Acrobat?
I think if I press a browser submit button the browser has to 
understand to really reload the document, even while my submit 
button is not really a submit button but a button that is using 
JavaScript for submitting the information in the form.

I am using Bea Weblogic Server 6.1, Internet Explorer 
5.5 and don't know of what version of Acrobat. 


Teemu Talja
[EMAIL PROTECTED]
[EMAIL PROTECTED]
työpuhelin 0307 20138
GSM 040 55 43 156


VS: Pipe XSLT Transform to FOP (AND: ABOUT MAIL ARCHIVES)

2002-02-26 Thread Teemu . Talja

Hi 

I looked at the mailing list archives Joerg recommended (are all messages 
written to this mailing list found there)?

If someone is interested in firing FOP with SAX events, the most interesting

messages I found in the archive are 

http://marc.theaimsgroup.com/?l=fop-devm=100559404418852w=2 
and (another message commenting the previous message)
http://marc.theaimsgroup.com/?l=fop-devm=100566543511704w=2

some comments to Joergs message:

I do not think using TraxInputHandler or XSLTInputHandler is 
better than using a DOM tree. TraxInputHandler and XSLTInputHandler are both

making use of Files which is slow instead of being memory-consuming 
(XSLTInputHandler is using Strings in case of smaller documents which is
again 
memory-consuming instead of being slow). I am getting my XML files from a 
database and avoiding memory consumption by writing them (again) to the hard

disk is really not what I want to do :) Is memory consumption not a smaller
problem 
than reading from hard disk? The worst that might happen with memory 
consumption is swapping, that means taking data to the hard disk.

I guess the code example included in the first mentioned archived message 
seems to be the best way to minimize memory consumption using FOP.

the mail archive is very useful, thanks for it :)

-Teemu

 -Alkuperäinen viesti-
 Lähettäjä:Joerg Pietschmann [SMTP:[EMAIL PROTECTED]
 Lähetetty:12. helmikuuta 2002 18:53
 Vastaanottaja:FOP User
 Aihe: Re: Pipe XSLT Transform to FOP
 
 Ryan Howe [EMAIL PROTECTED] wrote:
  Could anyone point me in the right direction of how I could transform
  my XML to PDF without creating an intermediate file?
 
 Look up TraxInputHandler and XSLTInputHandler, or
 Document.getContentHandler()
 in the FOP documentation or the mailing list archives.
 This might get you started
  http://marc.theaimsgroup.com/?l=fop-userw=2r=1s=getcontenthandlerq=b
  http://marc.theaimsgroup.com/?l=fop-userw=2r=1s=xsltinputhandlerq=b
  http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=xsltinputhandlerq=b
  http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=traxinputhandlerq=b
 Be warned, use at least FOP version 0.20.2 to avoid frustration, some
 stuff doesn't work or works differently in 0.19 and 0.20.1
 Do not use PipedStream or an intermediate DOM tree unless you can
 afford wasting memory.
 
 J.Pietschmann


VS: XML, XSL a real problem

2002-02-04 Thread Teemu . Talja

here you have a working servlet

 XMLtoPDFServlet.java 
it is using older Xalan version 

I do not feel comfortable with sending my XML and XSL files 
because they are connected with my work

you can easily find correct-syntax examples from wrox (making 
xml and xsl guide books) web site 

-Teemu

 -Alkuperäinen viesti-
 Lähettäjä:Zahigian, Mike [SMTP:[EMAIL PROTECTED]
 Lähetetty:1. helmikuuta 2002 19:04
 Vastaanottaja:'[EMAIL PROTECTED]'
 Aihe: XML, XSL a real problem
 
 Has anybody managed to get a Java Servlet to accept xml, xsl stylesheet
 including fo and render to pdf?  I've been struggling for days and am
 running out of time before I have to abandon FOP for this project.  If
 possible, include your xml, xsl, and servlet code so I can work from
 there.
 Thanks in advance for any help.
 
 Mike Zahigian
 Business Information Systems
 x72819


XMLtoPDFServlet.java
Description: Binary data


VS: Entity references in FOP

2002-01-29 Thread Teemu . Talja

I think this depends on the encoding of the XML files and have not 
used those with PDF default fonts. Anyway if you are using unicode 
(embedded) fonts you can see http://www.unicode.org/charts/ for 
listings of unicode entity references. these are used like 

#x; 

 , where  should be the hexadecimal number. 

 if using decimals instead the letter x should be taken away. BUT 
THIS IS WHEN USING UNICODE FONTS.

-Teemu


 -Alkuperäinen viesti-
 Lähettäjä:David Wood [SMTP:[EMAIL PROTECTED]
 Lähetetty:29. tammikuuta 2002 4:09
 Vastaanottaja:[EMAIL PROTECTED]
 Aihe: Entity references in FOP
 
 In the interests of being typographically correct, I'm attempting to use
 oriented double and single quotes, ellipses, etc... These are typically
 referenced in HTML as ldquo; rdquo; (amp;ldquo; amp;rdquo;) and so
 on... however, FOP is informing me these entities are not declared.
 
 I would be curious to find a list of what entities are in and what aren't.
 Also, I presume I can use a numeric code (#number; - or amp;#number;) to
 reference the character directly. However, it seems like a list of those
 numbers and their corresponding characters is a little too basic for the
 FOP documentation or the usual reference materials. I assume there's a
 relevant ISO document - anybody know what it is?
 
 Or if you just have any common numbers handy I'd love to see them.  :)
 
 Thanks,
 David


FOP BUGZILLA : 0.17 is the last version

2002-01-29 Thread Teemu . Talja

Hi

Who is taking care of FOP bugzilla maintaining?

0.17 is the newest FOP version that bugzilla knows. To 
spare work for the bug fixers it might be good to be able 
to mention the real version in the bug report.

-Teemu


VS: FOP and DOM Success

2002-01-21 Thread Teemu . Talja

Thank you, 

I think this code really is useful!

I really have reported a bu to bugzilla about the DOM input.
the bug number is 5075.  Should someone add this code 
there too as it really has to do with the reported problem? 

-Teemu



 -Alkuperäinen viesti-
 Lähettäjä:Lakshmi Anantharaman
 [SMTP:[EMAIL PROTECTED]
 Lähetetty:18. tammikuuta 2002 22:26
 Vastaanottaja:Fop-User (E-mail)
 Aihe: FOP and DOM Success
 
 I tried for long and with the help of  fop-dev archive got my FOP servlet
 to
 work with a DOM .
 Here comes the code . I hope it is useful to someone down the line !
 
 public void renderXML(HttpServletResponse response) throws
 ServletException
 {
 try {
  //Instantiate a DocumentBuilderFactory.
 DocumentBuilderFactory dFactory =
 DocumentBuilderFactory.newInstance();
 // And setNamespaceAware, which is required when parsing xsl files
 dFactory.setNamespaceAware(true);
 //Use the DocumentBuilderFactory to create a DocumentBuilder.
 DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
 
 /**/
 FileInputStream  xmlfile = new
 FileInputStream(c:\\bea\\wlserver6.0\\contact.xml );
 Document xmlDoc = dBuilder.parse(xmlfile);
 javax.xml.transform.dom.DOMSource xmlDomSource = new
 javax.xml.transform.dom.DOMSource(xmlDoc);
 //
 
 
 //
 FileInputStream xsltFile = new FileInputStream(contactFO.xsl);
 
 org.w3c.dom.Document xslDoc = dBuilder.parse(xsltFile);
 javax.xml.transform.dom.DOMSource xslDomSource = new
 javax.xml.transform.dom.DOMSource(xslDoc);
 javax.xml.transform.TransformerFactory tFactory =
 javax.xml.transform.TransformerFactory.newInstance();
 javax.xml.transform.Templates templates =
 tFactory.newTemplates(xslDomSource);
 javax.xml.transform.Transformer transformer =
 templates.newTransformer();
 /*/
 
 javax.xml.transform.dom.DOMResult foDomResult = new
 javax.xml.transform.dom.DOMResult();
 transformer.transform(xmlDomSource, foDomResult);
 
 // Avoiding this step was what gave the null pointer exception ! 
 org.w3c.dom.Document foDoc
 =(org.w3c.dom.Document)foDomResult.getNode();
 
  
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 response.setContentType(application/pdf);
 org.apache.fop.apps.Driver driver = new
 org.apache.fop.apps.Driver();
 driver.setErrorDump(true);
 driver.setRenderer(driver.RENDER_PDF);
 driver.setupDefaultMappings() ;
 driver.setOutputStream(out);
 driver.render(foDoc);
 
 byte[] content = out.toByteArray();
 response.setContentLength(content.length);
 response.getOutputStream().write(content);
 response.getOutputStream().flush();
 }catch(FileNotFoundException fnf)
 {
   fnf.printStackTrace();
 }
 catch (Exception ex) {
   throw new ServletException(ex);
 }
 }
 Lakshmi


VS: java.lang.NullPointerException

2002-01-18 Thread Teemu . Talja

Hi

I previously tried using DOM Input with FOP 0.20.1 but it did not 
work. (I reported a bug to bugzilla) It seemed to me that FOP 
does not work with DOM input, when I switched to Stream input 
(using the same FOP code) it started working. 

- Teemu