<?php
//require BASE_PATH.'/vendor/fpdf/fpdf.php';

if (file_exists(
    BASE_PATH . '/vendor/fpdf/fpdf.php'
)) {

    require_once
        BASE_PATH . '/vendor/fpdf/fpdf.php';

} else {

    error_log(
        "FPDF library not found"
    );

}

function generate_pdf($title,$author,$doi)
{
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetFont('Arial','B',16);
    $pdf->Cell(0,10,$title);
    $pdf->Ln(10);
    $pdf->Cell(0,10,"Author: ".$author);
    $pdf->Ln(10);
    $pdf->Cell(0,10,"DOI: ".$doi);
    return $pdf->Output('S');
}
