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

Send Coldfusion variables to (then save) PDF

New Here ,
Sep 24, 2008 Sep 24, 2008
My site has a PDF form that is pre-filled with information drawn from a database query. This is accomplished with via FDF, as that was the best way I could figure to do it at the time.

Firefox doesn't allow for the viewing of PDFs within the browser, so when Firefox users click on the link to view the PDF they are prompted to safe the FDF to their hard drive. When they double-click on it, the PDF will open in Safari (on Macs, at least... not sure about PCs).

Using ColdFusion 7, is there a way to write a static PDF using the information from the FDF so people will download that instead? Or, failing that, is there a better method to use from the get-go?

Thanks so much!
762
Translate
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
LEGEND ,
Sep 24, 2008 Sep 24, 2008
If it's a form, you could always make it html.

To make a pdf file, use cfdocument.

If you want to get fancy, you can use cgi.http_user_agent to determine the browswer and have different versions for different browsers.
Translate
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 ,
Sep 24, 2008 Sep 24, 2008
Cyborgirl wrote:
> Firefox doesn't allow for the viewing of PDFs within the browser

It should with the right configuration settings. At least Firefox 3 does anyway. Is that the reason you want to generate a static pdf instead of using your current method?
Translate
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
LEGEND ,
Sep 24, 2008 Sep 24, 2008
-==cfSearching==- wrote:
> Cyborgirl wrote:
> > Firefox doesn't allow for the viewing of PDFs within the browser
>

My Firefox sure does, as long as I have the Adobe plug-in installed of
course.

I think that maybe the issue. If I recall correctly, the free Adobe
Reader does not allow full functionality with FDF data.

Anyways... As well as <cfdocument...> you will probably want to check
out <cfpdf...>. At least in the latest ColdFusion version I have read
that it provides FDF functionality to build a PDF on the fly.
Translate
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 ,
Sep 24, 2008 Sep 24, 2008
Ian Skinner wrote:
> I think that maybe the issue. If I recall correctly, the free Adobe
> Reader does not allow full functionality with FDF data.

That could be it. I have not tried it with FDF data recently.

> As well as <cfdocument...> you will probably want to check
> out <cfpdf...>. At least in the latest ColdFusion version I have read
> that it provides FDF functionality to build a PDF on the fly.

If it really needs to be a form, I do not think cfdocument handles that. CF8 could probably do it with the <cfpdf ..> tags. For MX7, I think you would need to tap into iText.
Translate
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 ,
Sep 25, 2008 Sep 25, 2008
I actually misspoke in my original post about Firefox not letting you open PDFs; I meant that it would not automatically open the FDF as a PDF. My apologies! Hopefully we'll be able to upgrade to CF8 in the near future but in the meantime I'll check out your suggestions. Thanks for the replies, folks!
Translate
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 ,
Sep 25, 2008 Sep 25, 2008
Cyborgirl wrote:
> I meant that it would not automatically open the FDF as a PDF.

Is that the reason you want to generate an actual pdf instead of using fdf?

On your view page, what content type are you using: application/vnd.fdf?
Translate
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 ,
Oct 01, 2008 Oct 01, 2008
quote:

Originally posted by: -==cfSearching==-
Cyborgirl wrote:
> I meant that it would not automatically open the FDF as a PDF.

Is that the reason you want to generate an actual pdf instead of using fdf?
On your view page, what content type are you using: application/vnd.fdf?



The answer is yes to both!
Translate
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 ,
Oct 07, 2008 Oct 07, 2008
LATEST
Firefox version 2 has no problems with PDF files either, it has to be somewhere in the settings.


Junior Cricket Bats

Translate
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