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 Frank Niedermann <fb...@thelogic.org> on 2009/01/22 10:30:00 UTC

Possible to disable automatic line-break?

Hi,

we are using Apache FOP 0.95 to generate PDF documents from within a Java
application.

The output is displayed like a card on the page using page margins.
Sometimes we have text that does not fit in one line, and automatic
line-break causes the last line on the bottom to drop out of the card area.

Before FOP we where using LaTeX which simply cut the text on the right side
of the card if it was to long.

I have created a small image file (PNG format) to demonstrate the issue. 
http://www.nabble.com/file/p21600611/fop.png 

Is there a way to tell FOP not to automatically do line-break and instead of
that simply cut or ignore text that is too long for a line?

This is the stylesheet we are using:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <fo:root>

			<!-- define layout templates -->
      <fo:layout-master-set>
				<!-- define layout template named "kanban" -->
        <fo:simple-page-master master-name="kanban"
              page-height="215.9mm" page-width="279.4mm" margin-top="88mm"
margin-bottom="86mm" margin-left="150mm" margin-right="58mm">
          <fo:region-body margin-right="9mm" margin-top="0mm"
margin-bottom="0mm" background-color="#ffffff" reference-orientation="180"
/>
          <fo:region-end extent="8mm" background-color="#1e90ff"
reference-orientation="90" display-align="center"/>
        </fo:simple-page-master>
      </fo:layout-master-set>

			<!-- page contents, refering to a template -->
      <fo:page-sequence master-reference="kanban">
				<fo:static-content flow-name="xsl-region-end">
          <fo:block text-align="center" padding="0mm">
						<xsl:value-of select="steuerdaten/anlieferort"/>
          </fo:block>
				</fo:static-content>
        <fo:flow flow-name="xsl-region-body">
          <fo:block font-size="6pt" border="1 solid black">
						<fo:table border="0 solid black" table-layout="fixed" width="100%">
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell border="0 solid blue" padding="0.3mm">
										<fo:block>Druckdatum: <xsl:value-of
select="steuerdaten/vdatum"/></fo:block>
									</fo:table-cell>
									<fo:table-cell border="0 solid blue" padding="0.3mm">
										<fo:block>Schleife Nr.: <xsl:value-of
select="steuerdaten/schleife"/></fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-row>
							</fo:table-body>
						</fo:table>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
</xsl:stylesheet

Thanks,
  Frank
-- 
View this message in context: http://www.nabble.com/Possible-to-disable-automatic-line-break--tp21600611p21600611.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: Possible to disable automatic line-break?

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

You could use keep-together.within-line=always to prevent a line break. But then the text would be printed into the right margin...

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: Frank Niedermann [mailto:fbn@thelogic.org] 
Gesendet: Donnerstag, 22. Januar 2009 10:30
An: fop-users@xmlgraphics.apache.org
Betreff: Possible to disable automatic line-break?


Hi,

we are using Apache FOP 0.95 to generate PDF documents from within a Java application.

The output is displayed like a card on the page using page margins.
Sometimes we have text that does not fit in one line, and automatic line-break causes the last line on the bottom to drop out of the card area.

Before FOP we where using LaTeX which simply cut the text on the right side of the card if it was to long.

I have created a small image file (PNG format) to demonstrate the issue. 
http://www.nabble.com/file/p21600611/fop.png 

Is there a way to tell FOP not to automatically do line-break and instead of that simply cut or ignore text that is too long for a line?

This is the stylesheet we are using:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <fo:root>

			<!-- define layout templates -->
      <fo:layout-master-set>
				<!-- define layout template named "kanban" -->
        <fo:simple-page-master master-name="kanban"
              page-height="215.9mm" page-width="279.4mm" margin-top="88mm"
margin-bottom="86mm" margin-left="150mm" margin-right="58mm">
          <fo:region-body margin-right="9mm" margin-top="0mm"
margin-bottom="0mm" background-color="#ffffff" reference-orientation="180"
/>
          <fo:region-end extent="8mm" background-color="#1e90ff"
reference-orientation="90" display-align="center"/>
        </fo:simple-page-master>
      </fo:layout-master-set>

			<!-- page contents, refering to a template -->
      <fo:page-sequence master-reference="kanban">
				<fo:static-content flow-name="xsl-region-end">
          <fo:block text-align="center" padding="0mm">
						<xsl:value-of select="steuerdaten/anlieferort"/>
          </fo:block>
				</fo:static-content>
        <fo:flow flow-name="xsl-region-body">
          <fo:block font-size="6pt" border="1 solid black">
						<fo:table border="0 solid black" table-layout="fixed" width="100%">
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell border="0 solid blue" padding="0.3mm">
										<fo:block>Druckdatum: <xsl:value-of select="steuerdaten/vdatum"/></fo:block>
									</fo:table-cell>
									<fo:table-cell border="0 solid blue" padding="0.3mm">
										<fo:block>Schleife Nr.: <xsl:value-of select="steuerdaten/schleife"/></fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-row>
							</fo:table-body>
						</fo:table>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
</xsl:stylesheet

Thanks,
  Frank
--
View this message in context: http://www.nabble.com/Possible-to-disable-automatic-line-break--tp21600611p21600611.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