Page 1 of 1

[SOLVED] Margins on PDF output file - Locale

PostPosted: Tue Aug 17, 2010 12:08 am
by heitorflorido
Hello,

I've successfully converted my docx to a PDF file, but I have some questions about the result:
1- Some log4j warnings appeared on the result file.
- I've downloaded the log4j.xml file from "src/main/resources", put it in my classpath, added "-log4j.configuration=lib/log4j.xml" to my VM args and then included in the file:
Code: Select all
<logger name="org.docx4j.convert.out.pdf.viaXSLFO">
   <level value="info"/>
</logger>

However, that didn't make the warnings disappear. What else I need to do?

2- On the output file, the left and bottom margin are set to 0, while the top and right margin are correct.
- How can I modify the margin values?

3- On some parts of the PDF, a '?' char appears at the begining of the sentence, but the docx doesn't show any char.
- How can I remove these '?' chars?

Thanks

Heitor Florido

Re: Warnings and Margins on PDF output file

PostPosted: Tue Aug 17, 2010 12:15 am
by jason
Re 1, try -Dlog4j.configuration=log4j.xml ?

Re 3, is this bullets/numbering?

Re 2 & 3, can you attach to this post a simple docx (renamed as zip) showing the probs?

Re: Warnings and Margins on PDF output file

PostPosted: Tue Aug 17, 2010 4:49 am
by heitorflorido
Hello,

Re 1: I've tried that too, but the messages remain.

Re 3: The docx contains lists and bullets, but they're OK.
Sample docx and pdf attached.
PS: I'm from Brazil, so the docx is written in Portuguese.

Thanks

Re: Warnings and Margins on PDF output file

PostPosted: Wed Aug 18, 2010 5:28 am
by jason
Re 1, i've copied/moved this to a separate thread.

Re 2, margins in my pdf output look fine to me using current svn head (which i think you have if you are running the nightly from the other day)

Re 3, the first paragraph with a "?" in the PDF output comes from WordML:

Code: Select all
      <w:pPr>
        <w:pStyle w:val="Item2"/>
        :
        <w:numPr>
          <w:ilvl w:val="0"/>
          <w:numId w:val="0"/>
        </w:numPr>


but your numbering.xml doesn't contain:

Code: Select all
  <w:num w:numId="0">


The "?" was debug output. http://dev.plutext.org/trac/docx4j/changeset/1186 prevents these from printing (provided log level is above debug).

Re: Warnings and Margins on PDF output file

PostPosted: Wed Aug 18, 2010 11:46 am
by heitorflorido
jason,

Like you said I'm using the 2010 08 14 nightly build.
According to you, I should be getting an output file with the margins correct, but since I'm not, the problem could be with my environment. Before we consider this, I going to the get the head revision from SVN and try it.

Regarding the '?' problem, I didn't understand your statement (I'm Brazillian and my english is not the best)
If I use a source code with revision 1186 or greater, I should be fine?

Thanks

Re: Warnings and Margins on PDF output file

PostPosted: Wed Aug 18, 2010 6:05 pm
by jason
heitorflorido wrote:If I use a source code with revision 1186 or greater, I should be fine?


Yes (as long as you resolve your log4j problem!)

Re: Warnings and Margins on PDF output file

PostPosted: Fri Aug 20, 2010 3:50 am
by heitorflorido
jason,

With your help, I was able to solve the log4j problem, but the '?'s are still there.

Regarding the margin problem, I think I know what's the problem:

Looking at the log generated, there are entries like these
19.08.2010 12:59:11 *ERROR* FOUserAgent: Invalid property value encountered in border-bottom-width="0,18mm": org.apache.fop.fo.expr.PropertyException: No conversion defined 0,18mm; property:'border-bottom-width' (No context info available) (LoggingEventListener.java, line 82)
19.08.2010 12:59:11 *ERROR* FOUserAgent: Invalid property value encountered in start-indent="0,25in": org.apache.fop.fo.expr.PropertyException: No conversion defined 0,25in; property:'start-indent' (No context info available) (LoggingEventListener.java, line 82)

If you look at the values, you'll find out that they have a comma and not a dot.
That's because here in Brazil, the commas and dots are switched, resulting in 1,000.00 on USA and 1.000,00 on Brazil.
I believe we have a internationalization problem.

What do you think?

Re: Warnings and Margins on PDF output file

PostPosted: Sat Aug 21, 2010 1:21 am
by heitorflorido
I solved the problem by using:
Code: Select all
Locale.setDefault(Locale.ENGLISH);

The only problem left is the '?'s chars.
I couldn't build docxj from source, because of security policies from my company.
Probably, the '?'s will disappear in the next nightly build.

Thank you

Re: [SOLVED] Margins on PDF output file - Locale

PostPosted: Tue Aug 24, 2010 11:52 pm
by heitorflorido
I've generated a new PDF output using the nightly build from 24/08
and the '?'s chars are still there.

Any ideas on how to solve this?

Thanks

Re: [SOLVED] Margins on PDF output file - Locale

PostPosted: Wed Aug 25, 2010 10:14 am
by jason
I did build that nightly on a different machine, but I've just checked that the relevant code was in place (I created a pdf from your test document again). I can't see how you could get the question marks with that code.