public sealed class TranslateDocumentRequest : IMessage<TranslateDocumentRequest>, IEquatable<TranslateDocumentRequest>, IDeepCloneable<TranslateDocumentRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Translation v3 API class TranslateDocumentRequest.
public DocumentOutputConfig DocumentOutputConfig { get; set; }
Optional. Output configurations.
Defines if the output file should be stored within Cloud Storage as well
as the desired output format. If not provided the translated file will
only be returned through a byte-stream and its output mime type will be
the same as the input file's mime type.
public bool EnableShadowRemovalNativePdf { get; set; }
Optional. If true, use the text removal server to remove the shadow text on
background image for native pdf translation.
Shadow removal feature can only be enabled when
is_translate_native_pdf_only: false && pdf_native_only: false
public TranslateTextGlossaryConfig GlossaryConfig { get; set; }
Optional. Glossary to be applied. The glossary must be within the same
region (have the same location-id) as the model, otherwise an
INVALID_ARGUMENT (400) error is returned.
public bool IsTranslateNativePdfOnly { get; set; }
Optional. is_translate_native_pdf_only field for external customers.
If true, the page limit of online native pdf translation is 300 and only
native pdf pages will be translated.
Optional. The labels with user-defined metadata for the request.
Label keys and values can be no longer than 63 characters (Unicode
codepoints), can only contain lowercase letters, numeric characters,
underscores and dashes. International characters are allowed. Label values
are optional. Label keys must start with a letter.
Optional. The ISO-639 language code of the input document if known, for
example, "en-US" or "sr-Latn". Supported language codes are listed in
Language Support. If the source language isn't specified, the API attempts
to identify the source language automatically and returns the source
language within the response. Source language must be specified if the
request contains a glossary or a custom model.
[[["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\u003eThis page provides documentation for the \u003ccode\u003eTranslateDocumentRequest\u003c/code\u003e class within the Google Cloud Translation v3 API for .NET, covering versions from 2.2.0 to the latest 3.9.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTranslateDocumentRequest\u003c/code\u003e class is used to configure and submit requests for translating documents, allowing for various customizations like input/output configurations, glossary application, and model selection.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eTranslateDocumentRequest\u003c/code\u003e class include settings for customized attribution, source and target language codes, model specification, and document input/output details, as well as controls for features like rotation correction and shadow removal in PDF translations.\u003c/p\u003e\n"],["\u003cp\u003eThe class supports optional settings such as user-defined metadata (labels) and determines how the translation is performed, like if it is a native pdf translation or if a custom model is used.\u003c/p\u003e\n"],["\u003cp\u003eThis request requires a parent location, and the location must match that of the custom model or glossary in use, and it implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Translation v3 API - Class TranslateDocumentRequest (3.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.8.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.7.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.6.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.5.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.4.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.3.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.2.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.1.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.0.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.4.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.3.0/Google.Cloud.Translate.V3.TranslateDocumentRequest)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.2.0/Google.Cloud.Translate.V3.TranslateDocumentRequest) \n\n public sealed class TranslateDocumentRequest : IMessage\u003cTranslateDocumentRequest\u003e, IEquatable\u003cTranslateDocumentRequest\u003e, IDeepCloneable\u003cTranslateDocumentRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Translation v3 API class TranslateDocumentRequest.\n\nA document translation request. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TranslateDocumentRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TranslateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateDocumentRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TranslateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateDocumentRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TranslateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateDocumentRequest), [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.Translate.V3](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3)\n\nAssembly\n--------\n\nGoogle.Cloud.Translate.V3.dll\n\nConstructors\n------------\n\n### TranslateDocumentRequest()\n\n public TranslateDocumentRequest()\n\n### TranslateDocumentRequest(TranslateDocumentRequest)\n\n public TranslateDocumentRequest(TranslateDocumentRequest other)\n\nProperties\n----------\n\n### CustomizedAttribution\n\n public string CustomizedAttribution { get; set; }\n\nOptional. This flag is to support user customized attribution.\nIf not provided, the default is `Machine Translated by Google`.\nCustomized attribution should follow rules in\n\u003chttps://cloud.google.com/translate/attribution#attribution_and_logos\u003e\n\n### DocumentInputConfig\n\n public DocumentInputConfig DocumentInputConfig { get; set; }\n\nRequired. Input configurations.\n\n### DocumentOutputConfig\n\n public DocumentOutputConfig DocumentOutputConfig { get; set; }\n\nOptional. Output configurations.\nDefines if the output file should be stored within Cloud Storage as well\nas the desired output format. If not provided the translated file will\nonly be returned through a byte-stream and its output mime type will be\nthe same as the input file's mime type.\n\n### EnableRotationCorrection\n\n public bool EnableRotationCorrection { get; set; }\n\nOptional. If true, enable auto rotation correction in DVS.\n\n### EnableShadowRemovalNativePdf\n\n public bool EnableShadowRemovalNativePdf { get; set; }\n\nOptional. If true, use the text removal server to remove the shadow text on\nbackground image for native pdf translation.\nShadow removal feature can only be enabled when\nis_translate_native_pdf_only: false \\&\\& pdf_native_only: false\n\n### GlossaryConfig\n\n public TranslateTextGlossaryConfig GlossaryConfig { get; set; }\n\nOptional. Glossary to be applied. The glossary must be within the same\nregion (have the same location-id) as the model, otherwise an\nINVALID_ARGUMENT (400) error is returned.\n\n### IsTranslateNativePdfOnly\n\n public bool IsTranslateNativePdfOnly { get; set; }\n\nOptional. is_translate_native_pdf_only field for external customers.\nIf true, the page limit of online native pdf translation is 300 and only\nnative pdf pages will be translated.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. The labels with user-defined metadata for the request.\n\nLabel keys and values can be no longer than 63 characters (Unicode\ncodepoints), can only contain lowercase letters, numeric characters,\nunderscores and dashes. International characters are allowed. Label values\nare optional. Label keys must start with a letter.\n\nSee \u003chttps://cloud.google.com/translate/docs/advanced/labels\u003e for more\ninformation.\n\n### Model\n\n public string Model { get; set; }\n\nOptional. The `model` type requested for this translation.\n\nThe format depends on model type:\n\n- AutoML Translation models:\n `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`\n\n- General (built-in) models:\n `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,\n\nIf not provided, the default Google model (NMT) will be used for\ntranslation.\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. Location to make a regional call.\n\nFormat: `projects/{project-number-or-id}/locations/{location-id}`.\n\nFor global calls, use `projects/{project-number-or-id}/locations/global` or\n`projects/{project-number-or-id}`.\n\nNon-global location is required for requests using AutoML models or custom\nglossaries.\n\nModels and glossaries must be within the same region (have the same\nlocation-id), otherwise an INVALID_ARGUMENT (400) error is returned.\n\n### SourceLanguageCode\n\n public string SourceLanguageCode { get; set; }\n\nOptional. The ISO-639 language code of the input document if known, for\nexample, \"en-US\" or \"sr-Latn\". Supported language codes are listed in\nLanguage Support. If the source language isn't specified, the API attempts\nto identify the source language automatically and returns the source\nlanguage within the response. Source language must be specified if the\nrequest contains a glossary or a custom model.\n\n### TargetLanguageCode\n\n public string TargetLanguageCode { get; set; }\n\nRequired. The ISO-639 language code to use for translation of the input\ndocument, set to one of the language codes listed in Language Support."]]