Solved

How can I do PDF Print on Demand

Posted on 2011-02-27
7
416 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 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

18 Experts available now in Live!

Get 1:1 Help Now