Re: TransformerConfigurationException

2011-08-19 Thread KAMOHELO MOFOKENG
Hi Sergiu,
Many thanks for the response
 
 This looks like an XSLT error, not a FOP one. Are you using such a 
 transformation to obtain the XSL-FO document from another XML file?
 
I'm using an XSL file to get a PDF document from an XML file 
the example from: 
http://www.codeproject.com/KB/java/PDFGeneration_XSLFO_FOP.aspx
 
I used the files from this site specifically because they work in a stand alone 
code.
 
XML File:
--
?xml version=1.0 encoding=iso-8859-1?
root
nameshyam/name
friend
 nameAbc/name
 phNo90909090909/phNo
/friend
friend
 nameXyz/name
 phNo32323232323/phNo
/friend
/root
__
 
XSL File:
--
?xml version=1.0 encoding=iso-8859-1?
xsl:stylesheet version=1.1
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform 
  xmlns:fo=http://www.w3.org/1999/XSL/Format;
 exclude-result-prefixes=fo
xsl:template match=root
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  fo:layout-master-set
    fo:simple-page-master master-name=my-page
  fo:region-body margin=1in/
    /fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-reference=my-page
    fo:flow flow-name=xsl-region-body
  fo:blockHello, xsl:value-of select=name /!/fo:block
  fo:block
   fo:table
     fo:table-body
      fo:table-row
     fo:table-cell border=solid 1px black 
   text-align=center font-weight=bold
      fo:block
      No.
    /fo:block
     /fo:table-cell
     fo:table-cell border=solid 1px black 
   text-align=center font-weight=bold
      fo:block
      Name
    /fo:block
     /fo:table-cell
     fo:table-cell border=solid 1px black 
   text-align=center font-weight=bold
      fo:block
      Phone Number
    /fo:block
     /fo:table-cell
    /fo:table-row
    xsl:for-each select=./friend
     fo:table-row
     fo:table-cell border=solid 1px black text-align=center
      fo:block
      xsl:value-of select=position() /
    /fo:block
     /fo:table-cell
     fo:table-cell border=solid 1px black text-align=center
      fo:block
      xsl:value-of select=name /
    /fo:block
     /fo:table-cell
     fo:table-cell border=solid 1px black text-align=center
      fo:block
      xsl:value-of select=phNo /
    /fo:block
     /fo:table-cell
    /fo:table-row
    /xsl:for-each
     /fo:table-body
   /fo:table
  /fo:block
    /fo:flow
  /fo:page-sequence
/fo:root
/xsl:template
/xsl:stylesheet
__

 If it fails in an applet but works standalone, I'd say the difference 
 that triggers the error is in the classpath; a different XSLT processor 
 is used in the applet (or at least a different version of saxon).
 
I think this might be the problem, but how do I check the difference?
I used the saxon8.jar because it is referenced from the fop.jar's manifest file 
 I'm using JRE 1.6.
 
Regards,
Kamo

Page breaks for program listings

2011-08-19 Thread mike 675

Using FOP 1.0. Docbook XML - FO - PDF.

Some of the page breaks for my  programlistings look bad. They leave a
single orphan line at the bottom of the page.

I have tried the following FO processing instructions for the relevant
blocks, but they have no effect.

?dbfo keep-together=always ?  (is this only for formal objects --
tables, figures etc?)

?dbfo-need height=2in ? (this does not push the following block on to
the next page, as expected)
-- 
View this message in context: 
http://old.nabble.com/Page-breaks-for-program-listings-tp32293619p32293619.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



PDF from Java Value Objects

2011-08-19 Thread Prashant Neginahal

Hi,

I am trying to explore this library to create PDF documents and gone through
all the examples.

In my application, we query database and get the value objects (java beans)
and out of this we need to create PDF files. I looked at ExampleJavatoPDF,
for me it looks too much of code (with SAXSource). I was thinking to use
JAXB annotations (jaxb is shipped with JDK1.6) and generate XML stream on
the fly and apply XSL to generate PDF.

The code looks as below.

JAXBContext context = JAXBContext.newInstance(valueObj.getClass());
Marshaller m = context.createMarshaller();

ByteArrayOutputStream xmlOut = new ByteArrayOutputStream();
m.marshal(valueObj, xmlOut);
byte[] o = xmlOut.toByteArray();
xmlOut.close();
ByteArrayInputStream in = new ByteArrayInputStream(o);

Source src = new StreamSource(in);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);

It works fine. My question is, is it best practice to generate PDF files
from Java Objects? Is there a better way? Can we generate XSL-FO from Java
objects?

Thanks in advance.

Regards,
Prashant
-- 
View this message in context: 
http://old.nabble.com/PDF-from-Java-Value-Objects-tp32293814p32293814.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



Re: Multiple spaces

2011-08-19 Thread Chris Bowditch

On 17/08/2011 15:06, MorganB wrote:

Hello,


Hi Morgan,


First of all, sorry for my poor english.

I try to generate simple text. However, when I write multiple spaces or
space before starting my text, everything is overwrited into a simple space
(for multiple spaces) or erased (for my space before starting my text).


To stop multiple spaces being collapsed into a single space use 
white-space-collapse=false on your fo:block


To stop whitespace at start and end of a line from being dropped, use 
white-space-treatment=preserve on your fo:block



For example, my text

-a-b---c (with - as space  ) is translated into
a-b-c

Do you know how can I keep my multiple spaces ?

Thanks for you help,

Morgan


Thanks,

Chris

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



Re: fo:marker bleeding issue [fop 0.95 FOP 1.0]

2011-08-19 Thread Chris Bowditch

On 18/08/2011 13:25, champagne_chary wrote:

Hello,


Hi,


Sorry to revive this year old post.

I'm completly new to this and what you seem to have achieved -despite this
minor glitch- is exactly what I would like to implement. However I'm a
complete newb..I can see the fo but would be interested in seeing how and
where you have placed the markers to achieve this.
If you can post/ or pm me I'd be very thankful as hours of googling and
failed attempts at pacing headers have lead to nothing but failure.


I don't think there is a way to simulate table markers properly in the 
current FOP version. As the original poster indicates, he can getting 
close to a working solution with regular markers but there are some 
corner cases where it doesn't work. I am not aware of a way to get it 
fully working, however, some of my colleagues have been looking into 
implementing table Markers. This is on our TODO list, but I think the 
planned implementation is still limited to 1 line of text in the header. 
Vincent, please correct me if I'm wrong.



Hope you receive this and can help.

Thanks



Thanks,

Chris




bonekrusher wrote:

Hi,

In order to have table headers continued in my pdf output, I am using
markers. Everything works fine until there is more then one line on the
1st marker and there is a second marker. If the 1st marker is more than
one line and I add a second marker, the marker bleeds into the table on
the second page (see attached pdf). One solution to to increase the
@margin-top on the region-body. The problem with that is  there are many
times when the markers are not needed and there is a huge whitespace where
the markers would go. For example, if the margin-top=1.0in, there would
be a one inch whitespace if the markers are not called.

See attached example fo and pdf. Page 2 of the pdf is where the problem
occurs. I need the table to start below Table 3. Table Title Marker -
Continued.

I am not sure how to resolve this.
  http://old.nabble.com/file/p29532209/testMaint.fo testMaint.fo
  http://old.nabble.com/file/p29532209/example.pdf example.pdf

Thanks for the help




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



Re: Preserving White Spaces in FOP 1.0

2011-08-19 Thread Chris Bowditch

On 18/08/2011 18:32, Rita Greenberg wrote:

Hello.


Hi Rita,


In FOP version 0.20.5 the following code preserved white spaces in text.
I'm in the process of converting to FOP version 1.0 and the same piece of code
does not preserve the white spaces.

fo:list-item-body start-indent=body-start() end-indent=3mm
   xsl:for-each select=RCEXPLANATION/LINE
 fo:block white-space-collapse=false
   xsl:apply-templates/
 /fo:block
   /xsl:for-each
/fo:list-item-body


white-space-collapse will stop multiple spaces being merged into one. 
You also need white-space-treatment=preserve to stop whitespace at the 
start and end of lines being suppressed.



Is there anything that I can do to preserve the white spaces?

Thank you,
Rita


Thanks,

Chris



-
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: Any advance on Retrieve-table-Marker or alternative omit intial header workaround?

2011-08-19 Thread Chris Bowditch

On 19/08/2011 02:55, champagne_chary wrote:

Hello,


Hi,


Like many I would like to implement the modification of table headers. Is it
being worked on by anybody? Is it something we can look forward to? I can
only just imagine the volume of work required to impliment it.

I also read about a patch/hack to
http://old.nabble.com/omit-first-table-header-last-footer-td25640345.html#a32292028
Omit first table header.


I've seen your e-mail on fop-dev. Carlos' patch implements an extension 
to omit table header on the first area generated by the table. That 
helps in simple scenarios where you just want Table Continued text for 
example. This may be enough for some folks. My colleague Vincent has 
prepared the design for implementing table markers although I believe 
they will be limited to 1 line of text. Watch this space as we will 
start work on this in the coming months.




I have posted a request for the same bu if anybody else has I would be very
greatful

Thanks


Thanks,

Chris


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



different footer for last page

2011-08-19 Thread Furst, Tom
Hello,

I am having problems getting a different footer on the final page of PDFs I am 
generating from FOP 1.0. I have the following in my stylesheet:

fo:page-sequence-master master-name=chapters
fo:repeatable-page-master-alternatives
fo:conditional-page-master-reference odd-or-even=odd 
master-reference=page/
fo:conditional-page-master-reference odd-or-even=even 
master-reference=page-even/
fo:conditional-page-master-reference odd-or-even=odd 
page-position=last master-reference=page-last/
fo:conditional-page-master-reference odd-or-even=even 
page-position=last master-reference=page-even-last/
/fo:repeatable-page-master-alternatives
/fo:page-sequence-master

I have created the simple-page-master for each, page-last and page-even-last, 
where I identified the new region-after for each.

Does FOP support the use of the 'page-position' property? I am getting my 
different headers/footers for even odd, just not for the last page. Any help 
will be much appreciated.

Thanks,

Tom


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



Re: Preserving White Spaces in FOP 1.0

2011-08-19 Thread Rita Greenberg
Chris Bowditch bowditch_chris at hotmail.com writes:

 
 white-space-collapse will stop multiple spaces being merged into one. 
 You also need white-space-treatment=preserve to stop whitespace at the 
 start and end of lines being suppressed.

Thanks so much Chris - that took care of my problem!


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



Re: TransformerConfigurationException

2011-08-19 Thread J.Pietschmann
Am 19.08.2011 11:00, schrieb KAMOHELO MOFOKENG:
 I used the same stylesheet that worked on a standalone code, see below:

 xsl:stylesheet version=1.1
   
I guess the xslt processor used by JApplet is thrown off
by this version. Try 1.0

J.Pietschmann

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



Re: Any advance on Retrieve-table-Marker or alternative omit intial header workaround?

2011-08-19 Thread champagne_chary

HEllo,

Fantastic news.. glad to hear there is some progress towards this missing
implementation. 

Unfortunately I am not even competent enough to get Calos' patch working but
shall persist as it sounds as if it will be more than adequate.

Regards

 

cbowditch wrote:
 
 On 19/08/2011 02:55, champagne_chary wrote:
 Hello,
 
 Hi,
 
 Like many I would like to implement the modification of table headers. Is
 it
 being worked on by anybody? Is it something we can look forward to? I can
 only just imagine the volume of work required to impliment it.

 I also read about a patch/hack to
 http://old.nabble.com/omit-first-table-header-last-footer-td25640345.html#a32292028
 Omit first table header.
 
 I've seen your e-mail on fop-dev. Carlos' patch implements an extension 
 to omit table header on the first area generated by the table. That 
 helps in simple scenarios where you just want Table Continued text for 
 example. This may be enough for some folks. My colleague Vincent has 
 prepared the design for implementing table markers although I believe 
 they will be limited to 1 line of text. Watch this space as we will 
 start work on this in the coming months.
 

 I have posted a request for the same bu if anybody else has I would be
 very
 greatful

 Thanks
 
 Thanks,
 
 Chris
 
 
 -
 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/Any-advance-on-Retrieve-table-Marker-or-alternative-omit-intial-header-workaround--tp32292053p32298957.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



Re: fo:marker bleeding issue [fop 0.95 FOP 1.0]

2011-08-19 Thread champagne_chary

One line is all it need.. If only I could get to grips with the method used/
see how xslt is formated to produce given xsl.fo



cbowditch wrote:
 
 On 18/08/2011 13:25, champagne_chary wrote:
 Hello,
 
 Hi,
 
 Sorry to revive this year old post.

 I'm completly new to this and what you seem to have achieved -despite
 this
 minor glitch- is exactly what I would like to implement. However I'm a
 complete newb..I can see the fo but would be interested in seeing how and
 where you have placed the markers to achieve this.
 If you can post/ or pm me I'd be very thankful as hours of googling and
 failed attempts at pacing headers have lead to nothing but failure.
 
 I don't think there is a way to simulate table markers properly in the 
 current FOP version. As the original poster indicates, he can getting 
 close to a working solution with regular markers but there are some 
 corner cases where it doesn't work. I am not aware of a way to get it 
 fully working, however, some of my colleagues have been looking into 
 implementing table Markers. This is on our TODO list, but I think the 
 planned implementation is still limited to 1 line of text in the header. 
 Vincent, please correct me if I'm wrong.
 
 Hope you receive this and can help.

 Thanks

 
 Thanks,
 
 Chris
 


 bonekrusher wrote:
 Hi,

 In order to have table headers continued in my pdf output, I am using
 markers. Everything works fine until there is more then one line on the
 1st marker and there is a second marker. If the 1st marker is more than
 one line and I add a second marker, the marker bleeds into the table on
 the second page (see attached pdf). One solution to to increase the
 @margin-top on the region-body. The problem with that is  there are many
 times when the markers are not needed and there is a huge whitespace
 where
 the markers would go. For example, if the margin-top=1.0in, there
 would
 be a one inch whitespace if the markers are not called.

 See attached example fo and pdf. Page 2 of the pdf is where the problem
 occurs. I need the table to start below Table 3. Table Title Marker -
 Continued.

 I am not sure how to resolve this.
   http://old.nabble.com/file/p29532209/testMaint.fo testMaint.fo
   http://old.nabble.com/file/p29532209/example.pdf example.pdf

 Thanks for the help

 
 
 -
 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/fo%3Amarker-bleeding-issue--fop-0.95---FOP-1.0--tp29532209p32298969.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



Re: Page breaks for program listings

2011-08-19 Thread David Cramer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'd suggest asking this on the docbook-apps mailing list:

http://wiki.docbook.org/DocBookDiscussion

David

On 08/19/2011 03:58 AM, mike 675 wrote:
 
 Using FOP 1.0. Docbook XML - FO - PDF.
 
 Some of the page breaks for my  programlistings look bad. They leave a
 single orphan line at the bottom of the page.
 
 I have tried the following FO processing instructions for the relevant
 blocks, but they have no effect.
 
 ?dbfo keep-together=always ?  (is this only for formal objects --
 tables, figures etc?)
 
 ?dbfo-need height=2in ? (this does not push the following block on to
 the next page, as expected)

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOTwmXAAoJEMHeSXG7afUhb+YH/RLlFZuPoZvecYpwhTgvIKMo
3W7socyVqhQGk1EfnMNAUKFHboEkp5B6JqPa+TD5kvOjj1E9D5OPTRUbNWl5J/Hi
yq41KMpF09kjK1Y0+bkWG1Y0PjlHB0xDAvN8rIK8qQDLLa82ZzRM0DLTCquTJ2r7
oiMpGMvH4kR10t58maW7JyB0I18HqZOlEWnbmCuGa/qFDeSjr2xCvM5ZQkcMOTBX
aUh74ePYBscZWp27hLyZts32eC4evgOj1q5PqnPcqWKboyLbDeGKY6Mg5B4XUmkQ
ZTGVqdBBRKLtH3KqmGwI8fCwK1OQV60IZwL/plA6pwytxAeZKvYme9h5wUrj0lk=
=lru/
-END PGP SIGNATURE-

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