@embedpdf/models 1.0.20 → 1.0.21

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/pdf.d.ts CHANGED
@@ -36,6 +36,10 @@ export interface PdfDocumentObject {
36
36
  * Identity of document
37
37
  */
38
38
  id: string;
39
+ /**
40
+ * Name of the document
41
+ */
42
+ name?: string;
39
43
  /**
40
44
  * Count of pages in this document
41
45
  */
@@ -54,35 +58,35 @@ export interface PdfMetadataObject {
54
58
  /**
55
59
  * title of the document
56
60
  */
57
- title: string;
61
+ title: string | null;
58
62
  /**
59
63
  * author of the document
60
64
  */
61
- author: string;
65
+ author: string | null;
62
66
  /**
63
67
  * subject of the document
64
68
  */
65
- subject: string;
69
+ subject: string | null;
66
70
  /**
67
71
  * keywords of the document
68
72
  */
69
- keywords: string;
73
+ keywords: string | null;
70
74
  /**
71
75
  * producer of the document
72
76
  */
73
- producer: string;
77
+ producer: string | null;
74
78
  /**
75
79
  * creator of the document
76
80
  */
77
- creator: string;
81
+ creator: string | null;
78
82
  /**
79
83
  * creation date of the document
80
84
  */
81
- creationDate: string;
85
+ creationDate: Date | null;
82
86
  /**
83
87
  * modification date of the document
84
88
  */
85
- modificationDate: string;
89
+ modificationDate: Date | null;
86
90
  }
87
91
  /**
88
92
  * Unicode **soft-hyphen** marker (`U+00AD`).
@@ -1963,6 +1967,10 @@ export interface PdfFileWithoutContent {
1963
1967
  * id of file
1964
1968
  */
1965
1969
  id: string;
1970
+ /**
1971
+ * Name of the file
1972
+ */
1973
+ name?: string;
1966
1974
  }
1967
1975
  export interface PdfFileLoader extends PdfFileWithoutContent {
1968
1976
  /**
@@ -2141,6 +2149,23 @@ export interface PdfFlattenPageOptions {
2141
2149
  */
2142
2150
  flag?: PdfPageFlattenFlag;
2143
2151
  }
2152
+ /**
2153
+ * Options for preparing a PDF document for printing
2154
+ */
2155
+ export interface PdfPrintOptions {
2156
+ /**
2157
+ * Whether to include annotations in the printed document
2158
+ * @default true
2159
+ */
2160
+ includeAnnotations?: boolean;
2161
+ /**
2162
+ * Page range string defining which pages to include
2163
+ * Examples: "1,3,5-7" or "1-10,15,20-25"
2164
+ * If not specified, all pages are included
2165
+ * @default null (all pages)
2166
+ */
2167
+ pageRange?: string;
2168
+ }
2144
2169
  /**
2145
2170
  * Pdf engine
2146
2171
  *
@@ -2183,6 +2208,13 @@ export interface PdfEngine<T = Blob> {
2183
2208
  * @returns task that contains the metadata or error
2184
2209
  */
2185
2210
  getMetadata: (doc: PdfDocumentObject) => PdfTask<PdfMetadataObject>;
2211
+ /**
2212
+ * Set the metadata of the file
2213
+ * @param doc - pdf document
2214
+ * @param metadata - metadata to set
2215
+ * @returns task that contains the metadata or error
2216
+ */
2217
+ setMetadata: (doc: PdfDocumentObject, metadata: Partial<PdfMetadataObject>) => PdfTask<boolean>;
2186
2218
  /**
2187
2219
  * Get permissions of the file
2188
2220
  * @param doc - pdf document
@@ -2385,6 +2417,13 @@ export interface PdfEngine<T = Blob> {
2385
2417
  docId: string;
2386
2418
  pageIndices: number[];
2387
2419
  }>) => PdfTask<PdfFile>;
2420
+ /**
2421
+ * Prepare a PDF document for printing
2422
+ * @param doc - pdf document
2423
+ * @param options - options for preparing the document for printing
2424
+ * @returns task contains the prepared pdf file content
2425
+ */
2426
+ preparePrintDocument: (doc: PdfDocumentObject, options?: PdfPrintOptions) => PdfTask<ArrayBuffer>;
2388
2427
  /**
2389
2428
  * Save a copy of pdf document
2390
2429
  * @param doc - pdf document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/models",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "private": false,
5
5
  "description": "Shared type definitions, data models, and utility helpers (geometry, tasks, logging, PDF primitives) that underpin every package in the EmbedPDF ecosystem.",
6
6
  "type": "module",