react-vector-pdf 0.3.8 → 0.5.0

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/README.md CHANGED
@@ -188,18 +188,15 @@ Embed images (JPEG/PNG).
188
188
  <PdfImage src="https://example.com/logo.png" h={20} align="center" />
189
189
  ```
190
190
 
191
- ### 4. `PdfView` & `PdfBox`
191
+ ### 4. `PdfView`
192
192
 
193
- Containers for grouping content, adding borders, backgrounds, or margins/padding.
193
+ A container component for grouping content, adding borders, backgrounds, or margins/padding. It is the primary container for both flow and absolute layouts.
194
194
 
195
- `PdfView` is akin to a block-level `div`, and `PdfBox` is similar but allows explicit positioning.
196
-
197
- **Styling Support:**
195
+ **Props:**
198
196
 
199
- - `margin` / `padding`: Shorthand (number or object `{top, right...}`).
200
- - **Granular Props**: `marginTop`, `marginBottom`, `paddingLeft`, `paddingRight`, etc.
201
- - `borderWidth`, `borderColor`: Draw borders.
202
- - `fillColor`: Background color.
197
+ - `style`: Object with `margin`, `padding` (granular: `marginTop`, `paddingLeft` etc.), `borderWidth`, `borderColor`, `fillColor`, `radius`.
198
+ - `x`, `y`, `w`, `h`: Optional props for **absolute positioning**. If provided, the view will be placed at exactly these coordinates.
199
+ - `children`: Nested components to render inside the view.
203
200
 
204
201
  ```tsx
205
202
  <PdfView
package/dist/index.d.ts CHANGED
@@ -47,16 +47,6 @@ export declare interface PageNumberOptions {
47
47
 
48
48
  export declare type PageNumberPreset = "page-slash-total" | "slash" | "page-of-total";
49
49
 
50
- export declare const PdfBox: default_2.FC<PdfBoxProps>;
51
-
52
- declare interface PdfBoxProps extends BoxStyle {
53
- x?: number;
54
- y?: number;
55
- w?: number;
56
- h?: number;
57
- children?: default_2.ReactNode;
58
- }
59
-
60
50
  export declare const PdfDocument: default_2.FC<PdfDocumentProps>;
61
51
 
62
52
  declare interface PdfDocumentProps {
@@ -89,7 +79,11 @@ declare interface PdfImageProps {
89
79
  h?: number;
90
80
  mime?: "PNG" | "JPEG";
91
81
  flow?: boolean;
82
+ layout?: "fixed" | "flow";
83
+ sizing?: "fit" | "fill" | "auto";
92
84
  align?: "left" | "center" | "right";
85
+ showInAllPages?: boolean;
86
+ scope?: "all" | "first-only" | "except-first" | number[];
93
87
  }
94
88
 
95
89
  export declare const PdfList: default_2.FC<PdfListProps>;
@@ -150,6 +144,7 @@ export declare class PdfRenderer {
150
144
  private pendingTasks;
151
145
  private opQueue;
152
146
  private generation;
147
+ private recurringItems;
153
148
  constructor(opts?: PDFOptions);
154
149
  get instance(): jsPDF;
155
150
  get width(): number;
@@ -201,6 +196,12 @@ export declare class PdfRenderer {
201
196
  y: number;
202
197
  };
203
198
  getPageCount(): number;
199
+ registerRecurringItem(item: {
200
+ draw: () => void;
201
+ scope: any;
202
+ y: number;
203
+ height: number;
204
+ }): void;
204
205
  applyHeaderFooter(): void;
205
206
  measureText(text: string, style?: TextStyle, maxWidth?: number): {
206
207
  width: number;
@@ -234,6 +235,8 @@ declare interface PdfTableProps {
234
235
  rowStyle?: TextStyle & BoxStyle;
235
236
  alternateRowStyle?: TextStyle & BoxStyle;
236
237
  headerHeight?: number;
238
+ repeatHeader?: boolean;
239
+ striped?: boolean;
237
240
  }
238
241
 
239
242
  export declare const PdfText: default_2.FC<PdfTextProps>;
@@ -252,6 +255,10 @@ declare interface PdfViewProps {
252
255
  style?: ViewStyle;
253
256
  children?: default_2.ReactNode;
254
257
  debug?: boolean;
258
+ x?: number;
259
+ y?: number;
260
+ w?: number;
261
+ h?: number;
255
262
  }
256
263
 
257
264
  declare interface TableColumn {
@@ -269,6 +276,8 @@ export declare interface TextStyle {
269
276
  align?: Align;
270
277
  verticalAlign?: "top" | "middle" | "bottom";
271
278
  lineHeight?: number;
279
+ showInAllPages?: boolean;
280
+ scope?: "all" | "first-only" | "except-first" | number[];
272
281
  }
273
282
 
274
283
  export declare interface ViewStyle extends BoxStyle {
@@ -284,6 +293,8 @@ export declare interface ViewStyle extends BoxStyle {
284
293
  marginLeft?: number;
285
294
  width?: number | string;
286
295
  height?: number;
296
+ showInAllPages?: boolean;
297
+ scope?: "all" | "first-only" | "except-first" | number[];
287
298
  }
288
299
 
289
300
  export { }