Skip to main content

Notifications

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
    Guido Preite 54,071 Super User 2024 Season 1 on at
    RE: how to convert the chinese language word document template in pdf.

    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans