Rank: Newbie
Joined: 3/25/2011 Posts: 1 Location: Poland
|
Hi!
I prepare xslt for pdf documents and I need to rotate text in table cell. Its' property (in style vision) -> "orientation" is set to "vertical(bottom to top)".
On html preview - it looks almost good -> text is rotated but words are't wrapped and cell is too long.
but on PDF preview - it's much worse -> text is rotated, but style vision's inserts breaks after every word and cell is too wide (text more looks like a list...)
Are there any other properties that must be set so that my text in cell would be well rotated and words wrapped without any breaks ?
Any help would be appreciated.
below there is some of xlst code generated by Style vision 2010->
<fo:table-body start-indent="0pt"> <xsl:variable name="altova:tablerows"> <fo:table-row height="3.22in"> <fo:table-cell border="solid 1pt gray" padding="2pt" display-align="after"> <fo:block> <fo:block-container reference-orientation="90" display-align="before"> <fo:block text-align="left"> <fo:inline text-align="justify" visibility="visible"> <xsl:text>test testtesttest testtest testtest test test test testtesttest testtest testtest test tes</xsl:text> </fo:inline> </fo:block> </fo:block-container> </fo:block> </fo:table-cell> </fo:table-row> </xsl:variable> <xsl:choose> <xsl:when test="string($altova:tablerows) or not(empty($altova:tablerows//fo:external-graphic))"> <xsl:copy-of select="$altova:tablerows"/> </xsl:when> <xsl:otherwise> <fo:table-row> <fo:table-cell> <fo:block/> </fo:table-cell> </fo:table-row> </xsl:otherwise> </xsl:choose> </fo:table-body>
|
Rank: Newbie
Joined: 4/19/2011 Posts: 2 Location: UK
|
I've just encountered the same issue, very annoying. I've finally managed to get this to work in my copy of Stylevision 2010.
Created a table, 2 column x 1 row. Set the first column to fixed width (in my case 3em) - this is going to be my rotated text (I need a vertical caption next to a diagram). Inside the thin column, add a conditional output (I deleted everything except for PDF and added an "Otherwise" branch for HTML, but that's up to you).
For PDF rotation, inside the appropriate condition, I added a new table of size 1x1 (set border to 0). Inside this table (single cell) I add the content I need rotated, and select cell -> Orientation to the desired rotation. For the content, I set the style: white-space:nowrap. This keeps the words together (no line breaks).
Inside the HTML conditional I put the same content, this time with the style: writing-mode: tb-rl. No need for any other tables. The HTML still gets a linebreak inside my text, but it tends to stick within the column (unlike the PDF). I didn't have good results with HTML white-space setting, so I didn't use it.
This should hopefully make it work for you too. I think Stylevision rotated text is implemented poorly in version 2010 (not tried any other versions).
|