Im using cloud vision to detect text in a pdf file.Ive used the code provided in the documentation but it throws an error saying unsupported input file format.im using 100% sure the file is pdf and i even used the sample resource file https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/vision/cloud-client/detect/resources/kafka.pdf what should i do?????????
EDIT
This is the code taken staright from the documentation which i used.
const vision = require('@google-cloud/vision').v1;
const client = new vision.ImageAnnotatorClient();
const gcsSourceUri = `gs://${bucketName}/${fileName}`;
const gcsDestinationUri = `gs://${bucketName}/${outputPrefix}/`;
const inputConfig = {
// Supported mime_types are: 'application/pdf' and 'image/tiff'
mimeType: 'application/pdf',
gcsSource: {
uri: gcsSourceUri,
},
};
const outputConfig = {
gcsDestination: {
uri: gcsDestinationUri,
},
};
const features = [{type: 'DOCUMENT_TEXT_DETECTION'}];
const request = {
requests: [
{
inputConfig: inputConfig,
features: features,
outputConfig: outputConfig,
},
],
};
const [operation] = await client.asyncBatchAnnotateFiles(request);
const [filesResponse] = await operation.promise();
const destinationUri =
filesResponse.responses[0].outputConfig.gcsDestination.uri;
console.log('Json saved to: ' + destinationUri);