[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Coldfusion MX7: Generating a coldfusion page to a pdf for further actions to be performed and removing blank page

Posted on 2014-08-14
3
Medium Priority
?
346 Views
Last Modified: 2014-09-04
There are two issues:

The first is I am hoping to get some guidance on how best to handle the flow for my use case. I am working on incorporating docusign into one of the coldufison sites I've inherited. The first step was to figure out how to generate a pdf with the information I need. The type of document I need to capture signatures for is a lien release. There can be 50-60 rows of data in this coldfusion page that are set to break after each row. <CFDocument> makes it easy to create the PDF but when the popup window appears that used to show the coldfusion page with the lien releases it appears as a blank page because I've wrapped that page in the cfdocument tags. The PDF does get created. My question here is, how can I generate the PDF without opening the page in a popup window? Is there a way to do that? I want to generate the PDF then display the coldfusion page with the data. I then want to have a button that will initiate the call to the docusign server and be able to send that pdf that I've stored on the server as part of the request. I don't know how to create the PDF without opening the page that is wrapped in the cfdocument tags which at this point ends up being a blank page.

The second issue is this.

I am using the code below to create a page break. It works perfectly except that a blank page does get created at the end of the document. Does anyone know of a method I can use to keep the blank page from being created?

<cfif AmountToPayOnNextCheck.recordcount gt rowcount>
		  <div style="page-break-after:always"></div>					
</cfif>

Open in new window

0
Comment
Question by:J C
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 40262069
Not sure about the blank page.

If I'm understanding correctly, you simply want to generate the pdf without ever displaying it? If so, it sounds like you just need to add the "filename" or "name" attribute to your <cfdocument> tags, so the pdf content is saved to a file, or variable, instead of displayed on screen. Then you can do with it wherever you need.

filename - Specifies the name of a file to contain the PDF or FlashPaper output.  If you omit the filename attribute, ColdFusion MX streams output to the browser.

name - Specifies the name of an existing variable into which the tag stores the PDF or FlashPaper output.

ie
<cfdocument  filename = "filename" ....>
0
 

Author Comment

by:J C
ID: 40262170
That is what I've done and the document does save to my web app folder  but it's almost as if the document is trying to be displayed inside the popup and cannot be loaded because I end up with what appears to be a blank window.
0
 
LVL 52

Expert Comment

by:_agx_
ID: 40262216
Unfortunately I don't have MX 7 to test with, but it sounds like you're doing a 2 step process. Can't you just generate the pdf in step 1, then use cflocation and redirect to the display page? That way, the blank page shouldn't matter because the user would be redirected and wouldn't see it.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll

868 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