Re: FPDF or PDFlib with Cake

2011-06-30 Thread Dominik Gajewski
Hi
Thanks for all, it works. I found only one mistake it should be

public $Pdf = null

in helper, not private or for every method should be created method

Thanks for your help


2011/6/30 Dominik Gajewski :
> Ok i will check it, thanks
>
> 2011/6/30 gremlin :
>> If the fpdf libraries are at all recent you shouldn't have to use the
>> goofy php4 constructor. I think if you add your custom pdf class to
>> your vendors folder and instantiate it from a custom helper as a
>> member variable you could do a lot more, much more easily.
>>
>> I actually enjoyed this question so I whipped up a quick example for
>> you - https://gist.github.com/1055702
>> I make no guarantees that any of the code works right out of the 'box'
>> seeing as how I just wrote it and it hasn't been tested or even really
>> checked for consistency or errors but it should get you well on your
>> way to doing this the right way.
>>
>> On Jun 29, 3:17 pm, Dominik Gajewski 
>> wrote:
>>> Sam thanks for your patience and help
>>>
>>> 2011/6/30 Dominik Gajewski :
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> > Ok I solved all problems and it works
>>>
>>> > To last problem I added an extra argument to core function infpdf.php
>>>
>>> > functionFPDF($ww=null, $orientation='P', $unit='mm', $size='A4')
>>>
>>> > but if someone knows how to solve this without this trick i will
>>> > listen to suggestions
>>>
>>> > 2011/6/29 Dominik Gajewski :
>>> >> in TestController i added this
>>>
>>> >> var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
>>> >> , 'format'=> 'A4') );
>>>
>>> >> and got this error
>>>
>>> >> Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 
>>> >> 135]
>>> >> Code | Context
>>> >> $orientation    =       array(
>>> >>        "orientation" => "P",
>>> >>        "unit" => "mm",
>>> >>        "format" => "A4"
>>> >> )
>>> >> $unit   =       "mm"
>>> >> $size   =       array(
>>> >>        210.00156,
>>> >>        297.8
>>> >> )
>>> >> strtolower - [internal], line ??
>>> >>FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
>>> >> View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
>>> >> View::_render() - CORE\cake\libs\view\view.php, line 709
>>> >> View::render() - CORE\cake\libs\view\view.php, line 426
>>> >> Controller::render() - CORE\cake\libs\controller\controller.php, line 909
>>> >> TestsController::indexPdf() - APP\controllers\tests_controller.php, line 
>>> >> 12
>>> >> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
>>> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
>>> >> [main] - APP\webroot\index.php, line 83
>>> >>FPDFerror: Incorrect orientation: array
>>>
>>> >> So i put only var var $helpers = array('Pdf'=> 'P'));
>>>
>>> >> Notice (8): Undefined property: PdfHelper::$helpers
>>> >> [CORE\cake\libs\view\view.php, line 819]
>>>
>>> >> What is another way to launch constructor of PdfHelper
>>>
>>> >> 2011/6/29 Sam Sherlock :
>>> >>> two things
>>>
>>> >>> 1) orienation error is due to you not setting the page as either 
>>> >>> landscape
>>> >>> or portrait.
>>> >>> it seems that it should default to portrait but that message suggests
>>> >>> something is wrong - its afpdferror and you should read the docs forfpdf
>>>
>>> >>> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I 
>>> >>> think it
>>> >>> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>>>
>>> >>> I am not sure which pdf tool I used back then I do know that I tried 
>>> >>> them
>>> >>> all before deciding on the one I used.  That feature of the site has 
>>> >>> since
>>> >>> been removed for other reasons
>>>
>>> >>>  - S
>>>
>>> >>> On 29 June 2011 20:44, Dominik Gajewski  
>>> >>> wrote:
>>>
>>>         $fpdf->AddPage();
>>>     $fpdf->SetFont('Arial','B',16);
>>>     $fpdf->Cell(40,10,$data);
>>>     echo $fpdf->fpdfOutput();
>>>
>>> >>> --
>>> >>> Our newest site for the community: CakePHP Video Tutorials
>>> >>>http://tv.cakephp.org
>>> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>>> >>> others with their CakePHP related questions.
>>>
>>> >>> To unsubscribe from this group, send email to
>>> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this 
>>> >>> group at
>>> >>>http://groups.google.com/group/cake-php
>>>
>>> >> --
>>> >> Pozdrawiam
>>> >> Dominik Gajewski
>>>
>>> > --
>>> > Pozdrawiam
>>> > Dominik Gajewski
>>>
>>> --
>>> Pozdrawiam
>>> Dominik Gajewski
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>>
>
>
>
> --
> Pozdrawiam
> Dominik Gajewski
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for t

Re: FPDF or PDFlib with Cake

2011-06-30 Thread Dominik Gajewski
Ok i will check it, thanks

2011/6/30 gremlin :
> If the fpdf libraries are at all recent you shouldn't have to use the
> goofy php4 constructor. I think if you add your custom pdf class to
> your vendors folder and instantiate it from a custom helper as a
> member variable you could do a lot more, much more easily.
>
> I actually enjoyed this question so I whipped up a quick example for
> you - https://gist.github.com/1055702
> I make no guarantees that any of the code works right out of the 'box'
> seeing as how I just wrote it and it hasn't been tested or even really
> checked for consistency or errors but it should get you well on your
> way to doing this the right way.
>
> On Jun 29, 3:17 pm, Dominik Gajewski 
> wrote:
>> Sam thanks for your patience and help
>>
>> 2011/6/30 Dominik Gajewski :
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > Ok I solved all problems and it works
>>
>> > To last problem I added an extra argument to core function infpdf.php
>>
>> > functionFPDF($ww=null, $orientation='P', $unit='mm', $size='A4')
>>
>> > but if someone knows how to solve this without this trick i will
>> > listen to suggestions
>>
>> > 2011/6/29 Dominik Gajewski :
>> >> in TestController i added this
>>
>> >> var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
>> >> , 'format'=> 'A4') );
>>
>> >> and got this error
>>
>> >> Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 
>> >> 135]
>> >> Code | Context
>> >> $orientation    =       array(
>> >>        "orientation" => "P",
>> >>        "unit" => "mm",
>> >>        "format" => "A4"
>> >> )
>> >> $unit   =       "mm"
>> >> $size   =       array(
>> >>        210.00156,
>> >>        297.8
>> >> )
>> >> strtolower - [internal], line ??
>> >>FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
>> >> View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
>> >> View::_render() - CORE\cake\libs\view\view.php, line 709
>> >> View::render() - CORE\cake\libs\view\view.php, line 426
>> >> Controller::render() - CORE\cake\libs\controller\controller.php, line 909
>> >> TestsController::indexPdf() - APP\controllers\tests_controller.php, line 
>> >> 12
>> >> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
>> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
>> >> [main] - APP\webroot\index.php, line 83
>> >>FPDFerror: Incorrect orientation: array
>>
>> >> So i put only var var $helpers = array('Pdf'=> 'P'));
>>
>> >> Notice (8): Undefined property: PdfHelper::$helpers
>> >> [CORE\cake\libs\view\view.php, line 819]
>>
>> >> What is another way to launch constructor of PdfHelper
>>
>> >> 2011/6/29 Sam Sherlock :
>> >>> two things
>>
>> >>> 1) orienation error is due to you not setting the page as either 
>> >>> landscape
>> >>> or portrait.
>> >>> it seems that it should default to portrait but that message suggests
>> >>> something is wrong - its afpdferror and you should read the docs forfpdf
>>
>> >>> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think 
>> >>> it
>> >>> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>>
>> >>> I am not sure which pdf tool I used back then I do know that I tried them
>> >>> all before deciding on the one I used.  That feature of the site has 
>> >>> since
>> >>> been removed for other reasons
>>
>> >>>  - S
>>
>> >>> On 29 June 2011 20:44, Dominik Gajewski  
>> >>> wrote:
>>
>>         $fpdf->AddPage();
>>     $fpdf->SetFont('Arial','B',16);
>>     $fpdf->Cell(40,10,$data);
>>     echo $fpdf->fpdfOutput();
>>
>> >>> --
>> >>> Our newest site for the community: CakePHP Video Tutorials
>> >>>http://tv.cakephp.org
>> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>> >>> others with their CakePHP related questions.
>>
>> >>> To unsubscribe from this group, send email to
>> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> >>> at
>> >>>http://groups.google.com/group/cake-php
>>
>> >> --
>> >> Pozdrawiam
>> >> Dominik Gajewski
>>
>> > --
>> > Pozdrawiam
>> > Dominik Gajewski
>>
>> --
>> Pozdrawiam
>> Dominik Gajewski
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread gremlin
If the fpdf libraries are at all recent you shouldn't have to use the
goofy php4 constructor. I think if you add your custom pdf class to
your vendors folder and instantiate it from a custom helper as a
member variable you could do a lot more, much more easily.

I actually enjoyed this question so I whipped up a quick example for
you - https://gist.github.com/1055702
I make no guarantees that any of the code works right out of the 'box'
seeing as how I just wrote it and it hasn't been tested or even really
checked for consistency or errors but it should get you well on your
way to doing this the right way.

On Jun 29, 3:17 pm, Dominik Gajewski 
wrote:
> Sam thanks for your patience and help
>
> 2011/6/30 Dominik Gajewski :
>
>
>
>
>
>
>
>
>
> > Ok I solved all problems and it works
>
> > To last problem I added an extra argument to core function infpdf.php
>
> > functionFPDF($ww=null, $orientation='P', $unit='mm', $size='A4')
>
> > but if someone knows how to solve this without this trick i will
> > listen to suggestions
>
> > 2011/6/29 Dominik Gajewski :
> >> in TestController i added this
>
> >> var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
> >> , 'format'=> 'A4') );
>
> >> and got this error
>
> >> Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 
> >> 135]
> >> Code | Context
> >> $orientation    =       array(
> >>        "orientation" => "P",
> >>        "unit" => "mm",
> >>        "format" => "A4"
> >> )
> >> $unit   =       "mm"
> >> $size   =       array(
> >>        210.00156,
> >>        297.8
> >> )
> >> strtolower - [internal], line ??
> >>FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
> >> View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
> >> View::_render() - CORE\cake\libs\view\view.php, line 709
> >> View::render() - CORE\cake\libs\view\view.php, line 426
> >> Controller::render() - CORE\cake\libs\controller\controller.php, line 909
> >> TestsController::indexPdf() - APP\controllers\tests_controller.php, line 12
> >> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> >> [main] - APP\webroot\index.php, line 83
> >>FPDFerror: Incorrect orientation: array
>
> >> So i put only var var $helpers = array('Pdf'=> 'P'));
>
> >> Notice (8): Undefined property: PdfHelper::$helpers
> >> [CORE\cake\libs\view\view.php, line 819]
>
> >> What is another way to launch constructor of PdfHelper
>
> >> 2011/6/29 Sam Sherlock :
> >>> two things
>
> >>> 1) orienation error is due to you not setting the page as either landscape
> >>> or portrait.
> >>> it seems that it should default to portrait but that message suggests
> >>> something is wrong - its afpdferror and you should read the docs forfpdf
>
> >>> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think 
> >>> it
> >>> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>
> >>> I am not sure which pdf tool I used back then I do know that I tried them
> >>> all before deciding on the one I used.  That feature of the site has since
> >>> been removed for other reasons
>
> >>>  - S
>
> >>> On 29 June 2011 20:44, Dominik Gajewski  
> >>> wrote:
>
>         $fpdf->AddPage();
>     $fpdf->SetFont('Arial','B',16);
>     $fpdf->Cell(40,10,$data);
>     echo $fpdf->fpdfOutput();
>
> >>> --
> >>> Our newest site for the community: CakePHP Video Tutorials
> >>>http://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> at
> >>>http://groups.google.com/group/cake-php
>
> >> --
> >> Pozdrawiam
> >> Dominik Gajewski
>
> > --
> > Pozdrawiam
> > Dominik Gajewski
>
> --
> Pozdrawiam
> Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Dominik Gajewski
Sam thanks for your patience and help

2011/6/30 Dominik Gajewski :
> Ok I solved all problems and it works
>
> To last problem I added an extra argument to core function in fpdf.php
>
> function FPDF($ww=null, $orientation='P', $unit='mm', $size='A4')
>
> but if someone knows how to solve this without this trick i will
> listen to suggestions
>
> 2011/6/29 Dominik Gajewski :
>> in TestController i added this
>>
>> var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
>> , 'format'=> 'A4') );
>>
>> and got this error
>>
>> Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 135]
>> Code | Context
>> $orientation    =       array(
>>        "orientation" => "P",
>>        "unit" => "mm",
>>        "format" => "A4"
>> )
>> $unit   =       "mm"
>> $size   =       array(
>>        210.00156,
>>        297.8
>> )
>> strtolower - [internal], line ??
>> FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
>> View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
>> View::_render() - CORE\cake\libs\view\view.php, line 709
>> View::render() - CORE\cake\libs\view\view.php, line 426
>> Controller::render() - CORE\cake\libs\controller\controller.php, line 909
>> TestsController::indexPdf() - APP\controllers\tests_controller.php, line 12
>> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
>> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
>> [main] - APP\webroot\index.php, line 83
>> FPDF error: Incorrect orientation: array
>>
>>
>> So i put only var var $helpers = array('Pdf'=> 'P'));
>>
>> Notice (8): Undefined property: PdfHelper::$helpers
>> [CORE\cake\libs\view\view.php, line 819]
>>
>> What is another way to launch constructor of PdfHelper
>>
>> 2011/6/29 Sam Sherlock :
>>> two things
>>>
>>> 1) orienation error is due to you not setting the page as either landscape
>>> or portrait.
>>> it seems that it should default to portrait but that message suggests
>>> something is wrong - its a fpdf error and you should read the docs for fpdf
>>>
>>> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think it
>>> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>>>
>>>
>>> I am not sure which pdf tool I used back then I do know that I tried them
>>> all before deciding on the one I used.  That feature of the site has since
>>> been removed for other reasons
>>>
>>>  - S
>>>
>>>
>>>
>>>
>>> On 29 June 2011 20:44, Dominik Gajewski  wrote:

        $fpdf->AddPage();
    $fpdf->SetFont('Arial','B',16);
    $fpdf->Cell(40,10,$data);
    echo $fpdf->fpdfOutput();
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
>>> http://groups.google.com/group/cake-php
>>>
>>
>>
>>
>> --
>> Pozdrawiam
>> Dominik Gajewski
>>
>
>
>
> --
> Pozdrawiam
> Dominik Gajewski
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Dominik Gajewski
Ok I solved all problems and it works

To last problem I added an extra argument to core function in fpdf.php

function FPDF($ww=null, $orientation='P', $unit='mm', $size='A4')

but if someone knows how to solve this without this trick i will
listen to suggestions

2011/6/29 Dominik Gajewski :
> in TestController i added this
>
> var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
> , 'format'=> 'A4') );
>
> and got this error
>
> Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 135]
> Code | Context
> $orientation    =       array(
>        "orientation" => "P",
>        "unit" => "mm",
>        "format" => "A4"
> )
> $unit   =       "mm"
> $size   =       array(
>        210.00156,
>        297.8
> )
> strtolower - [internal], line ??
> FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
> View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
> View::_render() - CORE\cake\libs\view\view.php, line 709
> View::render() - CORE\cake\libs\view\view.php, line 426
> Controller::render() - CORE\cake\libs\controller\controller.php, line 909
> TestsController::indexPdf() - APP\controllers\tests_controller.php, line 12
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
> FPDF error: Incorrect orientation: array
>
>
> So i put only var var $helpers = array('Pdf'=> 'P'));
>
> Notice (8): Undefined property: PdfHelper::$helpers
> [CORE\cake\libs\view\view.php, line 819]
>
> What is another way to launch constructor of PdfHelper
>
> 2011/6/29 Sam Sherlock :
>> two things
>>
>> 1) orienation error is due to you not setting the page as either landscape
>> or portrait.
>> it seems that it should default to portrait but that message suggests
>> something is wrong - its a fpdf error and you should read the docs for fpdf
>>
>> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think it
>> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>>
>>
>> I am not sure which pdf tool I used back then I do know that I tried them
>> all before deciding on the one I used.  That feature of the site has since
>> been removed for other reasons
>>
>>  - S
>>
>>
>>
>>
>> On 29 June 2011 20:44, Dominik Gajewski  wrote:
>>>
>>>        $fpdf->AddPage();
>>>    $fpdf->SetFont('Arial','B',16);
>>>    $fpdf->Cell(40,10,$data);
>>>    echo $fpdf->fpdfOutput();
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
>> http://groups.google.com/group/cake-php
>>
>
>
>
> --
> Pozdrawiam
> Dominik Gajewski
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Dominik Gajewski
in TestController i added this

var $helpers = array('Pdf'=> array('orientation' => 'P','unit' => 'mm'
, 'format'=> 'A4') );

and got this error

Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 135]
Code | Context
$orientation=   array(
"orientation" => "P",
"unit" => "mm",
"format" => "A4"
)
$unit   =   "mm"
$size   =   array(
210.00156,
297.8
)
strtolower - [internal], line ??
FPDF::FPDF() - APP\vendors\fpdf\fpdf.php, line 135
View::_loadHelpers() - CORE\cake\libs\view\view.php, line 808
View::_render() - CORE\cake\libs\view\view.php, line 709
View::render() - CORE\cake\libs\view\view.php, line 426
Controller::render() - CORE\cake\libs\controller\controller.php, line 909
TestsController::indexPdf() - APP\controllers\tests_controller.php, line 12
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83
FPDF error: Incorrect orientation: array


So i put only var var $helpers = array('Pdf'=> 'P'));

Notice (8): Undefined property: PdfHelper::$helpers
[CORE\cake\libs\view\view.php, line 819]

What is another way to launch constructor of PdfHelper

2011/6/29 Sam Sherlock :
> two things
>
> 1) orienation error is due to you not setting the page as either landscape
> or portrait.
> it seems that it should default to portrait but that message suggests
> something is wrong - its a fpdf error and you should read the docs for fpdf
>
> 2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think it
> still works $fpdf->AddPage() but 1.3 migration mentions changing this)
>
>
> I am not sure which pdf tool I used back then I do know that I tried them
> all before deciding on the one I used.  That feature of the site has since
> been removed for other reasons
>
>  - S
>
>
>
>
> On 29 June 2011 20:44, Dominik Gajewski  wrote:
>>
>>        $fpdf->AddPage();
>>    $fpdf->SetFont('Arial','B',16);
>>    $fpdf->Cell(40,10,$data);
>>    echo $fpdf->fpdfOutput();
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Sam Sherlock
two things

1) orienation error is due to you not setting the page as either landscape
or portrait.
it seems that it should default to portrait but that message suggests
something is wrong - its a fpdf error and you should read the docs for fpdf

2) $this->Fpdf->AddPage() for helpers in cake  1.3 (future proof I think it
still works $fpdf->AddPage() but 1.3 migration mentions changing this)


I am not sure which pdf tool I used back then I do know that I tried them
all before deciding on the one I used.  That feature of the site has since
been removed for other reasons

 - S




On 29 June 2011 20:44, Dominik Gajewski  wrote:

>$fpdf->AddPage();
>$fpdf->SetFont('Arial','B',16);
>$fpdf->Cell(40,10,$data);
>echo $fpdf->fpdfOutput();
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Dominik Gajewski
I'm using this tutorial

http://bakery.cakephp.org/articles/sdevore_myopenid_com/2007/01/27/pdf-helper-using-fpdf

but it is prepared to Cake's version 1.2 and it gives me some errors.
I have to read about Helpers

What i did till know:


Helper views/helpers/pdf.php

 'fpdf/fpdf.php'));

if (!defined('PARAGRAPH_STRING')) define('PARAGRAPH_STRING', '~~~');

class PdfHelper extends FPDF {

/**
* Allows you to change the defaults set in the FPDF constructor
*
* @param string $orientation page orientation values: P, Portrait,
L, or Landscape(default is P)
* @param string $unit values: pt (point 1/72 of an inch), mm, cm,
in. Default is mm
* @param string $format values: A3, A4, A5, Letter, Legal or a two
element array with the width and height in unit given in $unit
*/
function setup ($orientation='P',$unit='mm',$format='A4') {
$this->FPDF($orientation, $unit, $format);
}

/**
* Allows you to control how the pdf is returned to the user, most
of the time in CakePHP you probably want the string
*
* @param string $name name of the file.
* @param string $destination where to send the document values: I, D, F, S
* @return string if the $destination is S
*/
function fpdfOutput ($name = 'page.pdf', $destination = 's') {
// I: send the file inline to the browser. The plug-in is used
if available.
//The name given by name is used when one selects the
"Save as" option on the link generating the PDF.
// D: send to the browser and force a file download with the
name given by name.
// F: save to a local file with the name given by name.
// S: return the document as a string. name is ignored.
return $this->Output($name, $destination);
}
}
?>

Layout views/layouts/pdf.ctp



Controller contollers/test_controller.php

layout = 'pdf'; //this will use the pdf.thtml layout
$this->set('data','hello world!');
$this->render();
}
}

?>

Tests View views/tests/index_pdf.ctp

AddPage();
$fpdf->SetFont('Arial','B',16);
$fpdf->Cell(40,10,$data);
echo $fpdf->fpdfOutput();
?>

And connection with cake is working but i'm getting error from FPDF

FPDF error: Incorrect orientation:





2011/6/29 Sam Sherlock :
> What is giving you issues currently?
>
> Back when 1.2 was beta I made a link that allowed users to get a off version
> of a page.
>
> Check that the vendor is found correctly
>
> Then made a simple static view out to off and build from there.
>
> Core debug will need to be 0 to display the pdf that can be frustrating.
>
> - S
>
> On 29 Jun 2011 19:47, "Dominik Gajewski"  wrote:
>> I want to create reports that take data from database and/ or form
>>
>> 2011/6/29 Sam Sherlock :
>>> the bakery does have a few articles on pdf generation within cake
>>>
>>> app import the vendor.
>>> App::import('Vendor', 'FPDF', array('file' => 'fpdf/fpdf.php'));
>>>
>>>
>>> or do you want to create a visualization of model relations in pdf
>>> format?
>>>
>>>  - S
>>>
>>>
>>>
>>>
>>> On 29 June 2011 18:54, Dominik Gajewski 
>>> wrote:

 Hi

 I would like to use FPDF or PDFlib with Cake, and I wonder how to do
 it correctly according to cake's schema

 Has anyone had any experience in this matter??

 --
 Dominik Gajewski

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> at
>>> http://groups.google.com/group/cake-php
>>>
>>
>>
>>
>> --
>> Pozdrawiam
>> Dominik Gajewski
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.g

Re: FPDF or PDFlib with Cake

2011-06-29 Thread Sam Sherlock
What is giving you issues currently?

Back when 1.2 was beta I made a link that allowed users to get a off version
of a page.

Check that the vendor is found correctly

Then made a simple static view out to off and build from there.

Core debug will need to be 0 to display the pdf that can be frustrating.

- S
On 29 Jun 2011 19:47, "Dominik Gajewski"  wrote:
> I want to create reports that take data from database and/ or form
>
> 2011/6/29 Sam Sherlock :
>> the bakery does have a few articles on pdf generation within cake
>>
>> app import the vendor.
>> App::import('Vendor', 'FPDF', array('file' => 'fpdf/fpdf.php'));
>>
>>
>> or do you want to create a visualization of model relations in pdf
format?
>>
>>  - S
>>
>>
>>
>>
>> On 29 June 2011 18:54, Dominik Gajewski 
wrote:
>>>
>>> Hi
>>>
>>> I would like to use FPDF or PDFlib with Cake, and I wonder how to do
>>> it correctly according to cake's schema
>>>
>>> Has anyone had any experience in this matter??
>>>
>>> --
>>> Dominik Gajewski
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> at http://groups.google.com/group/cake-php
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
at
>> http://groups.google.com/group/cake-php
>>
>
>
>
> --
> Pozdrawiam
> Dominik Gajewski
>
> --
> Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
at http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Dominik Gajewski
I want to create reports that take data from database and/ or form

2011/6/29 Sam Sherlock :
> the bakery does have a few articles on pdf generation within cake
>
> app import the vendor.
> App::import('Vendor', 'FPDF', array('file' => 'fpdf/fpdf.php'));
>
>
> or do you want to create a visualization of model relations in pdf format?
>
>  - S
>
>
>
>
> On 29 June 2011 18:54, Dominik Gajewski  wrote:
>>
>> Hi
>>
>> I would like to use FPDF or PDFlib with Cake, and I wonder how to do
>> it correctly according to cake's schema
>>
>> Has anyone had any experience in this matter??
>>
>> --
>> Dominik Gajewski
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
Pozdrawiam
Dominik Gajewski

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FPDF or PDFlib with Cake

2011-06-29 Thread Sam Sherlock
the bakery does have a few articles on pdf generation within cake

app import the vendor.
App::import('Vendor', '*FPDF*', array('file' => '*fpdf*/*fpdf*.php'));


or do you want to create a visualization of model relations in pdf format?

 - S




On 29 June 2011 18:54, Dominik Gajewski  wrote:

> Hi
>
> I would like to use FPDF or PDFlib with Cake, and I wonder how to do
> it correctly according to cake's schema
>
> Has anyone had any experience in this matter??
>
> --
> Dominik Gajewski
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php