You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Passero <ya...@telenet.be> on 2009/08/11 12:46:48 UTC

Adding layout at runtime

I am writing a java application for the school were my girlfriend works so
teachers can enter the grades of the students and then print the reportcard.
Everything is almost complete,  the PDF files are nicely generated but their
is 1 feature i don't know how to implement... 

On every reportcard a teacher can add a custom remark for the student. 
My XML is generated on the fly by looping a few resultSets.

I have an XSLT and then generate the PDF from both files. 
Teachers want to use bold and underline in the remarks but i don't have a
clue how i can translate them into the pdf. 

As far as i know it's not really possible because the remark text will be
part of the xml and when the xml is merged with the XSLT to generate the fo
part, the xml on his part doesn't get interpreted like the XSLT. 

The part that i have in the XSLT: 

<fo:block>
  <xsl:value-of selec="REMARK"/>
<fo:block>

The XML: 

<REMARK>
 line1
 line2
</REMARK>

I have tryed a few things in the remark tags but nothing seems to work. I
even tryed this: 
<remark>
  <fo:block>remark1</fo:block>
  <fo:block>remark2</fo:block>
</remark>

I thought it wouldn't work but i only could try :) 

Does anybody have a solution on how i can add text with layout to the
generated PDF without adding it to the XSLT? 
Adding it on the fly to the XSLT is also not really possible because i
generate all the report cards of all the students in 1 PDF. If i would
generate a seperate PDF per report card than i can easily generate the XSLT
on the fly but this is not really userfriendly... unless it is possible to
add to a pdf but that i also don't know how to do it... 
-- 
View this message in context: http://www.nabble.com/Adding-layout-at-runtime-tp24915288p24915288.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


AW: Adding layout at runtime

Posted by Georg Datterl <ge...@geneon.de>.
Hi Yannick, 

In your XML write the HTML tags:

<REMARK> The Student <b>W. H. Oever</b> is <i>dead</i><REMARK>

And in your transformation, you just have to interpret the tags:

	<xsl:template match="i">
		<fo:inline font-style="italic">
			<xsl:apply-templates/>
		</fo:inline>
	</xsl:template>
	<xsl:template match="u">
		<fo:inline text-decoration="underline">
			<xsl:apply-templates/>
		</fo:inline>
	</xsl:template>
	<xsl:template match="b">
		<fo:inline font-weight="bold">
			<xsl:apply-templates/>
		</fo:inline>
	</xsl:template>
and so on...

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: Passero [mailto:yannick.ongena@telenet.be] 
Gesendet: Dienstag, 11. August 2009 12:47
An: fop-users@xmlgraphics.apache.org
Betreff: Adding layout at runtime


I am writing a java application for the school were my girlfriend works so teachers can enter the grades of the students and then print the reportcard.
Everything is almost complete,  the PDF files are nicely generated but their is 1 feature i don't know how to implement... 

On every reportcard a teacher can add a custom remark for the student. 
My XML is generated on the fly by looping a few resultSets.

I have an XSLT and then generate the PDF from both files. 
Teachers want to use bold and underline in the remarks but i don't have a clue how i can translate them into the pdf. 

As far as i know it's not really possible because the remark text will be part of the xml and when the xml is merged with the XSLT to generate the fo part, the xml on his part doesn't get interpreted like the XSLT. 

The part that i have in the XSLT: 

<fo:block>
  <xsl:value-of selec="REMARK"/>
<fo:block>

The XML: 

<REMARK>
 line1
 line2
</REMARK>

I have tryed a few things in the remark tags but nothing seems to work. I even tryed this: 
<remark>
  <fo:block>remark1</fo:block>
  <fo:block>remark2</fo:block>
</remark>

I thought it wouldn't work but i only could try :) 

Does anybody have a solution on how i can add text with layout to the generated PDF without adding it to the XSLT? 
Adding it on the fly to the XSLT is also not really possible because i generate all the report cards of all the students in 1 PDF. If i would generate a seperate PDF per report card than i can easily generate the XSLT on the fly but this is not really userfriendly... unless it is possible to add to a pdf but that i also don't know how to do it... 
--
View this message in context: http://www.nabble.com/Adding-layout-at-runtime-tp24915288p24915288.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


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