Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

I want to know if Aspose.Words supports web-side modification and saving of .docx Thanks!

Discussion in 'General Discussion' started by z_yq, Dec 15, 2021.

  1. z_yq

    z_yq

    Joined:
    May 3, 2017
    Posts:
    15
    IEnumerator 读取(字符串文件名)
    {
    System.Uri uri = new System.Uri(Path.Combine(Application.streamingAssetsPath, fileName));
    UnityWebRequest 请求 = UnityWebRequest.Get(uri);
    收益率返回 request.SendWebRequest();

    if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
    {
    Debug.Log(request.error);
    }
    别的
    {
    Stream stream = new MemoryStream(request.downloadHandler.data);

    文档文档 = 新文档(流);
    DocumentBuilder builder = new DocumentBuilder(doc);

    如果(builder.MoveToBookmark(“className”))
    {
    builder.Write("11111");
    }

    //MemoryStream outStream = new MemoryStream();
    //doc.Save(outStream, SaveFormat.Docx);
    //WebGLDownloadHelper.DownloadDocx(outStream.ToArray(), "NewOne.docx");
    }
    }

    这是我的代码,在 Document doc = new Document(stream) 会出错(我很确定,stream 是正确的!):
    upload_2021-12-15_19-55-11.png
    我非常期待有人帮助我,非常感谢!
     
  2. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    741
    You'd need to ask at the forums for Aspose.Words.
     
  3. z_yq

    z_yq

    Joined:
    May 3, 2017
    Posts:
    15
    Thanks!