web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

how to convert the chinese language word document template in pdf.

(0) ShareShare
ReportReport
Posted on by 22

This is my code. It is processed only english language word document not chinese language word document.

public static byte[] ConvertFile(ITracingService tracingService, byte[] infile, string url)
{
byte[] toArray;

try
{
using (HttpClient httpClient = new HttpClient())
{


MultipartFormDataContent multipartContent = new MultipartFormDataContent();
ByteArrayContent byteArrayContent = new ByteArrayContent(infile);
byteArrayContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") {FileName = "file"};
byteArrayContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");

multipartContent.Add(byteArrayContent);

HttpResponseMessage retrieveResponse = httpClient.PostAsync(url, multipartContent).Result;
if (retrieveResponse.IsSuccessStatusCode)
toArray = retrieveResponse.Content.ReadAsByteArrayAsync().Result;
else
{
tracingService.Trace($"Error in ConvertFile: {retrieveResponse.StatusCode}");
throw new InvalidPluginExecutionException($"Error in ConvertFile: {retrieveResponse.StatusCode}");
}
}
}
catch (Exception e)
{
tracingService.Trace($"Error in ConvertFile: {e}");
throw new InvalidPluginExecutionException(e.Message);
}

return toArray;
}

  • Guido Preite Profile Picture
    54,086 Moderator on at

    the code you posted is dealing only with binary data, has nothing to do with the language inside the word document (or if is a word document at all)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 103 Most Valuable Professional

#2
11manish Profile Picture

11manish 69 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 50

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans