Welcome Guest, Not a member yet? Register   Sign In
I need to know the recommended pdf manufacturer.
#1

hello Smile
I am trying to trial and error the pdf maker.
First up is 'tcpdf'.
To pass the process through tcpdf, I need the raw html.
However, the `view` function no longer returns html (codeigniter3 could return html using the `view` function).

PHP Code:
        // basic, portrait and A4 canvas
        $tcpdf = new TCPDF('P''mm''A4'true'UTF-8'false);
    
        
// set document information
        $tcpdf->SetCreator('TCPDF');
        $tcpdf->SetAuthor('yoshi.');
        $tcpdf->SetTitle('TCPDF Title');
        $tcpdf->SetSubject('TCPDF Subject');
        $tcpdf->SetKeywords('TCPDF, PDF, example, test, guide');
    
        
// no header
        $tcpdf->setPrintHeader(false);
        $tcpdf->setPrintFooter(false);
    
        $tcpdf
->AddPage('P');
        // $tcpdf->SetFont("kozminproregular", "", 10);
        $tcpdf->Cell(00'A4 portrait'11'C');
    
        
// from html
        $schoolCode $this->login['school']->code;
        $viewPaths = [
            'file' => self::SCHOOL_REPORT['enrollment']."/$schoolCode/enrollment.php",
            'default' => 'school/report/enrollment/school/default/enrollment',
            'mySchool' => "school/report/enrollment/school/$schoolCode/enrollment",
        ];
        $data = [
            'schoolName' =>  $this->login['school']->name
        
];

        $renderer Services::renderer();
        $html $renderer
            
->setData($data)
            // ->renderString(file_exists($viewPaths['file']) ? $viewPaths['mySchool'] : $viewPaths['default']);
            ->renderString('school/report/enrollment/school/Demo/enrollment');
        dd($html);
        $tcpdf->writeHTML($html); 

Next, the font issue.
tcpdf has few Japanese fonts supported. Therefore, I would like to use google fonts via CDN for now.

before I need to know how to get the raw html...
Reply


Messages In This Thread
I need to know the recommended pdf manufacturer. - by yoshi - 06-21-2022, 07:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB