• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfpdfform inside cfdocument outbound as a pdf variable

New Here ,
Apr 22, 2009 Apr 22, 2009

Copy link to clipboard

Copied

OK, here's the scenario: I have a client who needs to populate a PDF form (1098) using data from a database.  Right now they have code that simply uses cfpdfform to output the finished "populated" PDF.  Now, here's the problem, we would like to abstract this and create a pdf variable, outbound from a function call, that we can then cfcontent to the screen as a PDF.  The docs indicate that you can create a pdf variable from a cfpdfform using cfdocument, however implementing it has been proven to be problematic.  Is it just not possible to create a pdf variable from a cfpdfform embedded in a cfdocument?  Creating a pdf file works fine, but we don't really need the physical file on the server, just the generated pdf output to the screen.  Any suggestions?

TOPICS
Advanced techniques

Views

3.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Apr 24, 2009 Apr 24, 2009

Skip embedding and use cfsavecontent to capture the cfpdfform output in a variable.

<cfsavecontent >

     <cfpdfform  action="populate"  ... (omit destination) ... >

     </cfpdfform>

</cfsavecontent>

MercuryNewt wrote:

Is it just not possible to create a pdf variable from a cfpdfform embedded in a cfdocument?

Yes, you can.  Though you need to use at least on cfdocumentsection and apparently it must be before the cfpdfform tags or it does not work. At least not in my tests.

Votes

Translate

Translate
Valorous Hero ,
Apr 24, 2009 Apr 24, 2009

Copy link to clipboard

Copied

Skip embedding and use cfsavecontent to capture the cfpdfform output in a variable.

<cfsavecontent >

     <cfpdfform  action="populate"  ... (omit destination) ... >

     </cfpdfform>

</cfsavecontent>

MercuryNewt wrote:

Is it just not possible to create a pdf variable from a cfpdfform embedded in a cfdocument?

Yes, you can.  Though you need to use at least on cfdocumentsection and apparently it must be before the cfpdfform tags or it does not work. At least not in my tests.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 28, 2009 Apr 28, 2009

Copy link to clipboard

Copied

That worked, but I'm still perplexed as to why it would not work within the cfdocument tag.  Thanks for your help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 28, 2009 Apr 28, 2009

Copy link to clipboard

Copied

I do not normally use embedding, but it did work for me as long as the cfdocumentsection was in the right place.  But, it probably would not be a good solution for this case anyway, because cfdocumentsection adds a page break. So you would have a blank first page.

http://cfsearching.blogspot.com/2009/04/embedding-pdf-form-in-cfdocument.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 01, 2010 Feb 01, 2010

Copy link to clipboard

Copied

Hi Leigh,

When I run the following code (in CF8 & CF9), the cfsavecontent tag is ignored (output is written directly to browser):

<cfsavecontent variable="myVar">
  <cfpdfform source="#expandPath('/path/to/MyPDF.pdf')#" action="populate" />
</cfsavecontent>

Just curious.. so the cfsavecontent tag was honored for you (output is trapped in variable, and not directly written to browser)?

Thanks!,

-Aaron Neff

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 02, 2010 Feb 02, 2010

Copy link to clipboard

Copied

UPDATE:  It seems "name" is not actually a _documented_  attribute of cfpdfform (only cfpdf).  Aaron mentioned this on another  forum.  If "name" really is undocumented/unsupported, I probably would not use it.  The issue is mentioned in the bug  database #75195. The current status is "Closed", but I do not know the  final outcome (ie fixed/not-fixed.

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=75195

Just curious.. so the cfsavecontent tag was honored for you

(output is trapped in variable, and not directly written to browser)?

Hi Aaron,

I think that was just non-tested psuedo-code. (I am not sure why I did not just suggest using the "name" attribute to capture the output in a variable..) But that does work on CF9

-Leigh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

In my testing CFPDFForm output doesn't get captured by CFSaveContent.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

Wow, this thread is almost two years old... I do not remember the chain of events but does not the last comment mention that being non-tested psuedo-code? 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

I realized I was resercting an old thread, but seeing as it had come up in my search and I had tested the code I wanted to confirm that it didn't work so someone else wouldn't need to expend the time testing. Figured feed back was a reasonable community expectation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

Fair enough. Though you might post your full version number as behavior can vary between patches (too bad I did not do that in the earlier comments..).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

My testing was performed in CF                  9,0,1,274733 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

LATEST

Thanks. FWIW I can confirm your confirmation 😉 Cfsavecontent does not capture the output under 9.0.1.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation