Solved

Coldfusion printing to PDF

Posted on 2011-09-16
14
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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
 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 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