Solved

How can I do PDF Print on Demand

Posted on 2011-02-27
7
418 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

930 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

16 Experts available now in Live!

Get 1:1 Help Now