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

Posted on 2014-08-14
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>					

Open in new window

Question by:J C
    LVL 51

    Accepted Solution

    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.

    <cfdocument  filename = "filename" ....>

    Author Comment

    by:J C
    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.
    LVL 51

    Expert Comment

    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.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now