Copy link to clipboard
Copied
I'm trying to create a pdf that display some content from HTML and then includes a pdf form file, and I am experiencing two odd things:
1. The content in the cfdocumentsection above the cfpdfform tag does not show up in the pdf. All I see is the pdf form.
2. If I try to save the cfdocument using the filename attribute, it doesn't work. The file is not created and the pdf form displays in the browser. If I remove the cfpdfform tag, then the file is created and I see the content from the cfdocumentsection in the result.
Anyone have any ideas what is going wrong? The code looks like this:
<cfdocument format="pdf">
<cfdocumentsection>
<H2>PDF Form</H2>
</cfdocumentsection>
<cfpdfform action="populate" source="#request.path.file_directory##attributes.fileid#.pdf" xmldata="#setInputXMLRet.result#" overwritedata="true">
</cfpdfform>
</cfdocument>
Thanks.
Copy link to clipboard
Copied
Did you ever resolve this?
Sorry for ressurecting an old thread, but I'm having *exactly* the same issue.
Copy link to clipboard
Copied
Nope I never did.
Copy link to clipboard
Copied
It works for me with CF9.0.1.
Which version are you using? Does the cfpdfform action work independently? Did you check the log files for errors?
-Leigh
Copy link to clipboard
Copied
There's nothing in the logs.
I'm using CF9.0.1 on RHEL.
Is your pdf form created using LiveCycle Designer? I'm begging to think that might have something to do with it...
EDIT: My main issue is that the form "takes over" the PDF. All I get is the form. For example, the following code:
<cfdocument format="PDF">
<cfdocumentsection>
<h1>Test</h1>
</cfdocumentsection>
<cfpdfform
action = "populate"
source = "form.pdf"
>
</cfpdfform>
<cfdocumentsection>
<h1>Test</h1>
</cfdocumentsection>
</cfdocument>
All I get is the form, no header, no footer - just one page which is the PDF form.
Copy link to clipboard
Copied
http://tom-miller.co.uk/tmp/form.pdf
There's the PDF I'm using, created using LiveCycle designer.
Copy link to clipboard
Copied
Is your pdf form created using LiveCycle Designer?
Nope.
EDIT: My main issue is that the form "takes over" the PDF. All I get is the form. For example, the following code:
Ah, okay. (I misread the original issue) I do not know the reason, but I can at least confirm the same result on windows. So it does seem related to the form type. If you use a static acroform it works.
-Leigh
Copy link to clipboard
Copied
Have you tried opening up your PDF form in acrobat and saving it with backwards compatability with a previous version? Sometimes that can make a difference. Alternatively, you could test accomplishing the same thing using iText.