lastPage) to text, and writes the text to a file on disk (
lastPage is -1, this function will convert up to the
last page in the PDF file. (See also
convertToTextFile throws an error if the file could not
be created or if text extraction is prohibited by this PDF file.
This function is identical to
convertToTextString except that
it extracts to a file on disk rather than to a string in memory.
See the "Setting parameters" section in the function list for settings that affect text extraction.