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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFpdf Tag Locking up my server 1

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
I need to generate thumbnails of very small (100-130kb) PDF files. Every time I try to use the tag I have to restart the main ColdFusion 9.0 service; the "thumbnail" folder gets created, I never get any jpeg(s), and the server locks up completely.

Even this most basic form of the tag usage locks me up:
Code:
<cfpdf action="thumbnail" source="C:\myPDFs\Test1.pdf" overwrite="yes" imageprefix="thumb">

I also tried messing with pdf.js javascript library, supposed to generate thumbs too, but all the examples I found were very incomplete and way over my head I suppose.

Any help much appreciated.

Lyndon
 
I would say your path is wrong for the source.

source = "absolute or relative pathname to a PDF file|PDF document variable|



If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
A little clarification on my response. If this is on a server on your computer even though the path is on your computer it would not be reachable by coldfusion. The file must reside within reach of the server. With most setups it would be 'C:\ColdFusion10\cfusion\
If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
The source path I'm using is relative to the server. I used an example path in my post.


Lyndon
 
The path in your post would not be reachable by the coldfusion server. It can not go above the folder. Try putting the pdf in the same directory with the file calling it and use this code.
Code:
<cfpdf action="thumbnail" source="Test1.pdf" overwrite="yes" imageprefix="thumb">

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Same result. :(, I also tried a different pdf, not created with cfdocument...

Lyndon
 
What version coldfusion are you using? I would recommend a try catch to see any errors.

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
I'm using 9.0

Any idea what event I should "catch?

Lyndon
 
Code:
<cfcatch type="any">

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Code:
<cftry>
<cfpdf action="thumbnail" source="Test1.pdf" overwrite="yes" imageprefix="thumb">
 <cfcatch type="any">
         <cfoutput>
          Error Message: #cfcatch.message#<br>
          Error Detail: #cfcatch.detail#<br>
          Error Location: #GetBaseTemplatePath()#<br>
         </cfoutput>
          
          <p>We're sorry, an error has occurred and our developers have been notified.</p>
      </cfcatch>
</cftry>

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
I tried this:
Code:
<cftry>
	<cfpdf action="thumbnail" overwrite="yes" source="C:/Workgroups/WebPages/binkley/BadgeCard/PDFs/2016-OC-276693.pdf" format="png" />
	<cfcatch type="any" name="myTry">
		<cfdump var="#cfcatch#" >
	</cfcatch>
</cftry>
I guess it can't get past the cfpdf tag. It never gets to the cfcatch or cfdump tags. Just hourglass, had to restart service.

But this works fine:
Code:
<cfpdf action="getinfo" name="myPDFinfo" source="C:/Workgroups/WebPages/binkley/BadgeCard/PDFs/2016-OC-276693.pdf" format="png" />
<cfdump var="#myPDFinfo#">

So, my guess is that the source attribute value is not the problem???

Thanks!!!

Lyndon
 
You should have gotten an error since it should be...

Code:
<cftry>
	<cfpdf action="thumbnail" overwrite="yes" source="C:/Workgroups/WebPages/binkley/BadgeCard/PDFs/2016-OC-276693.pdf" format="png" />
	<cfcatch type="any" name="myTry">
		<cfdump var="#myTry#" >
	</cfcatch>
</cftry>

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
I actually tried both. I'm really taking wild guesses now... [sadeyes]

Lyndon
 
Is there a thumbnails folder in the directory? Perhaps it has to do with file permissions as it will need to create that directory if it doesn't exist.

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Yes, it is creating the thumbnails folder, but it has no files in it. Maybe I should use cffile and copy a file into the new dir and see if I get a permission error?

Lyndon
 
Sounds like a plan. Otherwise I think it's an Adobe question or a new install. I can find nothing with anyone having this problem and I think only changes in the IDE would cause it. I have tried having all files open and editing but can not produce an error.

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
CFFile copied a file into the thumbnails folder just fine...

Thanks for all of your assistance.

Lyndon
 
I hate things like this as they stick in my head lol Good luck. If I run across anything I will let you know.

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
I'm the same way, can't/won't give up, plus my customers need it.

I'm also looking at pdf.js as it's supposed to do this also. But all the examples I've found are really high level, and assume much more javascript skill than I have. I've got a few messages out there asking for a really simple PDF->JPG example, maybe I'll get some help there. I don't really care how this cat gets skinned. LOL

BTW, I graduated from MCRD, San Diego, in April of 1976. Did two years at 29-stumps then enlisted in the Air Force. Retired in 2005.

Lyndon
 
Semper Fi I graduated MCRD San Diego September 1975 and spent 2 years on Okinawa then 2 years at the stump with 1st Bn 4th Marines all 4 years lol

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top