I know this thread has been marked solved, but I think it is worth mentioning that I was able to recreate your problem.. For PDF to blob, PDF should be at least below 5MB and 10MB is the maximum threshold in MYsql (InnoDB storage engine.. again I believe this is server setting dependent, but in local server it is just too difficult to predect or observe the actual minimum and maximum), OR ELSE you will get the "mysql have gone away error"..
In the upload problem, it is not really happening after you set up your maximum upload file size, the problem seems to be on the fread.. retrieving the pdf file from the PHP temp directory.. this is where the process tend to fail.
I was able to do comparison between the fread and file_get_contents to handle the uploaded PDF file just for the purpose on converting it to BLOB data. However, the processing problems remains the same.. script timed out everytime the PDF file size exceeded the 10MB threshold.
My suggestion is to ONLY allow PDF file size of less than 2MB if this script is going to be running on the production server. Server resources must always be put into consideration at all times.