Help! - Coverting From HTML to PDF using XSL FO - valign not working

Hi there,

I'm using the FOP from xml.apache.org/fop tool to convert from HTML
to PDF.

I'm reading the height and valign attributes of a column-cell (TD) in the XSL
file:

 <xsl:attribute-set name="table.data.td">
        <xsl:attribute name="border-style">solid</xsl:attribute>
     <xsl:attribute name="border-width">0pt</xsl:attribute>
     <xsl:attribute name="padding-start">0.3em</xsl:attribute>
     <xsl:attribute name="padding-end">0.2em</xsl:attribute>
     <xsl:attribute name="padding-before">2pt</xsl:attribute>
     <xsl:attribute name="padding-after">2pt</xsl:attribute>
  </xsl:attribute-set>


<!-- HTML table tag <td> -->
<xsl:template match="td">
  <fo:table-cell xsl:use-attribute-sets="table.data.td">
      <xsl:if test="@valign">
         <xsl:attribute name="display-align">
          <xsl:value-of select="@valign"/>
          </xsl:attribute>
       </xsl:if>
       <xsl:if test="@height">
         <xsl:attribute name="height">
         <xsl:value-of select="concat(@height,'px')"/>
      </xsl:attribute>
          </xsl:if>
       <xsl:if test="@class='smalltextwb'">
      <xsl:attribute name="font-family">Verdana, Arial, Helvetica, sans-serif</xsl:attribute>
         <xsl:attribute name="font-size">10px</xsl:attribute>
       <xsl:attribute name="font-weight">normal</xsl:attribute>
       <xsl:attribute name="color">#FFFFFF</xsl:attribute>
      </xsl:if>
      <fo:block>
            <xsl:if test="@align">
               <xsl:attribute name="text-align">
                  <xsl:value-of select="@align"/>
               </xsl:attribute>
            </xsl:if>
               <xsl:apply-templates/>
         </fo:block>
      </fo:table-cell>
   </xsl:template>

When the pdf is generated, the valign doesnt work when the height is mentioned
on the HTML:

<td height="100" valign="center"> --> Doesnt work

<td valign="center"> --> works

Does anyone has any idea why the height property prevents the aligning
of the column cell on the PDF?

Tell me if you need more information

Any help will be great,
James
ronibrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

somasekharCommented:
i don;t think this wil support html to PDF conversion. it supports xml to PDF

the following sourceforge might help you

http://www.lowagie.com/iText/docs.html

or else there is and odd way of doing it
install PDF writer and make it as your default PDF writer
open the html using Runtime API of java
on load call print function.
so the PDF file will be created same as HTML

hope this help
somasekhar
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.