@@ -171,16 +171,16 @@ Splits a PDF into multiple documents by page ranges.
171171parts = client.split_pdf(
172172 " document.pdf" ,
173173 page_ranges = [
174- {" start" : 0 , " end" : 5 }, # Pages 1-5
175- {" start" : 5 , " end" : 10 }, # Pages 6-10
174+ {" start" : 0 , " end" : 4 }, # Pages 1-5
175+ {" start" : 5 , " end" : 9 }, # Pages 6-10
176176 {" start" : 10 } # Pages 11 to end
177177 ]
178178)
179179
180180# Save to specific files
181181client.split_pdf(
182182 " document.pdf" ,
183- page_ranges = [{" start" : 0 , " end" : 2 }, {" start" : 2 }],
183+ page_ranges = [{" start" : 0 , " end" : 1 }, {" start" : 2 }],
184184 output_paths = [" part1.pdf" , " part2.pdf" ]
185185)
186186
@@ -264,7 +264,7 @@ Sets custom labels/numbering for specific page ranges in a PDF.
264264- ` labels ` : List of label configurations. Each dict must contain:
265265 - ` pages ` : Page range dict with ` start ` (required) and optionally ` end `
266266 - ` label ` : String label to apply to those pages
267- - Page ranges use 0-based indexing where ` end ` is exclusive .
267+ - Page ranges use 0-based indexing where ` end ` is inclusive .
268268- ` output_path ` : Optional path to save the output file
269269
270270** Returns:**
@@ -276,8 +276,8 @@ Sets custom labels/numbering for specific page ranges in a PDF.
276276client.set_page_label(
277277 " document.pdf" ,
278278 labels = [
279- {" pages" : {" start" : 0 , " end" : 3 }, " label" : " Introduction" },
280- {" pages" : {" start" : 3 , " end" : 10 }, " label" : " Chapter 1" },
279+ {" pages" : {" start" : 0 , " end" : 2 }, " label" : " Introduction" },
280+ {" pages" : {" start" : 3 , " end" : 9 }, " label" : " Chapter 1" },
281281 {" pages" : {" start" : 10 }, " label" : " Appendix" }
282282 ],
283283 output_path = " labeled_document.pdf"
@@ -286,7 +286,7 @@ client.set_page_label(
286286# Set label for single page
287287client.set_page_label(
288288 " document.pdf" ,
289- labels = [{" pages" : {" start" : 0 , " end" : 1 }, " label" : " Cover Page" }]
289+ labels = [{" pages" : {" start" : 0 , " end" : 0 }, " label" : " Cover Page" }]
290290)
291291```
292292
@@ -318,7 +318,7 @@ client.build(input_file="report.docx") \
318318client.build(input_file = " document.pdf" ) \
319319 .add_step(" rotate-pages" , {" degrees" : 90 }) \
320320 .set_page_labels([
321- {" pages" : {" start" : 0 , " end" : 3 }, " label" : " Introduction" },
321+ {" pages" : {" start" : 0 , " end" : 2 }, " label" : " Introduction" },
322322 {" pages" : {" start" : 3 }, " label" : " Content" }
323323 ]) \
324324 .execute(output_path = " labeled_document.pdf" )
@@ -383,4 +383,4 @@ Common exceptions:
383383- ` APIError ` - General API errors with status code
384384- ` ValidationError ` - Invalid parameters
385385- ` FileNotFoundError ` - File not found
386- - ` ValueError ` - Invalid input values
386+ - ` ValueError ` - Invalid input values
0 commit comments