Hello,
We are using the split document API, and we have the problem that this api deletes page breaks and, for some reason, section breaks could be placed in the wrong place in text (from one clause to another).
We are using splitting like this
const splitRequest = new SplitDocumentOnlineRequest({
document: requestDocument,
format: "docx",
destFileName: "SplitDocument.docx",
from: 1,
to: 5,
});
The main problem, as we see it, is that the API returns us these pages in separate documents. We receive an array of documents by page. As we see, this could be fixed:
- An ideal fix is if we could have a flag that will allow us to receive a new document with specific pages we asked for (using
from
and to
parameters) without any changes in styles, structure, e.t.c. Example
const splitRequest = new SplitDocumentOnlineRequest({
document: requestDocument,
format: "docx",
destFileName: "SplitDocument.docx",
from: 1,
to: 5,
oneDocument: true // <- new property
});
- If 1st variant is not possible, maybe you can save page breaks, section breaks, and other breaks in the final Word documents you return from the API. They should correct and work on
AppendDocumentOnlineRequest
and appendAllEntriesToOneSection: true
@LegalUp
It seems you are experiencing issues with the split document API, specifically regarding the loss of page breaks and incorrect placement of section breaks when splitting documents. Here are a couple of suggestions to address your concerns:
-
Single Document Output: You mentioned the need for a flag that would allow the API to return a single document containing the specified pages without altering the styles or structure. While this feature is not currently available, it would be a valuable enhancement to propose to the development team. You could suggest adding a property like oneDocument: true
to the request, which would ensure that the output maintains the original formatting and structure.
-
Preserving Breaks: If the first option is not feasible, you could request that the API retains page breaks, section breaks, and other formatting elements in the final documents. This would help ensure that when you use the AppendDocumentOnlineRequest
with the appendAllEntriesToOneSection: true
option, the breaks are correctly handled and positioned.
For now, I recommend submitting a feature request to the Aspose team regarding the single document output option, as well as the preservation of breaks during the split process. This feedback can help improve the API for all users.
If you have further questions or need assistance with specific code implementations, feel free to ask!
The behavior you want to achieve already exists but on other api method
The Range API allows you to save any specific range in the document to the new document, it could be page0, page1:end(if you want to save first two pages for example) other possible value is id.0.0.0 id.0.0.2 if you want save just couple of paragraphs
you can try it first using reference page and if result suits your requirements just use sdk to execute the same scenario