Skip to main content
Participant
July 10, 2006
Question

cfdocument: extra whitespace when converting HTML to PDF

  • July 10, 2006
  • 3 replies
  • 2397 views
Unwanted white-spaces appear when using inline HTML-tags, while converting HTML to PDF:

<cfdocument format="PDF" pagetype="A4" orientation="portrait" overwrite="no" fontembed="yes">
This is a sentence with <i>italics</i>.<br />
And here <b>bold</b> is used.<br />
</cfdocument>

The <i> and <b>-tags (actually: any tag) generates extra whitespaces.
Anyone an idea to solve this problem/bug?
This topic has been closed for replies.

3 replies

Participant
January 21, 2021

Did you ever solve this? I'm having the same issue.

BKBK
Community Expert
Community Expert
January 22, 2021

@tdaigle_2019 , this thread is ancient. ColdFusion has moved on since 2006. We're now 14 years and 8 ColdFusion generations later, analogous to over 200 years in human terms.

 

You should start a new thread. When you do, mention your ColdFusion version and Update level.

BKBK
Community Expert
Community Expert
January 22, 2021

In the meantime, see if the following helps:

<cfdocument format="PDF">
<cfprocessingdirective suppresswhitespace="true">
<!--- Your HTML goes in here. --->
</cfprocessingdirective>
</cfdocument>
Participant
July 16, 2006
Hello H&N
Thanks you post a sample pdf. How about multipages with some images. Are you have a cutoff line height? I was failure to control line height as it cutoff half heght in last and first line.
H_N1Author
Participant
July 17, 2006
quote:

Originally posted by: ad96004
How about multipages with some images. Are you have a cutoff line height? I was failure to control line height as it cutoff half heght in last and first line.


I did not have problems with images and/or mutlipages: just the inline HTML-formatting tags. In the meantime the version that caused the errors are not online anymore: we now use HTMLdoc. But since HTMLdoc doesn't support UTF-8 we had to workaround this workaround

If this is really a specific *Nix problem and everything is ok on the Windows-platform, it's a bummer. The Verity engine in the 6-release also did not work on *Nix but worked fine on Windows. Makes it look like Macomedia/Adobe cares more for Windows (the problem was never solved in the 6-release) and I think that's not good for a server environment advertised as cross platform.
July 11, 2006
Interesting. Running your code (or mine) I see no extra spaces.
Can you post a link to the PDF or a screen shot?

Do you have whitespace management turned on in the CF Administrator?
What version of CF are you using?
H_N1Author
Participant
July 11, 2006
July 11, 2006
Took that html page and posted it on my test system - making sure the page looked exactly like the one you linked.

Then wrapped the whole thing in a cfdocument. In the resulting PDF (viewed with Adobe reader 6) there are no extra spaces.

However, the pdf generated that way has obvious style differences from the PDF you posted.
SO... How is the pdf stylesheet different from "common.css"?

Can you attach the code for pdf.cfm?

What version of CF are you using?

What version of Adobe?