4 Replies Latest reply on Nov 11, 2008 12:48 AM by mafi

    CFDocument, pdf and justify, oh my!

    newRandomMark Level 1
      I can't get justified text in my PDF. I read around the internet that this was a known problem in version 7 all releases, but was supposed to be fixed in version 8. Here is an example of my code:

      <cfdocument format="pdf" filename="c:\TestPDF.pdf" overwrite="yes">

      <DIV align="justify">Text of paragraph 1.</DIV>

      <p align="justify">Text of paragraph 2.</p>

      <p style="text-align:justify">Text of paragraph 3.</p>

      <p style="text-align: justify"> Text of paragraph 4.</p>

      <table><tr align="justify"> <td align="justify">Text of paragraph 5</td></tr></table>

      <table> <tr align="justify"><td>Text of paragraph 6.</td></tr></table>

      <table> <tr> <td align="justify">Text of paragraph 7.</td></tr></table>

      </cfdocument>

      All paragraphs in the pdf are left aligned. If I changed "Justify" to any other option, Right, Left or Centered, the paragraphs do correspond. Below is the full version of my code so you can see I am in fact using enough text for it to be "justified". What do I need to do to make this happen?

      <cfdocument format="pdf" filename="c:\TestPDF.pdf" overwrite="yes">
      <DIV align="justify">1. This is the first paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. This is the first paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. This is the first paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. This is the first paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</DIV>

      <p align="justify">2. This is the Second paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 2. This is the Second paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 2. This is the Second paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 2. This is the Second paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</p>

      <p style="text-align:justify">3. This is the Third paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 3. This is the Third paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 3. This is the Third paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 3. This is the Third paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</p>

      <p style="text-align: justify"> 4. This is the Forth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 4. This is the Forth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 4. This is the Forth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 4. This is the Forth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</p>

      <table><tr align="justify"> <td align="justify">5. This is the Fifth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 5. This is the Fifth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 5. This is the Fifth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 5. This is the Fifth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</td></tr></table>

      <table> <tr align="justify"><td>6. This is the Sixth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 6. This is the Sixth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 6. This is the Sixth paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</td></tr></table>

      <table> <tr> <td align="justify">7. This is the Seventh paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 7. This is the Seventh paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines. 7. This is the Seventh paragraph. This is an amount of text equal to about a paragraph. This is for testing purposes only. I need enough text to fill four or five lines.</td></tr></table>

      </cfdocument>