I've got a variable that gets the pdf as a binary file into the website
<?=$calculationData->PDF_file?>
How do I show the pdf as a link, instead of binary text? Note: I'm a newbie at this and don't know a lot about php! :-)
I assume $calculationData is an object from a database and the PDF content is stored there as binary data. Then you can do something like this:
Link to a PHP file that loads the content and sends it to the browser.
<a href="show_pdf.php?id=555">
Where id is the id of your calculationData somewhere in the database in this example. You need something to identify it.
show_pdf.php:
<?php
/* load your calculation data here ... */
header("Content-type: application/pdf");
header("Content-Disposition: attachment;filename='mywhateverfile.pdf'");
echo $calculationData->PDF_file;
exit();
In that way you can send the binary data to the browser and telling it with the correct headers, what to do with that data.