Document AI - returnBoundingBoxes property in layoutConfig not working

These properties were released only a few days ago across several client libraries, so I may be missing something—but returnBoundingBoxes still isn’t working for me in Document AI when I use the Layout processor

const client = new v1beta3.DocumentProcessorServiceClient();
  const name = `projects/${PROJECT_ID}/locations/${LOCATION}/processors/${PROCESSOR_ID}`;

  // Using beta3 types
  const request: protos.google.cloud.documentai.v1beta3.IProcessRequest = {
    name,
    rawDocument: {
      content: documentContent,
      mimeType,
    },
    processOptions: {
      // Beta3 has different config options
      layoutConfig: {
        returnBoundingBoxes: true,
        returnImages: true,
      },
    },
  };

  const [result] = await client.processDocument(request);

Hello @verasupport ,
At the moment, returnBoundingBoxes support might not yet be fully available in all regions or processors, even if the client library was updated.
I recommend checking the processor version and verifying if this feature is enabled in the API backend as well.

Thanks @a_aleinikov ! Could you clarify how you would check if the feature is enabled on the backend?

I’m using Layout Parser in the us region and tried versions pretrained-layout-parser-v1.0-2024-06-03 and pretrained.

For context, I’m currently using Document OCR in my app which returns the bounding data for me to visualize the data, however it’s not good at detecting tables, which layout parser seems to perform better.

Good question — you usually can’t “manually” check backend feature flags unless it’s documented.
Since you’re using a recent pretrained model, the feature should work — but sometimes it depends on the processor settings when it’s created.

Try double-check the processor settings in the Google Cloud Console (Document AI → your processor → settings) — maybe there’s an option to enable extra outputs.
If nothing obvious, open a support case or post in the Google Cloud Issue Tracker — mention your processor ID and region

Hope this helps!