1$pdf_base64 = "base64pdf.txt";
2//Get File content from txt file
3$pdf_base64_handler = fopen($pdf_base64,'r');
4$pdf_content = fread ($pdf_base64_handler,filesize($pdf_base64));
5fclose ($pdf_base64_handler);
6//Decode pdf content
7$pdf_decoded = base64_decode ($pdf_content);
8//Write data back to pdf file
9$pdf = fopen ('test.pdf','w');
10fwrite ($pdf,$pdf_decoded);
11//close output file
12fclose ($pdf);
13echo 'Done';
14