有谷歌视觉api PDF转换的问题

I am implementing google vision API to convert pdf to text. I am at the end everything works fine but getting an error at the end

I have used

https://github.com/GoogleCloudPlatform/php-docs-samples/blob/master/vision/src/detect_pdf_gcs.php

Output file is showing Output files:

OCR_PDF_TEST_OUTPUT/output-1-to-2.json

But after that getting

Call to a member function downloadAsString() on null

.

$jsonString = $firstObject->downloadAsString();
    $firstBatch = new AnnotateFileResponse();
    $firstBatch->mergeFromJsonString($jsonString);