@kopjra/pdf-sentinel 1.1.2 → 1.3.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.
@@ -1,5 +1,5 @@
1
1
  import { PluginBatchRegistrations } from '@embedpdf/core';
2
- import { ExportCapability, ScrollCapability, HistoryCapability, ZoomCapability } from '../framework/preact.ts';
2
+ import { ExportCapability, ScrollCapability, ViewportCapability, HistoryCapability, ZoomCapability } from '../framework/preact.ts';
3
3
  import { UsePdfFormsResult } from '../plugins/forms/hooks/usePdfForms.ts';
4
4
  import { AnnotationUsage, FormUsage, PlainUsage } from '../hooks/usePdfSentinel.tsx';
5
5
  import { AnnotationsApi } from '../plugins/annotations/AnnotationProvider.tsx';
@@ -9,6 +9,8 @@ interface PdfSentinelProps {
9
9
  setZoomCapability: (capability: ZoomCapability | null) => void;
10
10
  setExportCapability: (capability: ExportCapability | null) => void;
11
11
  setScrollCapability: (scrollCapability: ScrollCapability | null) => void;
12
+ setViewportCapability: (viewportCapability: ViewportCapability | null) => void;
13
+ setDocumentScale: (scale: number) => void;
12
14
  setCurrentPage: (pageNumber: number | null) => void;
13
15
  setTotalPages: (totalPages: number | null) => void;
14
16
  setLoadingPdf: (loading: boolean) => void;
@@ -64,6 +64,11 @@ export declare function usePdfSentinel({ pdf, name, hideToolbar, onDocumentLoade
64
64
  zoomOut: () => void;
65
65
  resetZoom: () => void;
66
66
  scrollToPage: (pageNumber: number) => void;
67
+ scrollToPosition: (position: {
68
+ x: number;
69
+ y: number;
70
+ behavior?: ScrollBehavior;
71
+ }) => void;
67
72
  download: () => void;
68
73
  };
69
74
  };
@@ -1,13 +1,14 @@
1
1
  import { AnnotationCapability } from '../../framework/preact.ts';
2
2
  import { PdfAnnotationObject } from '@embedpdf/models';
3
3
  import { AnnotationField } from '../../types/annotations.ts';
4
+ import { AnnotationScope } from '@embedpdf/plugin-annotation';
4
5
  export declare const TOOL_ID = "customFreeText";
5
6
  export declare function createCustomFreeTextTool(annotationApi: Readonly<AnnotationCapability> | undefined): void;
6
7
  /**
7
8
  * Converts a PS AnnotationField to a partial PdfAnnotationObject for comparison/creation
8
9
  */
9
10
  export declare function psAnnotationToPdfAnnotation(psAnnotation: Partial<AnnotationField>): Partial<PdfAnnotationObject>;
10
- export declare function pdfAnnotationToPsAnnotation(annotation: PdfAnnotationObject): AnnotationField;
11
+ export declare function pdfAnnotationToPsAnnotation(annotation: PdfAnnotationObject | string, annoApi?: AnnotationScope | null): AnnotationField;
11
12
  /**
12
13
  * Efficient string[] comparison for arrays
13
14
  */
@@ -11,6 +11,7 @@ export interface AnnotationField {
11
11
  type: AnnotationFieldType;
12
12
  /** name in the xml file */
13
13
  id: string;
14
+ originalId?: string;
14
15
  /** title in the xml file, set to `field.type` for all fields except custom fields and conditional signature fields */
15
16
  name?: string;
16
17
  /** description for conditional signature fields, correspond to text in the pdf */