Populating data dynamically from the DB using Apache FOP

2010-02-10 Thread RithanyaLaxmi

Hi,

I using Apache FOP for PDF generation, i have the XML with header and footer
information in the bodycontent i have a placeholder, for eg,

Temp.xml


Sample Header


[[bodycontent to be populated dynamically from DB]]


Sample Footer


Temp.xsl,

will have the XSL tags with the layout, styles, etc.

Using Apache FOP API i need to fetch the data from the DB (using javax.sql),
and replace the placeholder with the data in it and then use the XSL to
apply the styles,etc to generate a PDF?
I know the latter, i am not sure how to read the XML and replace the
placeholder with the data fetched from DB using apache FOP. I know that
Apache FOP uses SAX by default. Please do provide the code to parse the
Temp.xml and replace the place holder with data using apache FOP. If there
is any sample links please do provide that as well.


Thanks,
Rithu 
-- 
View this message in context: 
http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27542925.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: AW: AW: AW: AW: AW: Table height issue

2010-02-10 Thread rOnnie974

Hello, it's me again,

I am back on this work and after several tests, I figured out that my area
tree has only elements with absolute positioning, left and top offset
explicitely precized.
It is boring for me as I cannot work only on my specific block to adjust it
(padding, height, etc.), I have to manage its offset and also to deal with
every elements under it.

Is there a way to do it easily ? Or to generate an area tree with relative
positioning for all elements ?

Thanks in advance.

Ronnie


Georg Datterl-2 wrote:
> 
> Hi Ronnie,
> 
> That's only because you have not yet asked questions that need input from
> the real experts here. :-)
> 
> Regards,
> 
> Georg Datterl
> 
> -- Kontakt --
> 
> Georg Datterl
> 
> Geneon media solutions gmbh
> Gutenstetter Straße 8a
> 90449 Nürnberg
> 
> HRB Nürnberg: 17193
> Geschäftsführer: Yong-Harry Steiert
> 
> Tel.: 0911/36 78 88 - 26
> Fax: 0911/36 78 88 - 20
> 
> www.geneon.de
> 
> Weitere Mitglieder der Willmy MediaGroup:
> 
> IRS Integrated Realization Services GmbH:www.irs-nbg.de
> Willmy PrintMedia GmbH:www.willmy.de
> Willmy Consult & Content GmbH: www.willmycc.de
> -Ursprüngliche Nachricht-
> Von: rOnnie974 [mailto:ronnie.ba...@gmail.com]
> Gesendet: Freitag, 5. Februar 2010 13:06
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: AW: AW: AW: AW: Table height issue
> 
> 
> You are my hero.
> 
> Thank you very much.
> 
> 
> Georg Datterl-2 wrote:
>>
>> Hi Ronnie,
>>
>> Basically:
>> areaTree is the root.
>> pageSequence is a page sequence from your fo file page is a single
>> page in your pdf regionBefore is the header regionAfter is the footer
>> regionBody is the body of the page
>>
>> then there's lots of stuff to ignore. To find the block you are
>> interested in, search for the id. id="XXX" in fo will be translated to
>> prod-id="XXX".
>> bpd is block-progression-dimension, which means block height.
>>
>> In your code you can use Xpath to read information, but I'd advise you
>> to trim the document first. If you know all information you need is in
>> one page-sequence, trim away all other sequences to make xpath way
>> faster.
>>
>> Regards,
>>
>> Georg Datterl
>>
>> -- Kontakt --
>>
>> Georg Datterl
>>
>> Geneon media solutions gmbh
>> Gutenstetter Straße 8a
>> 90449 Nürnberg
>>
>> HRB Nürnberg: 17193
>> Geschäftsführer: Yong-Harry Steiert
>>
>> Tel.: 0911/36 78 88 - 26
>> Fax: 0911/36 78 88 - 20
>>
>> www.geneon.de
>>
>> Weitere Mitglieder der Willmy MediaGroup:
>>
>> IRS Integrated Realization Services GmbH:www.irs-nbg.de
>> Willmy PrintMedia GmbH:www.willmy.de
>> Willmy Consult & Content GmbH: www.willmycc.de
>> -Ursprüngliche Nachricht-
>> Von: rOnnie974 [mailto:ronnie.ba...@gmail.com]
>> Gesendet: Freitag, 5. Februar 2010 12:48
>> An: fop-users@xmlgraphics.apache.org
>> Betreff: Re: AW: AW: AW: Table height issue
>>
>>
>> I just found xmlindent.com and got a 2656 lines file... Gonna a big
>> headache%-|
>>
>>
>> Georg Datterl-2 wrote:
>>>
>>> Hi Ronnie,
>>>
>>> I run the Document object through
>>>
>>> public static String toString(Document document) throws
>>> TransformerException {
>>> StringWriter stringWriter = new StringWriter();
>>> StreamResult streamResult = new StreamResult(stringWriter);
>>> TransformerFactory transformerFactory =
>>> TransformerFactory.newInstance();
>>> Transformer transformer = transformerFactory.newTransformer();
>>> transformer.setOutputProperty(OutputKeys.INDENT, "yes");
>>>
>>> transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amo
>>> u
>>> nt",
>>> "2");
>>> transformer.setOutputProperty(OutputKeys.METHOD, "xml");
>>> transformer.transform(new
>>> DOMSource(document.getDocumentElement()), streamResult);
>>> return stringWriter.toString();
>>> }
>>>
>>> and copy the resulting String into XMLSpy.
>>>
>>> Regards,
>>>
>>> Georg Datterl
>>>
>>> -- Kontakt --
>>>
>>> Georg Datterl
>>>
>>> Geneon media solutions gmbh
>>> Gutenstetter Straße 8a
>>> 90449 Nürnberg
>>>
>>> HRB Nürnberg: 17193
>>> Geschäftsführer: Yong-Harry Steiert
>>>
>>> Tel.: 0911/36 78 88 - 26
>>> Fax: 0911/36 78 88 - 20
>>>
>>> www.geneon.de
>>>
>>> Weitere Mitglieder der Willmy MediaGroup:
>>>
>>> IRS Integrated Realization Services GmbH:www.irs-nbg.de
>>> Willmy PrintMedia GmbH:www.willmy.de
>>> Willmy Consult & Content GmbH: www.willmycc.de
>>> -Ursprüngliche Nachricht-
>>> Von: rOnnie974 [mailto:ronnie.ba...@gmail.com]
>>> Gesendet: Freitag, 5. Februar 2010 12:29
>>> An: fop-users@xmlgraphics.apache.org
>>> Betreff: Re: AW: AW: Table height issue
>>>
>>>
>>> THANK YOU for your complete answer !
>>>
>>> Before you answered me, I made some researchs and succeeded in
>>> generating an area tree file.
>>>
>>> Now I have to understand this file, and, before, to indent it !

Re: Extra line spacing

2010-02-10 Thread Gregory Buchenberger
Thanks Pascal. I'll submit it to the bug tracker.

On Wed, Feb 10, 2010 at 2:38 AM, Pascal Sancho wrote:

> Hi Greg,
>
> That sounds like a bug...
> This is caused by the space-after property witch is set on an fo:block
> nested in an fo:inline.
> the space-after is drawn for the 1st line of the nested fo:block, not
> the last line
> See short XSL-FO attached.
>
> Workaround: replace the surrounding fo:inline with an fo:wrapper, witch
> generates no area.
>
> I've don't checked if there is yet a reported bug about this issue. Can
> you  fill in a bug if no, please?
>
> Pascal
>
> Gregory Buchenberger a écrit :
> > Hello,
> >
> > On page 25 of the PDF under the line "This black and white photo shows
> > a two-" the line spacing is more than the following lines. The same
> > thing happens on page 30 after the text "This is a map showing dust
> > storm damage". The XSL-FO representing that portion of the PDF is the
> > following:
> >
> > 
> >   
> > 
> >   This black and white photo shows a two-wheeled wagon
> >   piled high with cloth sacks filled with goods. Another
> >   sack lies on the grass next to the wagon.  The wagon
> >   has the thin tires and criss-cross pattern of spokes
> >   on the wheels that are characteristic of the 1930s.
> > 
> >   
> > 
> >
> > The line-spacing attribute should be 1.5em throughout the document.
> > Does anyone know why this extra line spacing is being rendered?
> >
> > I'm using FOP trunk (as of early December). I've attached the PDF
> > document and the XSL-FO used to render it. Your help is greatly
> > appreciated.
> >
> > Kind Regards,
> >
> > Gregory Buchenberger, CDIA+, ECMs
> >
>
>
>
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
>


Re: Adding an image or character to denote line-wrap locations?

2010-02-10 Thread Jared Smith
- "Vincent Hennebert"  wrote:
> The requirements of the present case are different. Stylesheets doing
> things like the above are just abusing the hyphenation-character
> property.

Thanks for enlightening me.  That makes more sense now.  Still, I'm wondering 
if the inability to add a line-wrap character for verbatim sections is a 
limitation of FOP or XSL-FO in general.

-- 
Jared Smith
Digium, Inc.

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



RE: How to balance table columns?

2010-02-10 Thread Mario Madunic
Sorry for it to make more sense here is the xpath I would test

$var/child::*[position() lt count($var//child::*)/2 + 1]
$var/child::*[position() gt count($var//child::*)/2]

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-Original Message-
From: Mario Madunic [mailto:mario_madu...@newflyer.com] 
Sent: Wednesday, February 10, 2010 6:50 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: How to balance table columns?

You might want to post this up on the XSLT list.

So here is how I would do it

First is create a temp node variable containing all the left and right strings 
as child of the var. Get a count of the child nodes (left and right) divide by 
two (round up or down your choice) then create the table and 
copy-of/apply-templates to child::*[position() lt half + 1] and for the right 
side child::*[position() gt half] in the left and right table cells 
accordingly. Now that is not exact without testing and is only an outline but I 
hope it give you a general idea of how it might be done.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-Original Message-
From: lexa2009 [mailto:myworkac...@gmail.com] 
Sent: Wednesday, February 10, 2010 5:59 AM
To: fop-users@xmlgraphics.apache.org
Subject: How to balance table columns?


Hello!
for example i have a simple table with 2 columns. like this:

leftstring1  rightstring1
leftstring2  rightstring2
leftstring3  rightstring3
leftstring4  rightstring4
leftstring5
leftstring6

i do not know how many of each string will be, but i want this table

leftstring1  leftstring6
leftstring2  rightstring1
leftstring3  rightstring2
leftstring4  rightstring3
leftstring5  rightstring4

how to balance columns? how to make table of smallest height?
-- 
View this message in context: 
http://old.nabble.com/How-to-balance-table-columns--tp27530072p27530072.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



Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.


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



Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.


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



RE: How to balance table columns?

2010-02-10 Thread Mario Madunic
You might want to post this up on the XSLT list.

So here is how I would do it

First is create a temp node variable containing all the left and right strings 
as child of the var. Get a count of the child nodes (left and right) divide by 
two (round up or down your choice) then create the table and 
copy-of/apply-templates to child::*[position() lt half + 1] and for the right 
side child::*[position() gt half] in the left and right table cells 
accordingly. Now that is not exact without testing and is only an outline but I 
hope it give you a general idea of how it might be done.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-Original Message-
From: lexa2009 [mailto:myworkac...@gmail.com] 
Sent: Wednesday, February 10, 2010 5:59 AM
To: fop-users@xmlgraphics.apache.org
Subject: How to balance table columns?


Hello!
for example i have a simple table with 2 columns. like this:

leftstring1  rightstring1
leftstring2  rightstring2
leftstring3  rightstring3
leftstring4  rightstring4
leftstring5
leftstring6

i do not know how many of each string will be, but i want this table

leftstring1  leftstring6
leftstring2  rightstring1
leftstring3  rightstring2
leftstring4  rightstring3
leftstring5  rightstring4

how to balance columns? how to make table of smallest height?
-- 
View this message in context: 
http://old.nabble.com/How-to-balance-table-columns--tp27530072p27530072.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



Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.


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



RE: site with good tutorial on floating blocks

2010-02-10 Thread Mario Madunic
I thought FO would behave “just” like CSS but I guess that comes from not 
working in print that much and seeing how many of FO’s attributes are the same 
as CSS. Gave me a false sense of security but I’m starting to get the hang of 
it.

 

Marijan (Mario) Madunic

Publishing Specialist

New Flyer Industries

 

From: Arian [mailto:armyofda12mnk...@gmail.com] 
Sent: Tuesday, February 09, 2010 2:30 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: site with good tutorial on floating blocks

 

Cool, On a sidenote, today I had the fun chance to do this 
rounded-corner/gradient design in xsl-fo 
(http://arianhojat.com/temp/confidential_whole_2.gif). Since the area was fixed 
width, I used that top header part as an image which extends the border 
downwards, and a bottom-aligned image which extends the border/gradient fade-in 
upwards. Then just used margins to put the text from touching the header image. 
So just needed 2 sibling blocks to do it (header and body blocks basically), 
wished though it was more like css rounded corners with options to do it via 
wrappers, negative margins, floats etc. Didn't really seem like xsl-fo could do 
it easily via those css-type methods.

In retrospect, I am just patting myself on the back in this email :).

-Arian



On Tue, Feb 9, 2010 at 11:56 AM, Mario Madunic  
wrote:

Ari, I take that back about tables. Just looked at how notes are done in DITA 
and see that a table is used.

 

Marijan (Mario) Madunic

Publishing Specialist

New Flyer Industries

 

From: Mario Madunic [mailto:mario_madu...@newflyer.com] 
Sent: Tuesday, February 09, 2010 10:11 AM


To: fop-users@xmlgraphics.apache.org

Subject: RE: site with good tutorial on floating blocks

 

Ari, could do it easy enough with a table but want to keep away from tag abuse 
(imo why most web sites are abysmal code wise). I’m thinking more on the lines 
of WAI and screen readers. Don’t want the page to be too confusing to the 
reader. I was actually thinking of using an outdent and setting the image 
associated with the block as the first part of the block. Hopefully that is not 
clear as mud.

 

But have I missed your point?

 

Marijan (Mario) Madunic

Publishing Specialist

New Flyer Industries

 

From: Yoink Boink [mailto:armyofda12mnk...@gmail.com] 
Sent: Tuesday, February 09, 2010 9:50 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: site with good tutorial on floating blocks

 

I just get by using tables. I now understand why the Web 1.0 generation 
developer hated tables for layout ;).
Ari

On Tue, Feb 9, 2010 at 10:46 AM, Pascal Sancho  wrote:

Googlize "usecases xsl-fo float".

Note that FOP doesn't support for fo:float.

Pascal

Mario Madunic a écrit :

> Anyone have a link to a good tutorial on how to float blocks? What I'm 
> looking for in particular is to have a block with 2 blocks inside it. The 
> inner two blocks would be side by side.
>
> Marijan (Mario) Madunic
>

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

 

 



P Please consider the environment before printing this e-mail.


CONFIDENTIALITY STATEMENT: This communication (and any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.

 



P Please consider the environment before printing this e-mail.


CONFIDENTIALITY STATEMENT: This communication (and any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.

 



How to balance table columns?

2010-02-10 Thread lexa2009

Hello!
for example i have a simple table with 2 columns. like this:

leftstring1  rightstring1
leftstring2  rightstring2
leftstring3  rightstring3
leftstring4  rightstring4
leftstring5
leftstring6

i do not know how many of each string will be, but i want this table

leftstring1  leftstring6
leftstring2  rightstring1
leftstring3  rightstring2
leftstring4  rightstring3
leftstring5  rightstring4

how to balance columns? how to make table of smallest height?
-- 
View this message in context: 
http://old.nabble.com/How-to-balance-table-columns--tp27530072p27530072.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: Adding an image or character to denote line-wrap locations?

2010-02-10 Thread Vincent Hennebert
Hi Jared,

Jared Smith wrote:
> On Tue, 2010-02-09 at 11:03 +, Vincent Hennebert wrote:
>> To my knowledge there is no possibility to achieve that in plain XSL-FO.
>> I think the best way of handling this issue is to perform line breaks
>> manually. That’s probably what you want anyway, as you will break at
>> sensible places while an automatic process would blindly break after,
>> say, each 80 characters, be it in the middle of a keyword or not.
> 
> Is this simply a missing feature in FOP, or something missing in XSL-FO?
> I see many XSL stylesheets do something like:
> 
>  use-attribute-sets="verbatim.properties monospace.properties">
>start
>wrap
>\
> 
> 
> But FOP doesn't even add the hyphenation character at all when it wraps
> a long line.

It does. Like its name indicates, the hyphenation-character property
specifies which character should be used when hyphenating a word. So it
will be used only when a line break occurs within a word.

The requirements of the present case are different. Stylesheets doing
things like the above are just abusing the hyphenation-character
property.

HTH,
Vincent


> --
> Jared Smith
> Digium, Inc.

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



Re: Extra line spacing

2010-02-10 Thread Pascal Sancho
Hi Greg,

That sounds like a bug...
This is caused by the space-after property witch is set on an fo:block
nested in an fo:inline.
the space-after is drawn for the 1st line of the nested fo:block, not
the last line
See short XSL-FO attached.

Workaround: replace the surrounding fo:inline with an fo:wrapper, witch
generates no area.

I've don't checked if there is yet a reported bug about this issue. Can
you  fill in a bug if no, please?

Pascal

Gregory Buchenberger a écrit :
> Hello,
>
> On page 25 of the PDF under the line "This black and white photo shows
> a two-" the line spacing is more than the following lines. The same
> thing happens on page 30 after the text "This is a map showing dust
> storm damage". The XSL-FO representing that portion of the PDF is the
> following:
>
> 
>   
> 
>   This black and white photo shows a two-wheeled wagon
>   piled high with cloth sacks filled with goods. Another
>   sack lies on the grass next to the wagon.  The wagon
>   has the thin tires and criss-cross pattern of spokes
>   on the wheels that are characteristic of the 1930s.
> 
>   
> 
>
> The line-spacing attribute should be 1.5em throughout the document.
> Does anyone know why this extra line spacing is being rendered?
>
> I'm using FOP trunk (as of early December). I've attached the PDF
> document and the XSL-FO used to render it. Your help is greatly
> appreciated.
>
> Kind Regards,
>
> Gregory Buchenberger, CDIA+, ECMs
>   


http://www.w3.org/1999/XSL/Format"; font-size="18">
  

  

  
  

  

  
This black and white photo shows a makeshift home during the Depression.
  

The Great Depression caused immediate hardship on everyday life.
  

  

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