You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Niko Desrumaux <Ni...@inno.com> on 2000/08/03 15:17:26 UTC

Height of textarea

Hello !

How can I control the height of a textarea.

For example: a textarea containing comments.

<xsl:variable name="nLinesComment">4</xsl:variable>
<xsl:for-each select="Advertorial1/comment">
<xsl:if test="position() &lt; ($nLinesComment + 1)">
<xsl:variable name="vComment"><xsl:value-of select="."/></xsl:variable>
<fo:block wrap-option="no-wrap" white-space-treatment="preserve"
color="black" font-family="Helvetica" font-style="italic" font-size="9pt"
line-height="12.15pt" text-align="start">
<xsl:choose>
<xsl:when test = "string-length($vComment) = 0">&#160;</xsl:when>
<xsl:otherwise><xsl:value-of select="$vComment"/></xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:if>
</xsl:for-each>

This XSL supposes that each <comment>BLABLA</comment> contains 1 line. So I
count the number of <comment> tags to fix the height of the comment
textarea.
Problem: The user must define the XML-data by using a HTML textarea. I tried
to map the width of the textarea to the width of the area in the PDF. By
defining the HTML textarea as "WRAP="HARD"" and substituting each LF by
</comment><comment>, I can achieve that each HTML line corresponds to 1
<comment>BLABLA</comment>. In FO I define the fo:block as
"wrap-option="no-wrap"".
Problem: Helvetica in HTML seems to be different than Helvetica in PDF. So
the width of the line entered by the user is different from the width
produced by FOP. The width of "iiiiiiiiiiiiiii" will be shorter than
"01234567812345667".

Solution ?

Can I do something like:

<fo:block line-height="10cm">
<fo:block white-space-treatment="preserve" color="black"
font-family="Helvetica" font-style="italic" font-size="9pt" line-
height="12.15pt" text-align="start">
</fo:block>

This fails...

I'd like to obtain that the surplus lines are hidden if they exceed the
maximum height of the textarea.

Regards,

Niko


Problem browser

Posted by Niko Desrumaux <Ni...@inno.com>.
Hello !

I'm building a webapplication that uses FOP to produce PDF-files. The server
produces the PDF-file and the client is able to download a preview by using
the IE Acrobat Reader plugin.

Problem: The browser (IE) that loaded the PDF might crash when the user
closes the browser. This occurs only when the browser is still BUSY with
loading the PDF or loading the photo's. So when the user closes the browser
AFTER the PDF was loaded, everything works fine. I don't have problems with
small PDFs because they can be loaded in no time. PDFs with lots of photos
take approximately 3 seconds to load. Closing the browser during that time
causes a crash.

Crash:
On WinNT the Active Desktop (Explorer process) consumes 100% of the CPU
(infinite loop). The process never stops !
On Win98 the browser consumes 100% of the CPU for +/- 1 minute and then it
closes the browser.

Is this a bug in Internet Explorer, Acrobat Reader or FOP ?
Help !

Regards,

Niko Desrumaux