Solved

Coldfusion printing to PDF

Posted on 2011-09-16
14
381 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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 …

828 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