@docmentis/udoc-viewer 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docmentis/udoc-viewer",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Universal document viewer for PDF and PPTX files",
@@ -140,9 +140,9 @@ export interface Pick {
140
140
  doc: DocumentSource;
141
141
  /**
142
142
  * Page range to pick. Can be:
143
- * - A string like "1-3,5" (1-based page numbers)
144
- * - A single page number
145
- * - An array of page numbers
143
+ * - A string like "0-2,4" (0-based page indices)
144
+ * - A single page index
145
+ * - An array of page indices
146
146
  */
147
147
  pages: string | number | number[];
148
148
  /**
@@ -15,17 +15,17 @@ export class UDoc {
15
15
  *
16
16
  * # Arguments
17
17
  * * `compositions` - Array of compositions. Each composition is an array of picks.
18
- * Each pick is `{ doc: docIndex, pages: "1-3,5" }` where `docIndex` is the index
19
- * in the `doc_ids` array and `pages` is a page range string (1-based).
18
+ * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
19
+ * in the `doc_ids` array and `pages` is a page range string (0-based).
20
20
  * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
21
21
  *
22
22
  * # Example
23
23
  * ```js
24
- * // Create two documents: first has pages 1-3 from doc A, second has page 1 from A and 2 from B
24
+ * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
25
25
  * const newDocIds = udoc.compose_pdf(
26
26
  * [
27
- * [{ doc: 0, pages: "1-3" }],
28
- * [{ doc: 0, pages: "1" }, { doc: 1, pages: "2" }]
27
+ * [{ doc: 0, pages: "0-2" }],
28
+ * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
29
29
  * ],
30
30
  * ["doc_0", "doc_1"]
31
31
  * );
@@ -263,17 +263,17 @@ export class UDoc {
263
263
  *
264
264
  * # Arguments
265
265
  * * `compositions` - Array of compositions. Each composition is an array of picks.
266
- * Each pick is `{ doc: docIndex, pages: "1-3,5" }` where `docIndex` is the index
267
- * in the `doc_ids` array and `pages` is a page range string (1-based).
266
+ * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
267
+ * in the `doc_ids` array and `pages` is a page range string (0-based).
268
268
  * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
269
269
  *
270
270
  * # Example
271
271
  * ```js
272
- * // Create two documents: first has pages 1-3 from doc A, second has page 1 from A and 2 from B
272
+ * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
273
273
  * const newDocIds = udoc.compose_pdf(
274
274
  * [
275
- * [{ doc: 0, pages: "1-3" }],
276
- * [{ doc: 0, pages: "1" }, { doc: 1, pages: "2" }]
275
+ * [{ doc: 0, pages: "0-2" }],
276
+ * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
277
277
  * ],
278
278
  * ["doc_0", "doc_1"]
279
279
  * );
Binary file
@@ -23,7 +23,7 @@ export interface LicenseResult {
23
23
  export interface ComposePick {
24
24
  /** Document index (0-based, referring to documents in docIds array) */
25
25
  doc: number;
26
- /** Page range string (e.g., "1-3,5") - 1-based page numbers */
26
+ /** Page range string (e.g., "0-2,4") - 0-based page indices */
27
27
  pages: string;
28
28
  /** Optional rotation in degrees (0, 90, 180, or 270) */
29
29
  rotation?: 0 | 90 | 180 | 270;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docmentis/udoc-viewer",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Universal document viewer for PDF and PPTX files",