I need to create a pdf file and send with a POST request to a server. For creating pdf, the code is very simple
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output("mypdf.pdf");
For POSTing, I read the pdf file by
$file_contents = file_get_contents("mypdf.pdf");
Is there a way that I don't have to first write to file and then read back from it? Some way of doing
$file_contents = $pdf->Output();