Wednesday, June 29, 2011

Re: FPDF or PDFlib with Cake

Sam thanks for your patience and help

2011/6/30 Dominik Gajewski <dominikgajewski1@gmail.com>:
> 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 <dominikgajewski1@gmail.com>:
>> 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.001555556,
>>        297.000083333
>> )
>> 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 <sam.sherlock@gmail.com>:
>>> 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 <dominikgajewski1@gmail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: