Good day. It is necessary to create a pdf document in the user's basket for the site on the 1С-Bitrix control system. I started with the basics, but immediately ran into the problem. To create a pdf document I use the FPDF library. An example of my file:

<?php define('FPDF_FONTPATH','/home/host1510082/itfokos.ru/htdocs/pdf/font/'); require( 'fpdf.php' ); $pdf = new FPDF(); $pdf->SetFont('Arial','',72); $pdf->AddPage(); $pdf->Cell(40,10,"Hello World!",15); $pdf->Output(); ?> 

    1 answer 1

    Try setting a header('Content-type: application/pdf'); at the beginning header('Content-type: application/pdf'); as well as clean at the end ?>

    • Thanks, your advice helped. - Ruslan
    • ?> in principle, cleaning is not required, as long as there are no characters after this construction, including whitespace) - Finies
    • So yes, but PSR-2 is not just invented - Vadim Palgov