Page 1 of 1

PDF conversion -> Table width

PostPosted: Fri Oct 26, 2012 1:41 am
by Timothy
Jason,

I have a table defined in docx as follow.

Code: Select all
<w:tbl>
  <w:tblPr />
- <w:tr>
- <w:tc>
- <w:p>
- <w:r>
- <w:rPr>
  <w:b w:val="true" />
  </w:rPr>
  <w:t />
  </w:r>
  </w:p>
  </w:tc>
  </w:tr>
- <w:tr>
- <w:tc>
- <w:p>
- <w:r>
- <w:rPr>
  <w:b w:val="false" />
  </w:rPr>
  <w:t>some text here...</w:t>
  </w:r>
  </w:p>
  </w:tc>
  </w:tr>
- <w:tr>
- <w:tc>
- <w:p>
- <w:r>
- <w:rPr>
  <w:b w:val="false" />
  </w:rPr>
  <w:t>some text here</w:t>
  </w:r>
  </w:p>
  </w:tc>
  </w:tr>
  </w:tbl>


When I show the table in word 2010 it is a small table with one column and three rows, containing the correct information. When I convert it to PDF the data is still correct, but the table's width is wrong. In PDF it takes the width of the whole page.

Can this be fixed?

Thx.

Timothy

Re: PDF conversion -> Table width

PostPosted: Wed Nov 07, 2012 12:52 am
by Timothy
Jason,

Have you had time to look into this issue?

Timothy

Re: PDF conversion -> Table width

PostPosted: Wed Nov 07, 2012 10:50 pm
by jason
The attached docx contains 5 tables. The last is yours.

When output as PDF, the first 4 tables have correct column widths, because they specify something like:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
      <w:tblGrid>
        <w:gridCol w:w="1885"/>
        <w:gridCol w:w="533"/>
      </w:tblGrid>
 
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Yours doesn't.

Since afaik FOP doesn't support auto column widths:

http://apache-fop.1065347.n5.nabble.com ... 15752.html

the most expedient solution would be for your code to write suitable w:gridCol values.

Re: PDF conversion -> Table width

PostPosted: Fri Aug 02, 2013 5:38 pm
by dazzfayaz
Hi,

First of all, i want to thank the docx4j team. You are doing a great job and I am very thankful.

I am converting docx to pdf and the problems i'm facing are
The table width in docx is not reflecting in pdf .
And the images in pdf are going out of table cell. How to fit them in to the table cell
Few of the symbols are not showing properly in pdf ,they are coming as unknown symbol but in docx they are proper.

Please help me out to get out of these probs.

Thanks & Regards.

Re: PDF conversion -> Table width

PostPosted: Fri Aug 02, 2013 6:48 pm
by jason
no chance of any help unless you attach a docx exhibiting the issues...

Re: PDF conversion -> Table width

PostPosted: Mon Aug 05, 2013 5:48 pm
by dazzfayaz
First of all, i want to thank the docx4j team. You are doing a great job and I am very thankful.

I am converting docx to pdf and the problems i'm facing are
The table width in docx is not reflecting in pdf .
And the images in pdf are going out of table cell. How to fit them in to the table cell

Please help me out to get out of these probs.
attached are the base docx and generated pdf after converting the docx to pdf.

Thanks & Regards.

Re: PDF conversion -> Table width

PostPosted: Mon Aug 05, 2013 8:16 pm
by jason
Need the docx itself please, as opposed to screen shots

Re: PDF conversion -> Table width

PostPosted: Fri Aug 30, 2013 9:37 pm
by dazzfayaz
Hi Jason,

Please find the attached documents in the above post itself.

Thanks

Re: PDF conversion -> Table width

PostPosted: Mon Jan 27, 2014 12:21 am
by Aikansh
Hi dazzfayaz,

Did you find any solution for the table width issues. I too am facing the same issues.

Re: PDF conversion -> Table width

PostPosted: Wed Jan 29, 2014 4:33 am
by Aikansh
dazzfayaz wrote:Hi,

I am currently facing the same issues as encountered by you. Could you please help me out.

Thanks & Regards.

Re: PDF conversion -> Table width

PostPosted: Sat Jun 08, 2019 1:32 am
by nmccrack
Hello,

This is an old topic but I don't see any resolution here or elsewhere.
Using v 3.3.6 and setting the XML table widths beforehand, the PDF conversion still sets all columns to equal widths.

Is there any fix/workaround for this issue?