Page 1 of 1

Tab spacing problem when converting from docx to pdf

PostPosted: Sat Jun 04, 2011 5:20 am
by ShinoKarun
Hi

I'm trying to convert a docx file to pdf with tab spaces between words but when i have more then one tab between words in the docx file the pdf file only outputs a one tab between the words instead of the 1+ tabs that i input. I have debugged the JAXB graph to find that the run nodes within a paragraph node hadeach a single element either a text node or a tab node. I created a test where I created a run node which contained more than one element (text and tabs). This produced the correct output. I have attached a pictures of the graph that was giving me the errors and the graph that i created. If anyone could help i would really appreciate it.

Examlpe:
docx: with three tab spaces

hello Jim
pdf:
hello Jim

Thannks
Shino

Re: Tab spacing problem when converting from docx to pdf

PostPosted: Fri Jan 20, 2012 10:32 pm
by Shex_
Hi,

Sorry for this late post.

I have the same problem. In my docx, the date is on the right of the document and others informations on the left. But in the PDF, the date is displayed after the others informations on the left.

Do you have any solutions ?

Thanks
Shex

PS : I'm french and my english is basic, sorry for the bad grammar.

Re: Tab spacing problem when converting from docx to pdf

PostPosted: Mon Jan 23, 2012 12:24 pm
by jason
At present, I'm afraid, tab handling in the PDF output is very simplistic (docx2fo.xslt):

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
<!--

<w:p>
        <w:pPr><w:tabs><w:tab w:val="left" w:pos="4320"/></w:tabs></w:pPr>
        <w:r><w:t xml:space="preserve">Will tab.. </w:t></w:r><w:r>
        <w:tab/>
        <w:t>3 inches</w:t></w:r>
</w:p>

-->
<xsl:template match="w:tab">
        <!--  Use this simple-minded approach from MS stylesheet,
              until our document model can do better.   -->
    <xsl:call-template name="OutputTlcChar">
      <xsl:with-param name="tlc">
        <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
      </xsl:with-param>
      <xsl:with-param name="count" select="3"/>
    </xsl:call-template>
</xsl:template>

 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


I'd be happy of course to accept contributed improvements to this.

In the meantime, maybe it is an option for you to change your docx to use a table with 2 cells, and paragraph align right to handle the date?

Re: Tab spacing problem when converting from docx to pdf

PostPosted: Wed Jan 25, 2012 3:45 am
by Shex_
Hi jason,

Thanks for your answer.

Like you say, to use a table with 2 cells enable to get round the tab spacing problem.
For the moment, this solution is enough to continue.

Thanks
Shex