Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I do PDF Print on Demand

Posted on 2011-02-27
7
Medium Priority
?
443 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 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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

670 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