Solved

How can I do PDF Print on Demand

Posted on 2011-02-27
7
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

734 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