Split the Document Into Several One-Page Documents
GroupDocs.Merger Cloud REST API provides an ability to split the document into several one-page documents by providing exact page numbers.
The following example demonstrates how to split the document into three one-page documents with 3rd, 6th, and 8th pages. As a result, these documents will be produced:
Document name
Page numbers
document_0
3
document_1
6
document_2
8
Resource URI
HTTP POST ~/join
Swagger UI lets you call this REST API directly from the browser.
cURL example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"* cURL example to join several documents into one
curl -v "https://api.groupdocs.cloud/v1.0/merger/join"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer
<jwt token>"-d "{
'JoinItems':
[
{
'FileInfo':
{
'FilePath': '/WordProcessing/four-pages.docx',
'Password': 'password'
}
},
{
'FileInfo':
{
'FilePath': '/WordProcessing/one-page.docx'
}
}
],
'OutputPath': 'output/joined.docx'
}"
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check the article to learn how to add an SDK to your project.
Split the Document Into Several One-Page Documents by Providing Exact Page Numbers
GroupDocs.Merger Cloud REST API provides an ability to split the document into several one-page documents by specifying only start/end page numbers.
The following example demonstrates how to split the document into several one-page documents starting from 3rd and ending at 7th-page number. As a result, these documents will be produced:
Document name
Page numbers
document_0
3
document_1
4
document_2
5
document_3
6
document_4
7
Resource URI
HTTP POST ~/join
Swagger UI lets you call this REST API directly from the browser.
cURL example
*Response will contain storage path to resultant documents
{"documents": [{"path": "output/split-by-start-end-numbers\sample-10-pages_0.docx"},
{"path": "output/split-by-start-end-numbers\sample-10-pages_1.docx"},
{"path": "output/split-by-start-end-numbers\sample-10-pages_2.docx"},
{"path": "output/split-by-start-end-numbers\sample-10-pages_3.docx"},
{"path": "output/split-by-start-end-numbers\sample-10-pages_4.docx"}]}
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check article to learn how to add an SDK to your project.
Split the Document Into Several One-Page Documents by Applying Filter
GroupDocs.Merger Cloud REST API provides an ability to filter even/odd pages while splitting the document into several one-page documents by specifying only start/end page numbers
The following example demonstrates how to document several one-page documents for odd pages starting from 3rd and ending at 7th-page number. As a result, these documents will be produced:
Document name
Page numbers
document_0
document_1
document_2
Resource URI
HTTP POST ~/join
Swagger UI lets you call this REST API directly from the browser.
cURL example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"* cURL example to join pages from several documents into one document
curl -v "https://api.groupdocs.cloud/v1.0/merger/split"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer
<jwt token>"-d "{
'FileInfo': { 'FilePath': 'WordProcessing/sample-10-pages.docx' },
'StartPageNumber': 3,
'EndPageNumber' : 7,
'RangeMode' : 1,
'Mode': 'Pages',
'OutputPath': 'output/split-by-start-end-numbers-with-filter'
}"
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check the article to learn how to add an SDK to your project.
Split the Document to Several Multi-Page Documents
GroupDocs.Merger Cloud REST API provides an ability to split the document into several one-page documents by providing exact page numbers.
The following example demonstrates how to split the document into three one-page documents with 3rd, 6th, and 8th pages. As a result, these documents will be produced:
Document name
Page numbers
document_0
1, 2
document_1
3, 4, 5
document_2
6, 7
document_3
8, 9, 10
Resource URI
HTTP POST ~/join
Swagger UI lets you call this REST API directly from the browser.
cURL example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"* cURL example to join pages from several documents into one document
curl -v "https://api.groupdocs.cloud/v1.0/merger/split"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer
<jwt token>"-d "{
'FileInfo': { 'FilePath': 'WordProcessing/sample-10-pages.docx' },
'Pages': [ 3, 6, 8 ],
'Mode': 1,
'OutputPath': '/output/split-to-multipage-document'
}"
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check article to learn how to add an SDK to your project.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.