Solved

Coldfusion printing to PDF

Posted on 2011-09-16
14
377 Views
Last Modified: 2013-11-19
I have a loop which I am going through and for each of the loop I am
building th pdf. As I go I output 1 person and all radio buttons are check
as I go to the second person none of my radio buttons are checked
0
Comment
Question by:erikTsomik
  • 6
  • 6
  • 2
14 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36550613
Not quite sure what you mean, but it sounds like you need to check/uncheck the radio buttons each loop.
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 36550718
well I have users. Each user have test taken so now i need ot display the results. For the first user all radio buttons are checked, for the second and rest none of the radio buttons are checked
0
 
LVL 28

Expert Comment

by:strickdd
ID: 36550738
how are you setting the results as checked or not? Should the first user have all checks?
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 36550764
it is in the coldfusion loop. And I am only outputting the completed test. so at least some options are check.

Also If i output to html then all appropriate radio buttons are checked. I am using <cfdocument format="pdf">
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36550821
CF8 doesn't support form field creation with cfdocument. It doesn't error, but the fields don't really work right.  I haven't used it, but the CF9 docs suggest it might be supported if OpenOffice is installed.

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c21.html
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 36550841
well what I doing is storing all forms into cfsavecontent and then using cfdocument
<cfsavecontent variable="printHTML">

</cfsavecontent >

<cfdocument format="pdf">
  <cfoutput>
    #variables.printHTML#
  </cfoutput>
</cfdocument>
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36550863
>> And I am only outputting the completed test.

In that case it doesn't make to sense to generate working radio buttons anyway.  Display an image instead, like an image of check mark  

ie <img src="http://yourserver.com/folder/containing/checkmarkimage.png">
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 19

Author Comment

by:erikTsomik
ID: 36550873
I just waned to reuse the code. that I already got
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36550881
>> well what I doing is storing all forms into cfsavecontent and then using cfdocument

That's fine as long as it's just html. But like I said you can't create <form>'s or form fields like <input> using cfdocument.  They're not supported.  
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 36550894
well it works for 1 person when i do the output. OK it is html . By html has a form in it . so by removing the <form tag
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36550912
Gah... our posts keep crossing.

>> I just waned to reuse the code. that I already got

To be 100% clear - you can't.  Not if the code contains form fields.  Not the answer you want to hear, I know. But that's the way it is. What you're trying to do just isn't supported. Sorry.
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 36550927
But I am doing it for 1 person how? have no idea.
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 36550993
Crossed again ....

>> well it works for 1 person when i do the output.
>> But I am doing it for 1 person how? have no idea.

Possibly adobe started to implement the feature and stopped midway? I don't know .. and it doesn't really matter it's internal voodoo that we can't fix it.  AFAIK - the docs say it's not supported and I believe them.  Remember "Not supported" doesn't always mean it doesn't work at all.  It also means the behavior of something isn't guaranteed. So you shouldn't rely on it because it might not always work. That certainly seems to be the case here.

You could waste a lot of time on this or just take them at their word ;-) From my own experience and numerous threads I've seen on the topic, my advice is - don't bother.  It just doesn't work.  You're better off accepting that it's not supposed to work and modifying your code.  In the end it'll take far less time.
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36551271
But again it doesn't make sense to try and create working radio buttons. If the purpose of the pdf is to store results from a web form then it shouldn't be interactive anyway.  So the way I see it the problem is the goal rather than lack of support for interactive forms in <cfdocument>.

Just my $0.02
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now