Re: Need advise on pdf generation with FPDF

2007-02-12 Thread Samuel DeVore
I'll tune up the article, thanks for the feedback.  I have a feeling I
always type vendors then get an error and smack myself in the head and
then remove the 's' ;)


On 2/12/07, jinhr <[EMAIL PROTECTED]> wrote:
>
> Sam, I eventually makes your sample codes runs according to  http://
> bakery.cakephp.org/articles/view/225
> Thanks!! But I have to make following changes on your codes before it
> runs, maybe because that CakePHP keeps changing.
>
> file "views/helpers/fpdf.php"
> 
> 1. "vendors(...);" is wrong, should be "vendor(...)" without "s".
> 2. add following additional var:
>
> function fpdfHelper extends FPDF(){
> var $helpers = array(); //I guess it is mandatory for latest
> CakePHP
> }
> 3.change default value in function fpdfOutput to be "D" instead of
> 's', so that:
> function fpdfOutput ($name = 'page.pdf', $destination = 'D')
>I have tried all options, only this works stable both in IE and
> FireFox. Otherwise, there are chances showing messy or blank page. -_-
>
> file "views/layouts/pdf.ctp" (I use *.ctp instead of *.thtml")
> ==
> //don't need this header output, because "vendors/fpdf/fpdf.php" has
> done this line
> //header("Content-type: application/pdf");
>
>
> Accordingly, I use "$fpdf->fpdfOutput()" instead of "echo $fpdf-
> >fpdfOutput();"
>
> Anyway, your codes help me a lot. Thanks. I will keep playing with
> your extending codes.
>
> On 1月17日, 下午12时42分, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > you might also take a gander at the google cache for the old 
> > wikihttp://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tut...
> >
> > I send an email to the foundation offering to bring this up to date
> > and to the bakery, since I'm going to start to use it again soon
>
> On 1月17日, 下午12时42分, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > you might also take a gander at the google cache for the old 
> > wikihttp://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tut...
> >
> > I send an email to the foundation offering to bring this up to date
> > and to the bakery, since I'm going to start to use it again soon
> >
> > Sam D
> >
> > On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Thank for quick prompt, Chris. Your solution for swf really helps me to
> > > think of the solution.
> > > I may scratch a similiar way forFPDF.
> >
> > > BTW, I wonder whether it be better to define afpdfHelper rather than
> > > do in Controller?
> >
> > > Anyway, I ga to whip now
> >
> > --
> > ==
> > S. DeVore
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
>
> >
>


-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-02-12 Thread jinhr

Sam, I eventually makes your sample codes runs according to  http://
bakery.cakephp.org/articles/view/225
Thanks!! But I have to make following changes on your codes before it
runs, maybe because that CakePHP keeps changing.

file "views/helpers/fpdf.php"

1. "vendors(...);" is wrong, should be "vendor(...)" without "s".
2. add following additional var:

function fpdfHelper extends FPDF(){
var $helpers = array(); //I guess it is mandatory for latest
CakePHP
}
3.change default value in function fpdfOutput to be "D" instead of
's', so that:
function fpdfOutput ($name = 'page.pdf', $destination = 'D')
   I have tried all options, only this works stable both in IE and
FireFox. Otherwise, there are chances showing messy or blank page. -_-

file "views/layouts/pdf.ctp" (I use *.ctp instead of *.thtml")
==
//don't need this header output, because "vendors/fpdf/fpdf.php" has
done this line
//header("Content-type: application/pdf");


Accordingly, I use "$fpdf->fpdfOutput()" instead of "echo $fpdf-
>fpdfOutput();"

Anyway, your codes help me a lot. Thanks. I will keep playing with
your extending codes.

On 1月17日, 下午12时42分, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> you might also take a gander at the google cache for the old 
> wikihttp://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tut...
>
> I send an email to the foundation offering to bring this up to date
> and to the bakery, since I'm going to start to use it again soon

On 1月17日, 下午12时42分, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> you might also take a gander at the google cache for the old 
> wikihttp://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tut...
>
> I send an email to the foundation offering to bring this up to date
> and to the bakery, since I'm going to start to use it again soon
>
> Sam D
>
> On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thank for quick prompt, Chris. Your solution for swf really helps me to
> > think of the solution.
> > I may scratch a similiar way forFPDF.
>
> > BTW, I wonder whether it be better to define afpdfHelper rather than
> > do in Controller?
>
> > Anyway, I ga to whip now
>
> --
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-02-12 Thread jinhr

Samuel,
I have just read your bakery articl "PDF helper using pdf php" http://
bakery.cakephp.org/articles/view/218
But I failed to run your codes:
-- begin error message --
Notice: Undefined property: fpdfHelper::$helpers in C:\MyDocuments
\workspace\addons\cake\cake_1.2.0.4451alpha\cake\libs\view\view.php
-- end error message --

You declared that "class fpdfHelper extends FPDF", but I guess it also
should "extends Helper" to be a legal Helper. But php doesn't permit
extending from 2 classes.

Any idea?


On 1月17日, 下午12时42分, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> you might also take a gander at the google cache for the old 
> wikihttp://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tut...
>
> I send an email to the foundation offering to bring this up to date
> and to the bakery, since I'm going to start to use it again soon
>
> Sam D
>
> On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thank for quick prompt, Chris. Your solution for swf really helps me to
> > think of the solution.
> > I may scratch a similiar way forFPDF.
>
> > BTW, I wonder whether it be better to define afpdfHelper rather than
> > do in Controller?
>
> > Anyway, I ga to whip now
>
> --
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-01-17 Thread Dr. Tarique Sani


On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:
Just like you would use any third party code.


My question: How can I use FPDF smoothly into CakePHP framework? Should
I define it as Component or Helper? Anybody has such experience or even
sharable codes?


You can get started by putting FPDF in the vendors folder and using it
in your controller with
vendor('fpdf');
$fpdf = new fpdpf();
.

As your code evolves you can refactor the fpdf related methods into a
component. (you will most likely never need a helper as helpers are
related to views)

HTH

Tarique

--
=
PHP Applications for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-01-17 Thread Samuel DeVore


you might also take a gander at the google cache for the old wiki
http://72.14.253.104/search?q=cache:B-P_vGNWzN8J:wiki.cakephp.org/tutorials:creating_pdfs_easy+fpdf+cakephp+wiki&hl=en&gl=us&ct=clnk&cd=1

I send an email to the foundation offering to bring this up to date
and to the bakery, since I'm going to start to use it again soon

Sam D

On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:


Thank for quick prompt, Chris. Your solution for swf really helps me to
think of the solution.
I may scratch a similiar way for FPDF.

BTW, I wonder whether it be better to define a fpdf Helper rather than
do in Controller?

Anyway, I ga to whip now


>




--
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-01-17 Thread jinhr


Thank for quick prompt, Chris. Your solution for swf really helps me to
think of the solution.
I may scratch a similiar way for FPDF.

BTW, I wonder whether it be better to define a fpdf Helper rather than
do in Controller?

Anyway, I ga to whip now


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need advise on pdf generation with FPDF

2007-01-17 Thread Chris Hartjes


On 1/17/07, jinhr <[EMAIL PROTECTED]> wrote:


Hi there,
I need advise on PDF creation with my current project. I may choose
FPDF (http://www.fpdf.org/)

When visitors fill and submit a HTML form, besides data going into
MySQL, a PDF file should be created with these data and emailed as
attachment.

My question: How can I use FPDF smoothly into CakePHP framework? Should
I define it as Component or Helper? Anybody has such experience or even
sharable codes?



Hi Henry,

I suggest you check out my blog posting about my experiences
integrating PHP/SWF charts with CakePHP.  That will show you where to
locate FPDF and hopefully provide you with some tips on how to
integrate it.

http://www.littlehart.net/atthekeyboard/2006/09/26/tutorial-integrating-phpswf-charts-with-cakephp/

--
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Need advise on pdf generation with FPDF

2007-01-17 Thread jinhr


Hi there,
I need advise on PDF creation with my current project. I may choose
FPDF (http://www.fpdf.org/)

When visitors fill and submit a HTML form, besides data going into
MySQL, a PDF file should be created with these data and emailed as
attachment.

My question: How can I use FPDF smoothly into CakePHP framework? Should
I define it as Component or Helper? Anybody has such experience or even
sharable codes?

Thanks.

Henry @ Toronto


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---