We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Persisting an Aspose Document

Hi,

For one of the products we’re building, we are having to parse the document and persist parts of it. Based on further user input, we need to put these various parts together and generate a new document. Assume a document like this:


#section#
#type#Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin egestas lacus sed

  • ex lobortis volutpat.
  • Vestibulum ultrices ipsum eu porta iaculis.

Nullam rutrum vehicula turpis. Sed vitae ante non tellus consectetur mattis.

  1. Praesent posuere
  2. vehicula scelerisque.

Fusce vestibulum eros eget tellus imperdiet consequat. Vestibulum rhoncus aliquet pharetra.

#section#
#type#Body

Suspendisse posuere vitae odio sit amet euismod. Cras rutrum, arcu lobortis faucibus pretium, libero nisl hendrerit diam, in dignissim ex tortor et neque. Integer quis erat vitae risus aliquam

Suspendisse posuere
odio euismod
Donec tellus

sodales vel sit amet arcu. Maecenas ac rhoncus ante, eu tempor turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tellus nisi, finibus vel dapibus ac, mattis semper risus. Sed imperdiet elementum erat, a aliquet libero lobortis quis. Integer tincidunt felis nisl, non tempus enim sodales a. Donec sed risus vel enim auctor aliquam ut non erat. Duis rhoncus, arcu a placerat ornare, nunc nibh suscipit risus, sit amet placerat metus velit at mauris.


Since this is word, we can have a variety of content going in:

  • Plain text
  • Text with formatting
  • Lists
  • Images
  • Equations
  • Tables

The above document, we need to parse out, and persist in 2 parts:

{
  "sections": [
    {
      "type": "Introduction",
      "content": ["???"]
    },
    {
      "type": "Body",
      "content": ["???"]
    }
  ]
}

My question is a method of persisting these blocks of content and load them back to recreate. One way to do it is to extract the required properties from a Aspose.Paragraph to a custom MyParagraph object but I’m sure how you see that can soon get cumbersome. Another thing I tried is to directly persist the Aspose.Paragraph object but that approach didn’t work because it has a circular structure.

Your thoughts?

@aspose.shrayasr,

Thanks for your inquiry. Unfortunately, your question isn’t clear enough therefore we request you to please elaborate your inquiry further. Please share the complete detail of your use case along with following resources.

  • Your input Word document.
  • Please attach the expected output Word file that shows the desired behavior.

We will investigate as to how you want your final Word output be generated like. We will then provide you more information on this along with code. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.