Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfdocument - PDF 1

Status
Not open for further replies.

TamedTech

IS-IT--Management
May 3, 2005
998
GB
Hello Guys,

I'm having an issue here which i think might well be ISP related, but I thought I would atleast run my code past you guys before I talk to them about it.

I have ColdFusion MX7 hosting, and i wasnt to use CFDOCUMENT to create PDF files, so i've followed the quick demo from the macromedia site as at the moment all I need to print is the results of an HTTP call.

So here is my code.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PDF Generation Test</title>
</head>

<body>

<cfhttp url="[URL unfurl="true"]http://www.tamedtechnology.net/mt/index.cfm"[/URL] resolveurl="yes"></cfhttp>

<cfdocument format="pdf">
	<cfoutput>#cfhttp.FileContent#</cfoutput>
</cfdocument>


</body>
</html>

See anything abnormal about it?

Thanks,

Rob
 
Hi GUJU,

The page sits loading for quite some time and then i get an internal server error 500.

You confirming the code is a great help, now means i can point the finger at my ISP and get some help from them.

Thanks,

Rob
 
o.......k..... lol

Well, i spoke to my ISP about it, and they said they were able to replicate the issue there end, but it appeard to be my code that had issues and not somthing to do with thier servers ... however after recieving the mail i checked my URL again and its started working lol.

Thanks again,

Rob
 
Well, I copied your code as-is and ran it successfully. I also changed the URL and ran it successfully. Not sure why you had an error in the first place. But glad to see problem is solved.

____________________________________
Just Imagine.
 
Hi Buddy,

I've got issues with this still, and i'm not sure whats causing it.

Basicly this is the Page i want to PDF... which looks fine in the browser, I cant see any discrepencies in my XHTML or CSS.

But when i output to PDF or FlashPaper it goes all screwy, the right hand column gets knocked accross, and a whole stake of my images and div's just disapear.

See Here.


I'm still using the same code as above to generate the PDF. i've even tried manualy wrapping the entire code of the index.cfm inside a cfdocument tag and get the same result.

I've also tried adding attributes for paper sizes and orientation and still get the same result.

Thanks,

Rob
 
Thanks for that mate, i've given it a try and these two links now have your updated suggestion of a paper size and top margin included.



However even after updating the code and clearing my browser cache i still get the same off result of it being all skew-if.

Have you got a URL of your working code example? we're clearly running the same code I would have thought, so cant see why it isnt working on my server.

Here is a snapshot of the current code

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PDF Generation Test</title>
</head>

<body>
<cfhttp url="[URL unfurl="true"]http://www.tamedtechnology.net/mt/index.cfm"[/URL] resolveurl="yes"></cfhttp>

<cfdocument format="pdf" pagetype="a4" margintop="0.1">
    <cfoutput>
		#cfhttp.FileContent#
	</cfoutput>
</cfdocument>

</body>
</html>

Any other ideas? thanks for your help.

Rob
 
Hi, unfortunetly I am testing on my work's internal enviornment, so I can't really post a URL. But I keep getting the same correct output. Are you using CF7?

When I click on the links from your last post, I get a internal 500 error message.

I'll look into this further and run some more tests for you. Hopefull, I might have something by Monday.

____________________________________
Just Imagine.
 
Thanks for that GUJU ... i'm now recieving the internal 500 error aswell ... dispite the fact it was producing the dodgy pdf's yesterday afternoon when i checked those links ... and i've not modified the code atall since then.

I'm just convinced this is somthing strange that my ISP is doing, i definatly purchased an MX7 account from CrystalTech and untill this issue they seem pretty on the ball.

The fact that as running the same code i get such a massive miriad of error's returned is quite confusing.

The day before yetserday i was getting mixed internal 500 error's and some CF error's telling me that the document contained no pages.

Then yesterday i had it producing the mis-formatted pdf's and flash papers, only to have it start kicking out Internal 500 Error's again over night.

Very confusing,

I think i'm going to tackle the tech support guys on it again and get thier feedback.

If you have any thoughts then let me know.

Thanks again,

Rob
 
You are now getting:
Code:
access denied (java.io.FilePermission c:\windows\fonts\verdana.ttf read)

You need to contact CrystalTech and tell them this. In cfadminstrator you have a section that allows the font-style to be used, perhaps the hosting company disallowed this read persmission. Also, not sure, but maybe CrystalTech turned off cfdocument/cfreports feature.

I ran this code from my work enviornment and it works fine.

____________________________________
Just Imagine.
 
Hi Pal,

Thanks for that. I did notice i was now getting the font issue,

Basicly i contacted Support this morning to notify them of the Internal 500 error i was recieving, shortly afterwards that error changed to 'Document has 0 Pages' ... then shortly after that i started getting the font error lol ... so i'm not sure whats going on.

I'm going to mail them again now and see what they make of it.

Thanks,

Rob
 
I have no ideas at all i'm affraid Signit,

As you can see there is still an issue residing with the formatting on the PDF.

As soon as the ISP resolves the issue i'm sure they'll give me a more thorough report as to whhat is causing the issue.

Once i know a little more then i'll let you know.

Thanks,

Rob
 
Hmm,

Ok guys, well a few days have passed and i've finally got a mail back from my ISP about the issue.

They are still quite insistant on the fact that it is my code that is causing the issue.

They seem to think it works ok on other pages, but for some reason that index.cfm doesnt PDF properly.

They have said they've said they have shifted it around onto different CF servers within the organisation and still had the same problem.

Thanks guys,

Rob
 
Hmmmm, what else are you calling in the index.cfm? Are you calling more then on cfdocument tag? If so, try appending the name var so you can distinguish one cfdocument with others.

____________________________________
Just Imagine.
 
I don't if this is the problem your ISP is having but it turned out to be my problem:

The fix had to do w/ weblogic problems. Specifically, the change was to remove the startup java argument -

Code:
Djava.awt.graphicsenv=com.gp.java2d.ExHeadlessGraphicsEnvironment

and replace it with:

-Djava.awt.headless=true

when starting up weblogic.

Found a help thread here: [URL unfurl="true"]http://www.coldfusionmx.com.br/cfusion/webforums/forum/messageview.cfm?catid=2&threadid=971708&enterthread=y[/url]
 
Hi Guys,

Thanks for staying in touch on this one.

My index.cfm is purly just an XHTML file, it doesnt contain any cfml whilst i iron out creases in my template.

My ISP is getting on top of it now ... i'll keep you posted.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top