What do you mean by "scan a pdf " ?
If you mean recognize pdf file , you can not recognize pdf file directly because it's unsupported format by leptonica
see the following read me
The workarround is to find a tool which can extract pdf to images , then write the extracted images paths in one text file
i.e. test.pdf will be
test.txt
../image/path/1.png
../image/path/2.png
../image/path/3.png
then call tesseract as follow
tesseract test.txt path/to/output -l eng
the output.txt will contain all the recognition result for all files in test.txt
Best Regards
Essam