Skip to main content
Participating Frequently
October 16, 2008
Question

CFDocument, pdf and justify, oh my!

  • October 16, 2008
  • 2 replies
  • 2797 views
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>
This topic has been closed for replies.

2 replies

Gary__F
Inspiring
October 18, 2008
I reported it 2 or 3 years ago :-(. Adobe have neglected this bug thinking that no one cares if PDFs aren't justified. Given that Adobe invented the PDF format you'd think they'd (a) understand typography and the need for basic text formatting and (b) have the ability to fix it.

All we can do is hope it's fixed in CF9 and they repent by offering a hotfix for CF8 customers. I don't see why anyone should pay $$$ or $$$$ to upgrade just to get a really annoying bug fixed. To put it into perspective, we spent a 6 figure sum on developing a web app, a 5 figure sum on servers and nearly as much on CF licenses to create a highly professional solution, but something as crazy as unjustified text - which looks messy and unprofessional - really lets us down. "What do you mean you can't justify the text?" people say in amazement.
Participating Frequently
October 23, 2008
Is there anywhere to see that Adobe has recognized this bug, or a place to submit it as a bug?
Participating Frequently
October 16, 2008
Here is a random webpage that named this "Bug 60590 - to be fixed in CF8"
http://list.cfdeveloper.co.uk/pipermail/dev/msg04010.html
(please note, I am using CF version 8,0,1,195765)