Re: How To Implement Ligature For Indian Languages In Pdf Documents?

2011-10-25 Thread Simon Pepping
Confirmed. See
http://people.apache.org/committer-index.html#unlistedclas.

Simon

On Mon, Oct 24, 2011 at 02:12:43PM -0700, dilipvshah wrote:
 
 I just received an email from Craig Russell that my ICLA has been filed in
 Apache Software Foundation's records.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Default XSL Stylesheet for PDF?

2011-10-25 Thread Jeffrey Walton
Hi All,

I'm working on Ubuntu 10.04 (x64). I installed the FOP package, and
now trying to create a PDF from O'Reilly's DocBook sample at
https://prod.oreilly.com/external/tools/docbook/docs/authoring/docbook_source/.

$oreilly-handbook$ fop -xml book.xml -pdf book.pdf

results in an exception:

Oct 25, 2011 3:34:41 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException: XSLT file must be specified for the
transform mode

I believe i need to add `-xsl stylesheet`. But I don't know what the
default stylesheet is.

Would anyone be able to point out the default PDF stylesheet?

Thanks in advance,
Jeff

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread mehdi houshmand
Hi Jeff,

FOP is an FO processor, as such it takes FO as input, not XML (even
though FO is XML, XML isn't FO). You need to make sure your input is
valid FO, then either use the -fo parameter or no parameter since it's
the FOPs primary input.

If you were curious the -xml input is used in conjunction with an XSLT
(thus the -xsl parameter) to transform said XML file to FO. There is
no default PDF stylesheet, this mechanism is merely a helper since a
lot of users create FO using a transform.

So assuming your book.xml is valid FO, the command would look like:
$oreilly-handbook$ fop book.xml -pdf book.pdf

Hope that helps

Mehdi


On 25 October 2011 08:37, Jeffrey Walton noloa...@gmail.com wrote:
 Hi All,

 I'm working on Ubuntu 10.04 (x64). I installed the FOP package, and
 now trying to create a PDF from O'Reilly's DocBook sample at
 https://prod.oreilly.com/external/tools/docbook/docs/authoring/docbook_source/.

 $oreilly-handbook$ fop -xml book.xml -pdf book.pdf

 results in an exception:

 Oct 25, 2011 3:34:41 AM org.apache.fop.cli.Main startFOP
 SEVERE: Exception
 org.apache.fop.apps.FOPException: XSLT file must be specified for the
 transform mode

 I believe i need to add `-xsl stylesheet`. But I don't know what the
 default stylesheet is.

 Would anyone be able to point out the default PDF stylesheet?

 Thanks in advance,
 Jeff

 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Jeffrey Walton
On Tue, Oct 25, 2011 at 3:48 AM, mehdi houshmand med1...@gmail.com wrote:
 Hi Jeff,

 FOP is an FO processor, as such it takes FO as input, not XML (even
 though FO is XML, XML isn't FO). You need to make sure your input is
 valid FO, then either use the -fo parameter or no parameter since it's
 the FOPs primary input.
OK, thanks (I think).

 If you were curious the -xml input is used in conjunction with an XSLT
 (thus the -xsl parameter) to transform said XML file to FO. There is
 no default PDF stylesheet, this mechanism is merely a helper since a
 lot of users create FO using a transform.
OK. xalan also complains about a style sheet. These style sheets seem important.

$ xalan -in book.xml
XSLT Error: Failed to process stylesheet. (line -1, column -1.)

XSLException Type is: XSLTProcessorException
Message is: Failed to process stylesheet. (Unknown URI, line -1, column -1)

 So assuming your book.xml is valid FO, the command would look like:
 $oreilly-handbook$ fop book.xml -pdf book.pdf
OK, thanks.

Out of curiosity, how do you create a PDF from a XML (DocBook) book. I
haven't had any luck with docbook2pdf, xsltproc, xalan, fop, etc. I am
amazed at how difficult the designers/architects have made this
process. Here's what the sample book looks like (the chapters are
similar):

?xml version=1.0 encoding=UTF-8?
!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.4//EN
http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd;
book
  titleDocBook Authoring Guidelines/title

  xi:include href=bookinfo.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch00.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch01.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch02.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch03.xml xmlns:xi=http://www.w3.org/2001/XInclude; /
/book

Jeff

$ fop book.xml -pdf book.pdf
Oct 25, 2011 3:48:53 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: Error: First element
must be the fo:root formatting object. Found (Namespace URI: , Local
Name: book) instead. Please make sure you're producing a valid
XSL-FO document.
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
... 4 more

-

javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: 

RE: Default XSL Stylesheet for PDF?

2011-10-25 Thread Eduard Tibet
Jeff,

Despite your question is more about Docbook specific points, than FOP, I'll try 
to give you an idea.

If you are using Docbook, try the following 2-step transformation.

1. Use xsltproc to create a FO file using default Docbook:

xsltproc --xinclude --output book.fo 
path_to_your_docbook_xsl_stylesheets/docbook-xsl-1.76.1/fo/docbook.xsl 
book.xml

As a result you will get .fo-file: book.fo

2. Using FOP try to create PDF: fop book.fo book.pdf

Hope this helps.

P.S. If you are using Windows OS, replace the slash to the opposite one (sorry, 
but I forgot about what slash is reverse and what is normal).

--
 Best regards,
  Eduard Tibet

-Original Message-
From: Jeffrey Walton [mailto:noloa...@gmail.com] 
Sent: Tuesday, October 25, 2011 11:55 AM
To: mehdi houshmand
Cc: fop-users@xmlgraphics.apache.org
Subject: Re: Default XSL Stylesheet for PDF?

On Tue, Oct 25, 2011 at 3:48 AM, mehdi houshmand med1...@gmail.com wrote:
 Hi Jeff,

 FOP is an FO processor, as such it takes FO as input, not XML (even
 though FO is XML, XML isn't FO). You need to make sure your input is
 valid FO, then either use the -fo parameter or no parameter since it's
 the FOPs primary input.
OK, thanks (I think).

 If you were curious the -xml input is used in conjunction with an XSLT
 (thus the -xsl parameter) to transform said XML file to FO. There is
 no default PDF stylesheet, this mechanism is merely a helper since a
 lot of users create FO using a transform.
OK. xalan also complains about a style sheet. These style sheets seem important.

$ xalan -in book.xml
XSLT Error: Failed to process stylesheet. (line -1, column -1.)

XSLException Type is: XSLTProcessorException
Message is: Failed to process stylesheet. (Unknown URI, line -1, column -1)

 So assuming your book.xml is valid FO, the command would look like:
 $oreilly-handbook$ fop book.xml -pdf book.pdf
OK, thanks.

Out of curiosity, how do you create a PDF from a XML (DocBook) book. I
haven't had any luck with docbook2pdf, xsltproc, xalan, fop, etc. I am
amazed at how difficult the designers/architects have made this
process. Here's what the sample book looks like (the chapters are
similar):

?xml version=1.0 encoding=UTF-8?
!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.4//EN
http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd;
book
  titleDocBook Authoring Guidelines/title

  xi:include href=bookinfo.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch00.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch01.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch02.xml xmlns:xi=http://www.w3.org/2001/XInclude; /

  xi:include href=ch03.xml xmlns:xi=http://www.w3.org/2001/XInclude; /
/book

Jeff

$ fop book.xml -pdf book.pdf
Oct 25, 2011 3:48:53 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
book) instead. Please make sure you're producing a valid XSL-FO
document.
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: Error: First element
must be the fo:root formatting object. Found (Namespace URI: , Local
Name: book) instead. Please make sure you're producing a valid
XSL-FO document.
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at 

Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread flattr . tomschr
Hi Jeffrey,

p, li { white-space: pre-wrap; }
On Tuesday 25 October 2011 Jeffrey Walton wrote:
 [...]
  If you were curious the -xml input is used in conjunction with an XSLT
  (thus the -xsl parameter) to transform said XML file to FO. There is
  no default PDF stylesheet, this mechanism is merely a helper since a
  lot of users create FO using a transform.

 OK. xalan also complains about a style sheet. These style sheets seem
 important.
 
They are not important, they are essential! :-)
 
 
 $ xalan -in book.xml
 XSLT Error: Failed to process stylesheet. (line -1, column -1.)
 
You miss a -xsl option. If you do not know how to run xalan, use the -h or 
--help option to display an overview. There it should give you an idea what 
options xalan needs.
 
 
 XSLException Type is: XSLTProcessorException
 Message is: Failed to process stylesheet. (Unknown URI, line -1, column -1)
 
You miss one point: Xalan complains correctly so as you forgot to add a XSLT 
stylesheet. I'm not that familiar with Xalan, so I usually use xsltproc. Here 
is an example:
 
$ DB=/usr/share/xml/docbook/stylesheet/nwalsh/current/
$ xsltproc --output book.fo $DB/fo/docbook.xsl book.xml
 
The basic principle is the same regardless of the XSLT processor.
 
Let me explain these two lines:
The first line is just a convenience variable. You need to change that path to 
point to your DocBook XSL stylesheets. Search for a package with docbook-xsl or 
the like. Just add the _path_.
 
The second line is the transformation. It needs the XSLT stylesheet which is 
$DB/fo/docbook.xsl as one input and your DocBook XML document book.xml as 
another input. The result of the transformation is saved in book.fo.
 
 
 Out of curiosity, how do you create a PDF from a XML (DocBook) book. I
 haven't had any luck with docbook2pdf, xsltproc, xalan, fop, etc.
 
You miss some options, probably also some basics. See next paragraph.
 
 
 I am amazed at how difficult the designers/architects have made this
 process.
 
I can assure you, the developers did NOT try it to make it difficult just to 
annoy users. Actually it is really simple, you just need to understand some 
basic steps. Here are the steps from DocBook XML to PDF:
 
 
1. Validate your DocBook XML file first
Do NOT skip this step! Use xmllint and run it like this:
$ xmllint --xinclude --postvalid --noout book.xml
If you encounter any problems, fix it. DO NOT processed further if you
encounter any errors. The other steps rely on a valid DocBook source.
 
2. Transform your DocBook XML file into FO
The FO file is an intermediate file which is read by your FO formatter.
I've already wrote about how to run xsltproc. See lines above.
 
3. Format the FO file
Now you take your FO file and feed it into the FO formatter:
$ fop book.fo book.pdf
 

These are three simple steps, each rely on the previous. If you have an invalid 
DocBook source, it is useless to go further. Just fix your file(s). The 
tranformation from DocBook to FO is usually without problems. When you try to 
format the intermediate FO file, that depends on the formatter. Sometimes FOP 
is a bit picky. :)
 
Hope that helps.

p, li { white-space: pre-wrap; }
--
Gruß/Regards,
Thomas Schraitle

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Jeffrey Walton
On Tue, Oct 25, 2011 at 4:34 AM,  flattr.toms...@online.ms wrote:
 Hi Jeffrey,

 p, li { white-space: pre-wrap; }
 On Tuesday 25 October 2011 Jeffrey Walton wrote:
 [...]
  If you were curious the -xml input is used in conjunction with an XSLT
  (thus the -xsl parameter) to transform said XML file to FO. There is
  no default PDF stylesheet, this mechanism is merely a helper since a
  lot of users create FO using a transform.

 OK. xalan also complains about a style sheet. These style sheets seem
 important.

 They are not important, they are essential! :-)
OK. Dumb user question: if they are so important, why does the tool
have no default style sheet to use? I would expect it to set margins
at 1.00 inch (or 2 centimeters), etc.

 1. Validate your DocBook XML file first
 Do NOT skip this step! Use xmllint and run it like this:
 $ xmllint --xinclude --postvalid --noout book.xml
 If you encounter any problems, fix it. DO NOT processed further if you
 encounter any errors. The other steps rely on a valid DocBook source.

 2. Transform your DocBook XML file into FO
 The FO file is an intermediate file which is read by your FO formatter.
 I've already wrote about how to run xsltproc. See lines above.
OK, thanks. I was not aware this was a multi-step process.

 3. Format the FO file
 Now you take your FO file and feed it into the FO formatter:
 $ fop book.fo book.pdf
OK. See below :(

$ xmllint --xinclude --postvalid --noout book.xml
# No complaints

$ xsltproc --xinclude
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
book.xml  book.fo
# No complaints

$ fop -fo book.fo -pdf book.pdf
# All hell breaks loose

Thanks for the help. It is greatly appreciated.

Jeff

Oct 25, 2011 5:07:37 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: Error: First element
must be the fo:root formatting object. Found (Namespace URI: , Local
Name: html) instead. Please make sure you're producing a valid
XSL-FO document.
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
... 4 more

-

javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)

Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Jeffrey Walton
On Tue, Oct 25, 2011 at 4:31 AM, Eduard Tibet eduard.ti...@i-free.com wrote:
 Jeff,

 Despite your question is more about Docbook specific points, than FOP, I'll 
 try to give you an idea.
My bad. When the other tools did not work, someone (on a mailing list)
suggested I use Apache FOP.

 If you are using Docbook, try the following 2-step transformation.

 1. Use xsltproc to create a FO file using default Docbook:

 xsltproc --xinclude --output book.fo 
 path_to_your_docbook_xsl_stylesheets/docbook-xsl-1.76.1/fo/docbook.xsl 
 book.xml

 As a result you will get .fo-file: book.fo

 2. Using FOP try to create PDF: fop book.fo book.pdf

 Hope this helps.

 P.S. If you are using Windows OS, replace the slash to the opposite one 
 (sorry, but I forgot about what slash is reverse and what is normal).
Thanks for the help,

jeff

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Thomas Schraitle
Hi Jeffrey,

 
On Tuesday 25 October 2011 Jeffrey Walton wrote:
 [...]

 OK. Dumb user question: if they are so important, why does the tool
 have no default style sheet to use?
 
 
There are no default style sheets. It is the user who has to set these. The 
important thing is, you just need to give them as an option to your respective 
XML program.
 
 


 I would expect it to set margins at 1.00 inch (or 2 centimeters), etc.
 
 
That's a different thing and has nothing to do with default style sheets. :) 
This is a layout issue. Of course, you can set this things in the stylesheets.
 
 

 [...]
 OK, thanks. I was not aware this was a multi-step process.
 
 
Yes, it is. :-)

 
 
 
  3. Format the FO file
  Now you take your FO file and feed it into the FO formatter:
  $ fop book.fo book.pdf

 OK. See below :(

 $ xmllint --xinclude --postvalid --noout book.xml
 # No complaints

 $ xsltproc --xinclude
 http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl [...]
 
 
NO! :-) You need fo, _not_ html! The URL is wrong: just replace the 
/html/ part with /fo/.
The xsltproc processor indeed does not complain, because it was a correct 
transformation, although in HTML. But HTML is not the correct input format for 
your FO formatter. :-)
 
 

Tom

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Default XSL Stylesheet for PDF?

2011-10-25 Thread Kerry, Richard
 

 why does the tool
 have no default style sheet to use? I would expect it to set margins
 at 1.00 inch (or 2 centimeters), etc.

FOP (*) is passed a single file to process.
This known as XSL-FO.  (or often just FO)
It contains all such measurements.

The stylesheet is applied during the preparation of the FO file.  This is not 
(**) done by FOP but by another processor, eg xsltproc, Saxon, Xalan.  Such 
programs do also take a stylesheet as parameter, and combine the stylesheet 
data with the source data (eg DocBook).  The output is XSL-FO (or html, or 
various other possibilities).
The stylesheet that is used to produce the XSL-FO contains the default margins 
etc that you refer to.  It writes these into the FO.



Hope that help,
Richard.



(*) Or any other FO processor (ie XSL-FO to PDF convertor).
(**) Actually I think FOP can be requested to do this process too, but is not 
usually used in that way.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: How To Implement Ligature For Indian Languages In Pdf Documents?

2011-10-25 Thread dilipvshah

My application allows school students in Gujarat, India to learn their
subjects online. Browser and Flash player manage to display Gujarati on the
screen but I need a printing solution for them to be able to print the
question papers they generate. The application currently generates HTML
pages that they can print but an HTML page doesn't give the kind of control
a PDF document does, for page formatting and storage.

Dilip


Glenn Adams-2 wrote:
 
 thanks for the data and the ICLA submission; i'll let you know when
 progress
 is made on the Gujarati; I would hope to have it in place before the end
 of
 the year, but it depends on certain process issues currently in play,
 namely
 the merging of the complex scripts branch into trunk and other factors;
 
 if you (or anyone else) supports merging the temporary complex script
 branch
 into the development trunk, you should send email to
 fop-...@xmlgraphics.apache.org indicating that interest; also, it would be
 useful to provide information on what use you intend to make of complex
 script functionality;
 
 regards,
 glenn
 
 On Mon, Oct 24, 2011 at 10:53 PM, dilipvshah dilipvs...@hotmail.com
 wrote:
 

 Hi Glenn,

 I hope the data I provided helped.

 What's the QA as well as release schedule for Gujarati ligature support?
 If
 you want, I can help test your code as and when it gets develops and is
 ready for alpha-testing.

 Dilip


 Glenn Adams-2 wrote:
 
  Dilip,
 
  Thanks for your offer of test data. What I need is a UTF-8 encoded text
  file
  containing Gujarati word forms, one form on each line. If that data is
  available in an unencumbered form on the Web, then let me know a link
 for
  downloading. Otherwise, I would need you to post it as an attachment to
  the
  current complex script bug [1], and also will need you to complete and
  send
  an Individual Contributors License Agreement (ICLA) [2] to the ASF.
 
  Once I have this data, I will be in a better position to add the small
  amount of code needed to support the Gujarati script, with which I am
  already familiar [I authored the Unicode Standard's detailed treatment
 of
  Indic scripts.]
 
  Regards,
  Glenn
 
  [1] http://issues.apache.org/bugzilla/show_bug.cgi?id=49687
  [2] http://www.apache.org/licenses/icla.txt
 
  On Wed, Oct 19, 2011 at 11:15 PM, dilipvshah dilipvs...@hotmail.com
  wrote:
 
 
  My immediate need is generating PDF with Gujarati text and have a
  reasonably
  large dataset in Gujarati to test such a functionality. I would be
 more
  than
  happy to participate in the testing process when that support is
 ready.
  I'm
  assuming that you have Gujarati experts participate in the planning
 and
  development process when that starts. Here also, if you need any help,
  let
  me know.
 
  Dilip
 
 
  Simon Pepping @ Home wrote:
  
   Support for Indian scripts is being developed. See the overview at
   http://people.apache.org/~spepping/. You could help by testing this
   work.
  
   At this moment support for Indian scripts is limited to devanagari.
   Gujarati is in the planning.
  
   Simon Pepping
  
   On Tue, Oct 18, 2011 at 02:32:10PM -0700, dilipvshah wrote:
  
   I wish to use XSL-FO technology to generate PDF documents in Indian
   languages.
  
   Here are the steps I took:
   1) I downloaded fop-1.0 and tried their first example to display a
  name.
   I
   tried to display name in one of the Indian languages, Gujarati.
   2) I modified the fop configuration file to load Arial Unicode MS
   3) The example application does produce PDF document with Gujarati
  fonts
   but
   the text is displayed as a sequence of individual characters and
  doesn't
   use
   ligature to display the text correctly. The font glyphs are
 displayed
  in
   the
   ordered they are entered in Google's transliterate tool but since
   ligature
   rules are not applied, the name is displayed incorrectly.
   Does FOP have ligature rules for Indian languages? If so, how do I
  apply
   them when generating a PDF document.
  
  
 -
   To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
   For additional commands, e-mail:
 fop-users-h...@xmlgraphics.apache.org
  
  
  
 
  --
  View this message in context:
 
 http://old.nabble.com/How-To-Implement-Ligature-For-Indian-Languages-In-Pdf-Documents--tp32677144p32683156.html
  Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
  For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/How-To-Implement-Ligature-For-Indian-Languages-In-Pdf-Documents--tp32677144p32710867.html
 Sent from the FOP - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, 

Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Paul Tremblay

On 10/25/11 5:09 AM, Jeffrey Walton wrote:

On Tue, Oct 25, 2011 at 4:34 AM,flattr.toms...@online.ms  wrote:

Hi Jeffrey,

p, li { white-space: pre-wrap; }
On Tuesday 25 October 2011 Jeffrey Walton wrote:

[...]

If you were curious the -xml input is used in conjunction with an XSLT
(thus the -xsl parameter) to transform said XML file to FO. There is
no default PDF stylesheet, this mechanism is merely a helper since a
lot of users create FO using a transform.

OK. xalan also complains about a style sheet. These style sheets seem
important.

They are not important, they are essential! :-)

OK. Dumb user question: if they are so important, why does the tool
have no default style sheet to use? I would expect it to set margins
at 1.00 inch (or 2 centimeters), etc.


1. Validate your DocBook XML file first
Do NOT skip this step! Use xmllint and run it like this:
$ xmllint --xinclude --postvalid --noout book.xml
If you encounter any problems, fix it. DO NOT processed further if you
encounter any errors. The other steps rely on a valid DocBook source.

2. Transform your DocBook XML file into FO
The FO file is an intermediate file which is read by your FO formatter.
I've already wrote about how to run xsltproc. See lines above.

OK, thanks. I was not aware this was a multi-step process.


3. Format the FO file
Now you take your FO file and feed it into the FO formatter:
$ fop book.fo book.pdf

OK. See below :(

$ xmllint --xinclude --postvalid --noout book.xml
# No complaints

$ xsltproc --xinclude
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
book.xml  book.fo
# No complaints


Jeffrey,

You are using the wrong stylesheets. You have converted your book.xml to 
an HTML document. If you renamed book.fo to book.html and then opened it 
in firefox, you see it formatted properly. However, you need a FO 
document. Try:


$ xsltproc --xinclude

http://docbook.sourceforge.net/release/xsl/current/fo/fo.xsl
book.xml  book.fo

Instead.

It would probably be better to download the stylesheets to your hard 
drive, since it will take less time to process. Let me know if you still 
have problems.


Paul


$ fop -fo book.fo -pdf book.pdf
# All hell breaks loose

Thanks for the help. It is greatly appreciated.

Jeff

Oct 25, 2011 5:07:37 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
html) instead. Please make sure you're producing a valid XSL-FO
document.
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: Error: First element
must be the fo:root formatting object. Found (Namespace URI: , Local
Name: html) instead. Please make sure you're producing a valid
XSL-FO document.
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at 

Re: Default XSL Stylesheet for PDF?

2011-10-25 Thread Paul Tremblay

On 10/25/11 5:09 AM, Jeffrey Walton wrote:

On Tue, Oct 25, 2011 at 4:34 AM,flattr.toms...@online.ms  wrote:

Hi Jeffrey,

p, li { white-space: pre-wrap; }
On Tuesday 25 October 2011 Jeffrey Walton wrote:

[...]

If you were curious the -xml input is used in conjunction with an XSLT
(thus the -xsl parameter) to transform said XML file to FO. There is
no default PDF stylesheet, this mechanism is merely a helper since a
lot of users create FO using a transform.

OK. xalan also complains about a style sheet. These style sheets seem
important.

They are not important, they are essential! :-)

OK. Dumb user question: if they are so important, why does the tool
have no default style sheet to use? I would expect it to set margins
at 1.00 inch (or 2 centimeters), etc.


1. Validate your DocBook XML file first
Do NOT skip this step! Use xmllint and run it like this:
$ xmllint --xinclude --postvalid --noout book.xml
If you encounter any problems, fix it. DO NOT processed further if you
encounter any errors. The other steps rely on a valid DocBook source.

2. Transform your DocBook XML file into FO
The FO file is an intermediate file which is read by your FO formatter.
I've already wrote about how to run xsltproc. See lines above.

OK, thanks. I was not aware this was a multi-step process.


3. Format the FO file
Now you take your FO file and feed it into the FO formatter:
$ fop book.fo book.pdf

OK. See below :(

$ xmllint --xinclude --postvalid --noout book.xml
# No complaints

$ xsltproc --xinclude
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
book.xml  book.fo
# No complaints

$ fop -fo book.fo -pdf book.pdf
# All hell breaks loose

Thanks for the help. It is greatly appreciated.



Woops. That stylesheet is not the main processing one. Try

xsltproc --xincludestyle 
http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl 
book.xml  book.fo


Paul

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP crashes when encountering character 00AD (soft hyphen)

2011-10-25 Thread Paul Tremblay

Hi Mehdi,

Yes, the nightly build works fine.

Paul

On 10/24/11 2:55 AM, mehdi houshmand wrote:

Hi Paul,

You're getting a class not found exception for some reason, maybe
there was an error when you downloaded the source? Or have you changed
the source at all? Someone else may have an idea, but if you just want
the JAR, you can get it from the nightly builds
http://ci.apache.org/projects/xmlgraphics/fop/snapshots/.

Mehdi

On 21 October 2011 17:33, Paul Tremblaypaulhtremb...@gmail.com  wrote:

Hi Mehdi,

Here are the errors, as an attached file.

On 10/21/11 11:16 AM, mehdi houshmand wrote:

Hi Paul,

Try running the JUnit task ant junit and share any errors.

Mehdi

On 21 October 2011 15:47, Paul Tremblaypaulhtremb...@gmail.comwrote:

Hi Mehdi,

I already have JUnit4 (junit-4.10.jar). That's the jar I put in my
/usr/share/ant/lib

Paul

On 10/21/11 10:44 AM, mehdi houshmand wrote:

Hi Paul,

The latest trunk relies on JUnit4, so you'll have to get that JAR not
the JUnit3 one, the url (https://github.com/KentBeck/junit/downloads)
should help.

Mehdi

On 21 October 2011 15:39, Paul Tremblaypaulhtremb...@gmail.com
  wrote:

On 10/21/11 6:04 AM, J.Pietschmann wrote:

Am 21.10.2011 09:44, schrieb mehdi houshmand:

however, FOP trunk doesn't produce this
issue,

Jeremias fixed this some time ago on trunk.

J.Pietschmann



Thanks. I downloaded the trunk. I followed the directions and set
JAVA_HOME
to /Library/Java/Home and ANT_HOME to usr/share/ant. I typed ant and
got
an
error message that junit.jar had to be on the classpath of ant. So I
copied
junit from /usr/share/junit/junit.jar to /usr/share/ant/lib, and typed
ant
again.

This time the build generated at lot of tests, and ended with this
message:

BUILD FAILED
/Library/Java/trunk/build.xml:875: NOTE:


**
* One or more of the Junit tests had Failures or Errors or were
skipped!
*
* Please check the output above for relevant messages.
*
*Or use the junit-reports target to generate HTML test reports.
  *


**

However, running a  few tests:

fop -fofile.fo  -pdf out.pdf

works fine, rendering correct PDF.

Do I have an incomplete build? I can send along more detailed reports
if
I
need to.

Thanks again

Paul

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org