Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I do PDF Print on Demand

Posted on 2011-02-27
7
Medium Priority
?
454 Views
Last Modified: 2012-05-11
I know how to create a PDF with ColdFusion, but how can I setup a system that will allow me to edit designated areas to be updatable with the users information in set areas.

Here is an example here:
http://www.zetaprints.com/magento/index.php/classic/1-3-page-horizontal-ad-1-photo-90-x-235-mm.html

Is there a way to mark set areas that can have textboxes update the text easily.  
0
Comment
Question by:theideabulb
  • 3
  • 2
  • 2
7 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 34993956

Not sure I follow your question - you would like user's input to be seen in the PDF file?

If so, the process is the same as if you were displaying the text on a website.

Simply take the text entered and show the variable within the CFDOCUMENT tags.

<cfoutput>#form.userInput#</cfoutput>

I suspect there is more to your question which I am not getting?

0
 

Author Comment

by:theideabulb
ID: 34994011
yes, you are close.  I want to be able to take the PDFs that i create and have certain sections that can be tweaked by user input.  So yes they can put in their name, address, email, phone number.

The main part of my question though is though is how do  put in the coordinates to place text somewhere and accurately.  I also notice that some sites have inline editing, you can type right on your design.

Vistaprint.com is another site that has designs that you can  update your own text on and send it off to be printed.  I am looking for how this can be done.
0
 
LVL 3

Accepted Solution

by:
dagaz_de earned 2000 total points
ID: 34996012
The easiest way will be an construct of (draggable) div areas. Inside the areas are little pen (or other Edit) symbols so when you click them you popup (or cfwindow) a page with a rich text editor an the (dbbased ?!) Content  in it. After submit your changes close the editor and refresh the page so you can see it.
If it looks good, let the user press a button wich reload the page but with an option like:

?doPDF=1

in your Page start with a Code like this:

<cfparam name="doPDF" default="0">

Then do the whole HTML Output after this tag:

<cfif doPDF is 1>
<cfdocument format="pdf" Unit="cm" Orientation="portrait" PageType="A4" margintop="0" marginbottom="2" fontembed = "yes" overwrite="Yes" filename="Your_name_#dateformat(now(), 'dd_mm_yyyy')#.pdf">
</cfif>


And at the End of the Page you Do this to close the cfdocument tag:

<cfif doPDF is 1>
</cfdocument>
</cfif>
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Closing Comment

by:theideabulb
ID: 34996316
Hey great idea, this is what i was looking for. A good concept to let me start working it out!!
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 34996891

I may be mistaken, but I don't think that cfdocument allows you to include the start and end tags conditionally within CFIF statements.

If you get an error, that may be what it is...
0
 
LVL 3

Expert Comment

by:dagaz_de
ID: 34997091
@ gdemaria
Ok if your right then you must do it like this:

<cfif doPDF is 1>
<cfdocument format="pdf" Unit="cm" Orientation="portrait" PageType="A4" margintop="0" marginbottom="2" fontembed = "yes" overwrite="Yes" filename="Your_name_#dateformat(now(), 'dd_mm_yyyy')#.pdf">

YOUR HTML OUTPUT HERE

</cfdocument>
<cfelse>

THE SAME HTML OUTPUT HERE!

</cfif>
0
 
LVL 3

Expert Comment

by:dagaz_de
ID: 34997100
or you put your htmloutput in a seperate template and include it like this

<cfif doPDF is 1>
<cfdocument format="pdf" Unit="cm" Orientation="portrait" PageType="A4" margintop="0" marginbottom="2" fontembed = "yes" overwrite="Yes" filename="Your_name_#dateformat(now(), 'dd_mm_yyyy')#.pdf">

 <cfinclude template="your_html_output.cfm">

</cfdocument>
<cfelse>

 <cfinclude template="your_html_output.cfm">

</cfif>
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Integration Management Part 2

971 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