How read PDF file and put content into string? Using PHP language.
Step 1 Download and install Adobe Acrobat on your computer from the official website of Adobe. Step 2 Open a PDF file in Adobe Acrobat that you want to convert into Word without changing the format. Step 3 From the menu click on File and Export. Step 4 Now choose "Microsoft Word Document" as the text format.
You could use something like pdftotext which comes with the Xpdf package on linux. The popen command can then be used to pipe the output of pdftotext into a string:
$mystring = "";
$fd = popen("/usr/bin/pdftotext blah.pdf","r");
if ($fd) {
while (($myline = fgets($fd)) !== false) {
$mystring .= $myline;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With