public sealed class Document : IMessage<Document>, IEquatable<Document>, IDeepCloneable<Document>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Document AI v1beta3 API class Document.
Document represents the canonical document resource in Document AI. It is an
interchange format that provides insights into documents and allows for
collaboration between users and Document AI to iterate and optimize for
quality.
public RepeatedField<Document.Types.BlobAsset> BlobAssets { get; }
Optional. The blob assets in this document. This is used to store the
content of the inline blobs in this document, e.g. image bytes, such that
it can be referenced by other fields in the document via asset id.
Optional. Inline document content, represented as a stream of bytes.
Note: As with all bytes fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
public RepeatedField<Document.Types.Entity> Entities { get; }
A list of entities detected on
[Document.text][google.cloud.documentai.v1beta3.Document.text]. For
document shards, entities in this list may cross shard boundaries.
public RepeatedField<Document.Types.TextChange> TextChanges { get; }
Placeholder. A list of text corrections made to
[Document.text][google.cloud.documentai.v1beta3.Document.text]. This is
usually used for annotating corrections to OCR mistakes. Text changes for
a given revision may not overlap with each other.
Optional. Currently supports Google Cloud Storage URI of the form
gs://bucket_name/object_name. Object versioning is not supported.
For more information, refer to Google Cloud Storage Request
URIs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDocument\u003c/code\u003e class in the Google Cloud Document AI v1beta3 API represents a document resource, offering insights and enabling collaboration for quality optimization.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides properties like \u003ccode\u003eContent\u003c/code\u003e, \u003ccode\u003eDocumentLayout\u003c/code\u003e, \u003ccode\u003eEntities\u003c/code\u003e, and \u003ccode\u003ePages\u003c/code\u003e to access the document's binary data, parsed layout, detected entities, and page structure, respectively.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDocument\u003c/code\u003e can represent sharded documents with the \u003ccode\u003eShardInfo\u003c/code\u003e property, and it tracks processing issues via the \u003ccode\u003eError\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe class also handles document revisions, entity relations, text corrections, and styles, using several properties such as \u003ccode\u003eRevisions\u003c/code\u003e, \u003ccode\u003eEntityRelations\u003c/code\u003e, \u003ccode\u003eTextChanges\u003c/code\u003e and \u003ccode\u003eTextStyles\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eThis \u003ccode\u003eDocument\u003c/code\u003e class can have its source set to either \u003ccode\u003eContent\u003c/code\u003e, containing the inline binary data, or \u003ccode\u003eUri\u003c/code\u003e, containing the Google Cloud Storage location.\u003c/p\u003e\n"]]],[],null,["# Cloud Document AI v1beta3 API - Class Document (2.0.0-beta26)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-beta26 (latest)](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/latest/Google.Cloud.DocumentAI.V1Beta3.Document)\n- [2.0.0-beta25](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/2.0.0-beta25/Google.Cloud.DocumentAI.V1Beta3.Document)\n- [1.0.0-beta04](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/1.0.0-beta04/Google.Cloud.DocumentAI.V1Beta3.Document) \n\n public sealed class Document : IMessage\u003cDocument\u003e, IEquatable\u003cDocument\u003e, IDeepCloneable\u003cDocument\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Document AI v1beta3 API class Document.\n\nDocument represents the canonical document resource in Document AI. It is an\ninterchange format that provides insights into documents and allows for\ncollaboration between users and Document AI to iterate and optimize for\nquality. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Document \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Document](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/latest/Google.Cloud.DocumentAI.V1Beta3.Document), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Document](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/latest/Google.Cloud.DocumentAI.V1Beta3.Document), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Document](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/latest/Google.Cloud.DocumentAI.V1Beta3.Document), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DocumentAI.V1Beta3](/dotnet/docs/reference/Google.Cloud.DocumentAI.V1Beta3/latest/Google.Cloud.DocumentAI.V1Beta3)\n\nAssembly\n--------\n\nGoogle.Cloud.DocumentAI.V1Beta3.dll\n\nConstructors\n------------\n\n### Document()\n\n public Document()\n\n### Document(Document)\n\n public Document(Document other)\n\nProperties\n----------\n\n### BlobAssets\n\n public RepeatedField\u003cDocument.Types.BlobAsset\u003e BlobAssets { get; }\n\nOptional. The blob assets in this document. This is used to store the\ncontent of the inline blobs in this document, e.g. image bytes, such that\nit can be referenced by other fields in the document via asset id.\n\n### ChunkedDocument\n\n public Document.Types.ChunkedDocument ChunkedDocument { get; set; }\n\nDocument chunked based on chunking config.\n\n### Content\n\n public ByteString Content { get; set; }\n\nOptional. Inline document content, represented as a stream of bytes.\nNote: As with all `bytes` fields, protobuffers use a pure binary\nrepresentation, whereas JSON representations use base64.\n\n### Docid\n\n public string Docid { get; set; }\n\nOptional. An internal identifier for document. Should be loggable (no PII).\n\n### DocumentLayout\n\n public Document.Types.DocumentLayout DocumentLayout { get; set; }\n\nParsed layout of the document.\n\n### Entities\n\n public RepeatedField\u003cDocument.Types.Entity\u003e Entities { get; }\n\nA list of entities detected on\n\\[Document.text\\]\\[google.cloud.documentai.v1beta3.Document.text\\]. For\ndocument shards, entities in this list may cross shard boundaries.\n\n### EntityRelations\n\n public RepeatedField\u003cDocument.Types.EntityRelation\u003e EntityRelations { get; }\n\nPlaceholder. Relationship among\n\\[Document.entities\\]\\[google.cloud.documentai.v1beta3.Document.entities\\].\n\n### Error\n\n public Status Error { get; set; }\n\nAny error that occurred while processing this document.\n\n### HasContent\n\n public bool HasContent { get; }\n\nGets whether the \"content\" field is set\n\n### HasUri\n\n public bool HasUri { get; }\n\nGets whether the \"uri\" field is set\n\n### MimeType\n\n public string MimeType { get; set; }\n\nAn IANA published [media type (MIME\ntype)](https://www.iana.org/assignments/media-types/media-types.xhtml).\n\n### Pages\n\n public RepeatedField\u003cDocument.Types.Page\u003e Pages { get; }\n\nVisual page layout for the\n\\[Document\\]\\[google.cloud.documentai.v1beta3.Document\\].\n\n### Revisions\n\n public RepeatedField\u003cDocument.Types.Revision\u003e Revisions { get; }\n\nPlaceholder. Revision history of this document.\n\n### ShardInfo\n\n public Document.Types.ShardInfo ShardInfo { get; set; }\n\nInformation about the sharding if this document is sharded part of a larger\ndocument. If the document is not sharded, this message is not specified.\n\n### SourceCase\n\n public Document.SourceOneofCase SourceCase { get; }\n\n### Text\n\n public string Text { get; set; }\n\nOptional. UTF-8 encoded text in reading order from the document.\n\n### TextChanges\n\n public RepeatedField\u003cDocument.Types.TextChange\u003e TextChanges { get; }\n\nPlaceholder. A list of text corrections made to\n\\[Document.text\\]\\[google.cloud.documentai.v1beta3.Document.text\\]. This is\nusually used for annotating corrections to OCR mistakes. Text changes for\na given revision may not overlap with each other.\n\n### TextStyles\n\n [Obsolete]\n public RepeatedField\u003cDocument.Types.Style\u003e TextStyles { get; }\n\nStyles for the\n\\[Document.text\\]\\[google.cloud.documentai.v1beta3.Document.text\\].\n\n### Uri\n\n public string Uri { get; set; }\n\nOptional. Currently supports Google Cloud Storage URI of the form\n`gs://bucket_name/object_name`. Object versioning is not supported.\nFor more information, refer to [Google Cloud Storage Request\nURIs](https://cloud.google.com/storage/docs/reference-uris)."]]