mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
render backend pdf
This commit is contained in:
parent
d4c702f96c
commit
5a5bab8f63
@ -6,11 +6,6 @@
|
|||||||
- Extend conversion logic so fallback kicks in only when conversion fails, and track which elements rely on the synthetic font to avoid mixing source glyphs (`PdfJsonConversionService.java:998-1090`, `1840-2012`).
|
- Extend conversion logic so fallback kicks in only when conversion fails, and track which elements rely on the synthetic font to avoid mixing source glyphs (`PdfJsonConversionService.java:998-1090`, `1840-2012`).
|
||||||
- Update the viewer/renderer to surface conversion errors and block editing when no faithful font can be produced.
|
- Update the viewer/renderer to surface conversion errors and block editing when no faithful font can be produced.
|
||||||
|
|
||||||
- **Vector Artwork Preview**
|
|
||||||
- Reuse `contentStreams` already emitted by the backend to render vector paths alongside text/images in the React workspace (`frontend/src/proprietary/components/tools/pdfJsonEditor/PdfJsonEditorView.tsx:1048-1285`).
|
|
||||||
- Either render via Canvas/SVG on the client or call back to a server-rendered bitmap for the background. Keep edited text/images layered on top.
|
|
||||||
- Maintain export fidelity by writing any untouched vector stream back during PDF regeneration (`PdfJsonConversionService.java:1714-1799`, `520-612`).
|
|
||||||
|
|
||||||
- **Lazy Fetch Endpoints**
|
- **Lazy Fetch Endpoints**
|
||||||
- Provide separate endpoints to fetch:
|
- Provide separate endpoints to fetch:
|
||||||
1. Raw COS dictionaries/font programs when the user opens advanced panels.
|
1. Raw COS dictionaries/font programs when the user opens advanced panels.
|
||||||
|
|||||||
@ -4431,6 +4431,7 @@
|
|||||||
"noTextOnPage": "No editable text was detected on this page.",
|
"noTextOnPage": "No editable text was detected on this page.",
|
||||||
"emptyGroup": "[Empty Group]",
|
"emptyGroup": "[Empty Group]",
|
||||||
"imageLabel": "Placed image",
|
"imageLabel": "Placed image",
|
||||||
|
"pagePreviewAlt": "Page preview",
|
||||||
"empty": {
|
"empty": {
|
||||||
"title": "No document loaded",
|
"title": "No document loaded",
|
||||||
"subtitle": "Load a PDF or JSON file to begin editing text content."
|
"subtitle": "Load a PDF or JSON file to begin editing text content."
|
||||||
|
|||||||
@ -219,9 +219,11 @@ const PdfJsonEditorView = ({ data }: PdfJsonEditorViewProps) => {
|
|||||||
document: pdfDocument,
|
document: pdfDocument,
|
||||||
groupsByPage,
|
groupsByPage,
|
||||||
imagesByPage,
|
imagesByPage,
|
||||||
|
pagePreviews,
|
||||||
selectedPage,
|
selectedPage,
|
||||||
dirtyPages,
|
dirtyPages,
|
||||||
hasDocument,
|
hasDocument,
|
||||||
|
hasVectorPreview,
|
||||||
fileName,
|
fileName,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
isGeneratingPdf,
|
isGeneratingPdf,
|
||||||
@ -229,6 +231,7 @@ const PdfJsonEditorView = ({ data }: PdfJsonEditorViewProps) => {
|
|||||||
conversionProgress,
|
conversionProgress,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
forceSingleTextElement,
|
forceSingleTextElement,
|
||||||
|
requestPagePreview,
|
||||||
onLoadJson,
|
onLoadJson,
|
||||||
onSelectPage,
|
onSelectPage,
|
||||||
onGroupEdit,
|
onGroupEdit,
|
||||||
@ -403,6 +406,7 @@ const PdfJsonEditorView = ({ data }: PdfJsonEditorViewProps) => {
|
|||||||
const currentPage = pages[selectedPage] ?? null;
|
const currentPage = pages[selectedPage] ?? null;
|
||||||
const pageGroups = groupsByPage[selectedPage] ?? [];
|
const pageGroups = groupsByPage[selectedPage] ?? [];
|
||||||
const pageImages = imagesByPage[selectedPage] ?? [];
|
const pageImages = imagesByPage[selectedPage] ?? [];
|
||||||
|
const pagePreview = pagePreviews.get(selectedPage);
|
||||||
|
|
||||||
const extractPreferredFontId = useCallback((target?: TextGroup | null) => {
|
const extractPreferredFontId = useCallback((target?: TextGroup | null) => {
|
||||||
if (!target) {
|
if (!target) {
|
||||||
@ -615,12 +619,21 @@ const PdfJsonEditorView = ({ data }: PdfJsonEditorViewProps) => {
|
|||||||
),
|
),
|
||||||
[pageImages],
|
[pageImages],
|
||||||
);
|
);
|
||||||
|
|
||||||
const { width: pageWidth, height: pageHeight } = pageDimensions(currentPage);
|
const { width: pageWidth, height: pageHeight } = pageDimensions(currentPage);
|
||||||
const scale = useMemo(() => Math.min(MAX_RENDER_WIDTH / pageWidth, 1.5), [pageWidth]);
|
const scale = useMemo(() => Math.min(MAX_RENDER_WIDTH / pageWidth, 1.5), [pageWidth]);
|
||||||
const scaledWidth = pageWidth * scale;
|
const scaledWidth = pageWidth * scale;
|
||||||
const scaledHeight = pageHeight * scale;
|
const scaledHeight = pageHeight * scale;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!hasDocument || !hasVectorPreview) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
requestPagePreview(selectedPage, scale);
|
||||||
|
if (selectedPage + 1 < pages.length) {
|
||||||
|
requestPagePreview(selectedPage + 1, scale);
|
||||||
|
}
|
||||||
|
}, [hasDocument, hasVectorPreview, selectedPage, scale, pages.length, requestPagePreview]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setActiveGroupId(null);
|
setActiveGroupId(null);
|
||||||
setEditingGroupId(null);
|
setEditingGroupId(null);
|
||||||
@ -1123,7 +1136,23 @@ const PdfJsonEditorView = ({ data }: PdfJsonEditorViewProps) => {
|
|||||||
}}
|
}}
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
>
|
>
|
||||||
{orderedImages.map((image, imageIndex) => {
|
{pagePreview && (
|
||||||
|
<img
|
||||||
|
src={pagePreview}
|
||||||
|
alt={t('pdfJsonEditor.pagePreviewAlt', 'Page preview')}
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
inset: 0,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
objectFit: 'contain',
|
||||||
|
pointerEvents: 'none',
|
||||||
|
userSelect: 'none',
|
||||||
|
zIndex: 0,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{orderedImages.map((image, imageIndex) => {
|
||||||
if (!image?.imageData) {
|
if (!image?.imageData) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,8 @@ import { CONVERSION_ENDPOINTS } from '@app/constants/convertConstants';
|
|||||||
import apiClient from '@app/services/apiClient';
|
import apiClient from '@app/services/apiClient';
|
||||||
import { downloadBlob, downloadTextAsFile } from '@app/utils/downloadUtils';
|
import { downloadBlob, downloadTextAsFile } from '@app/utils/downloadUtils';
|
||||||
import { getFilenameFromHeaders } from '@app/utils/fileResponseUtils';
|
import { getFilenameFromHeaders } from '@app/utils/fileResponseUtils';
|
||||||
|
import { pdfWorkerManager } from '@core/services/pdfWorkerManager';
|
||||||
|
import { Util } from 'pdfjs-dist/legacy/build/pdf.mjs';
|
||||||
import {
|
import {
|
||||||
PdfJsonDocument,
|
PdfJsonDocument,
|
||||||
PdfJsonImageElement,
|
PdfJsonImageElement,
|
||||||
@ -27,6 +29,7 @@ import {
|
|||||||
valueOr,
|
valueOr,
|
||||||
} from './pdfJsonEditorUtils';
|
} from './pdfJsonEditorUtils';
|
||||||
import PdfJsonEditorView from '@app/components/tools/pdfJsonEditor/PdfJsonEditorView';
|
import PdfJsonEditorView from '@app/components/tools/pdfJsonEditor/PdfJsonEditorView';
|
||||||
|
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
||||||
|
|
||||||
const VIEW_ID = 'pdfJsonEditorView';
|
const VIEW_ID = 'pdfJsonEditorView';
|
||||||
const WORKBENCH_ID = 'custom:pdfJsonEditor' as const;
|
const WORKBENCH_ID = 'custom:pdfJsonEditor' as const;
|
||||||
@ -75,6 +78,8 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
message: string;
|
message: string;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
const [forceSingleTextElement, setForceSingleTextElement] = useState(false);
|
const [forceSingleTextElement, setForceSingleTextElement] = useState(false);
|
||||||
|
const [hasVectorPreview, setHasVectorPreview] = useState(false);
|
||||||
|
const [pagePreviews, setPagePreviews] = useState<Map<number, string>>(new Map());
|
||||||
|
|
||||||
// Lazy loading state
|
// Lazy loading state
|
||||||
const [isLazyMode, setIsLazyMode] = useState(false);
|
const [isLazyMode, setIsLazyMode] = useState(false);
|
||||||
@ -90,6 +95,11 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
const loadedDocumentRef = useRef<PdfJsonDocument | null>(null);
|
const loadedDocumentRef = useRef<PdfJsonDocument | null>(null);
|
||||||
const loadedImagePagesRef = useRef<Set<number>>(new Set());
|
const loadedImagePagesRef = useRef<Set<number>>(new Set());
|
||||||
const loadingImagePagesRef = useRef<Set<number>>(new Set());
|
const loadingImagePagesRef = useRef<Set<number>>(new Set());
|
||||||
|
const pdfDocumentRef = useRef<PDFDocumentProxy | null>(null);
|
||||||
|
const previewRequestIdRef = useRef(0);
|
||||||
|
const previewRenderingRef = useRef<Set<number>>(new Set());
|
||||||
|
const pagePreviewsRef = useRef<Map<number, string>>(pagePreviews);
|
||||||
|
const previewScaleRef = useRef<Map<number, number>>(new Map());
|
||||||
|
|
||||||
// Keep ref in sync with state for access in async callbacks
|
// Keep ref in sync with state for access in async callbacks
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -104,6 +114,19 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
loadingImagePagesRef.current = new Set(loadingImagePages);
|
loadingImagePagesRef.current = new Set(loadingImagePages);
|
||||||
}, [loadingImagePages]);
|
}, [loadingImagePages]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
pagePreviewsRef.current = pagePreviews;
|
||||||
|
}, [pagePreviews]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
if (pdfDocumentRef.current) {
|
||||||
|
pdfWorkerManager.destroyDocument(pdfDocumentRef.current);
|
||||||
|
pdfDocumentRef.current = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
const dirtyPages = useMemo(
|
const dirtyPages = useMemo(
|
||||||
() => getDirtyPages(groupsByPage, imagesByPage, originalImagesRef.current),
|
() => getDirtyPages(groupsByPage, imagesByPage, originalImagesRef.current),
|
||||||
[groupsByPage, imagesByPage],
|
[groupsByPage, imagesByPage],
|
||||||
@ -147,6 +170,50 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
setSelectedPage(0);
|
setSelectedPage(0);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const clearPdfPreview = useCallback(() => {
|
||||||
|
previewRequestIdRef.current += 1;
|
||||||
|
previewRenderingRef.current.clear();
|
||||||
|
previewScaleRef.current.clear();
|
||||||
|
const empty = new Map<number, string>();
|
||||||
|
pagePreviewsRef.current = empty;
|
||||||
|
setPagePreviews(empty);
|
||||||
|
if (pdfDocumentRef.current) {
|
||||||
|
pdfWorkerManager.destroyDocument(pdfDocumentRef.current);
|
||||||
|
pdfDocumentRef.current = null;
|
||||||
|
}
|
||||||
|
setHasVectorPreview(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const initializePdfPreview = useCallback(
|
||||||
|
async (file: File) => {
|
||||||
|
const requestId = ++previewRequestIdRef.current;
|
||||||
|
try {
|
||||||
|
const buffer = await file.arrayBuffer();
|
||||||
|
const pdfDocument = await pdfWorkerManager.createDocument(buffer);
|
||||||
|
if (previewRequestIdRef.current !== requestId) {
|
||||||
|
pdfWorkerManager.destroyDocument(pdfDocument);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pdfDocumentRef.current) {
|
||||||
|
pdfWorkerManager.destroyDocument(pdfDocumentRef.current);
|
||||||
|
}
|
||||||
|
pdfDocumentRef.current = pdfDocument;
|
||||||
|
previewRenderingRef.current.clear();
|
||||||
|
previewScaleRef.current.clear();
|
||||||
|
const empty = new Map<number, string>();
|
||||||
|
pagePreviewsRef.current = empty;
|
||||||
|
setPagePreviews(empty);
|
||||||
|
setHasVectorPreview(true);
|
||||||
|
} catch (error) {
|
||||||
|
if (previewRequestIdRef.current === requestId) {
|
||||||
|
console.warn('[PdfJsonEditor] Failed to initialise PDF preview:', error);
|
||||||
|
clearPdfPreview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[clearPdfPreview],
|
||||||
|
);
|
||||||
|
|
||||||
// Load images for a page in lazy mode
|
// Load images for a page in lazy mode
|
||||||
const loadImagesForPage = useCallback(
|
const loadImagesForPage = useCallback(
|
||||||
async (pageIndex: number) => {
|
async (pageIndex: number) => {
|
||||||
@ -439,6 +506,12 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (isPdf) {
|
||||||
|
initializePdfPreview(file);
|
||||||
|
} else {
|
||||||
|
clearPdfPreview();
|
||||||
|
}
|
||||||
|
|
||||||
setLoadedDocument(parsed);
|
setLoadedDocument(parsed);
|
||||||
resetToDocument(parsed);
|
resetToDocument(parsed);
|
||||||
setIsLazyMode(shouldUseLazyMode);
|
setIsLazyMode(shouldUseLazyMode);
|
||||||
@ -460,6 +533,7 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
|
|
||||||
setLoadedDocument(null);
|
setLoadedDocument(null);
|
||||||
resetToDocument(null);
|
resetToDocument(null);
|
||||||
|
clearPdfPreview();
|
||||||
|
|
||||||
if (isPdf) {
|
if (isPdf) {
|
||||||
const errorMsg =
|
const errorMsg =
|
||||||
@ -806,13 +880,99 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
t,
|
t,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const requestPagePreview = useCallback(
|
||||||
|
async (pageIndex: number, scale: number) => {
|
||||||
|
if (!hasVectorPreview || !pdfDocumentRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const currentToken = previewRequestIdRef.current;
|
||||||
|
const recordedScale = previewScaleRef.current.get(pageIndex);
|
||||||
|
if (
|
||||||
|
pagePreviewsRef.current.has(pageIndex) &&
|
||||||
|
recordedScale !== undefined &&
|
||||||
|
Math.abs(recordedScale - scale) < 0.05
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (previewRenderingRef.current.has(pageIndex)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
previewRenderingRef.current.add(pageIndex);
|
||||||
|
try {
|
||||||
|
const page = await pdfDocumentRef.current.getPage(pageIndex + 1);
|
||||||
|
const viewport = page.getViewport({ scale: Math.max(scale, 0.5) });
|
||||||
|
const canvas = document.createElement('canvas');
|
||||||
|
canvas.width = viewport.width;
|
||||||
|
canvas.height = viewport.height;
|
||||||
|
const context = canvas.getContext('2d');
|
||||||
|
if (!context) {
|
||||||
|
page.cleanup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await page.render({ canvasContext: context, viewport }).promise;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const textContent = await page.getTextContent();
|
||||||
|
const maskMarginX = Math.max(0.45 * scale, 0.45);
|
||||||
|
const maskMarginY = Math.max(0.85 * scale, 0.85);
|
||||||
|
context.save();
|
||||||
|
context.globalCompositeOperation = 'destination-out';
|
||||||
|
context.fillStyle = '#000000';
|
||||||
|
for (const item of textContent.items) {
|
||||||
|
const transform = Util.transform(viewport.transform, item.transform);
|
||||||
|
const a = transform[0];
|
||||||
|
const b = transform[1];
|
||||||
|
const c = transform[2];
|
||||||
|
const d = transform[3];
|
||||||
|
const e = transform[4];
|
||||||
|
const f = transform[5];
|
||||||
|
const angle = Math.atan2(b, a);
|
||||||
|
|
||||||
|
const width = (item.width || 0) * viewport.scale + maskMarginX * 2;
|
||||||
|
const fontHeight = Math.hypot(c, d);
|
||||||
|
const rawHeight = item.height ? item.height * viewport.scale : fontHeight;
|
||||||
|
const height = Math.max(rawHeight + maskMarginY * 2, fontHeight + maskMarginY * 2);
|
||||||
|
const baselineOffset = height - maskMarginY;
|
||||||
|
|
||||||
|
context.save();
|
||||||
|
context.translate(e, f);
|
||||||
|
context.rotate(angle);
|
||||||
|
context.fillRect(-maskMarginX, -baselineOffset, width, height);
|
||||||
|
context.restore();
|
||||||
|
}
|
||||||
|
context.restore();
|
||||||
|
} catch (textError) {
|
||||||
|
console.warn('[PdfJsonEditor] Failed to strip text from preview', textError);
|
||||||
|
}
|
||||||
|
const dataUrl = canvas.toDataURL('image/png');
|
||||||
|
page.cleanup();
|
||||||
|
if (previewRequestIdRef.current !== currentToken) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
previewScaleRef.current.set(pageIndex, scale);
|
||||||
|
setPagePreviews((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
next.set(pageIndex, dataUrl);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('[PdfJsonEditor] Failed to render page preview', error);
|
||||||
|
} finally {
|
||||||
|
previewRenderingRef.current.delete(pageIndex);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[hasVectorPreview],
|
||||||
|
);
|
||||||
|
|
||||||
const viewData = useMemo<PdfJsonEditorViewData>(() => ({
|
const viewData = useMemo<PdfJsonEditorViewData>(() => ({
|
||||||
document: loadedDocument,
|
document: loadedDocument,
|
||||||
groupsByPage,
|
groupsByPage,
|
||||||
imagesByPage,
|
imagesByPage,
|
||||||
|
pagePreviews,
|
||||||
selectedPage,
|
selectedPage,
|
||||||
dirtyPages,
|
dirtyPages,
|
||||||
hasDocument,
|
hasDocument,
|
||||||
|
hasVectorPreview,
|
||||||
fileName,
|
fileName,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
isGeneratingPdf,
|
isGeneratingPdf,
|
||||||
@ -820,6 +980,7 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
conversionProgress,
|
conversionProgress,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
forceSingleTextElement,
|
forceSingleTextElement,
|
||||||
|
requestPagePreview,
|
||||||
onLoadJson: handleLoadFile,
|
onLoadJson: handleLoadFile,
|
||||||
onSelectPage: handleSelectPage,
|
onSelectPage: handleSelectPage,
|
||||||
onGroupEdit: handleGroupTextChange,
|
onGroupEdit: handleGroupTextChange,
|
||||||
@ -832,6 +993,7 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
}), [
|
}), [
|
||||||
handleImageTransform,
|
handleImageTransform,
|
||||||
imagesByPage,
|
imagesByPage,
|
||||||
|
pagePreviews,
|
||||||
dirtyPages,
|
dirtyPages,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
fileName,
|
fileName,
|
||||||
@ -845,12 +1007,14 @@ const PdfJsonEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
handleSelectPage,
|
handleSelectPage,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
hasDocument,
|
hasDocument,
|
||||||
|
hasVectorPreview,
|
||||||
isGeneratingPdf,
|
isGeneratingPdf,
|
||||||
isConverting,
|
isConverting,
|
||||||
conversionProgress,
|
conversionProgress,
|
||||||
loadedDocument,
|
loadedDocument,
|
||||||
selectedPage,
|
selectedPage,
|
||||||
forceSingleTextElement,
|
forceSingleTextElement,
|
||||||
|
requestPagePreview,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const latestViewDataRef = useRef<PdfJsonEditorViewData>(viewData);
|
const latestViewDataRef = useRef<PdfJsonEditorViewData>(viewData);
|
||||||
|
|||||||
@ -182,9 +182,11 @@ export interface PdfJsonEditorViewData {
|
|||||||
document: PdfJsonDocument | null;
|
document: PdfJsonDocument | null;
|
||||||
groupsByPage: TextGroup[][];
|
groupsByPage: TextGroup[][];
|
||||||
imagesByPage: PdfJsonImageElement[][];
|
imagesByPage: PdfJsonImageElement[][];
|
||||||
|
pagePreviews: Map<number, string>;
|
||||||
selectedPage: number;
|
selectedPage: number;
|
||||||
dirtyPages: boolean[];
|
dirtyPages: boolean[];
|
||||||
hasDocument: boolean;
|
hasDocument: boolean;
|
||||||
|
hasVectorPreview: boolean;
|
||||||
fileName: string;
|
fileName: string;
|
||||||
errorMessage: string | null;
|
errorMessage: string | null;
|
||||||
isGeneratingPdf: boolean;
|
isGeneratingPdf: boolean;
|
||||||
@ -192,6 +194,7 @@ export interface PdfJsonEditorViewData {
|
|||||||
conversionProgress: ConversionProgress | null;
|
conversionProgress: ConversionProgress | null;
|
||||||
hasChanges: boolean;
|
hasChanges: boolean;
|
||||||
forceSingleTextElement: boolean;
|
forceSingleTextElement: boolean;
|
||||||
|
requestPagePreview: (pageIndex: number, scale: number) => void;
|
||||||
onLoadJson: (file: File | null) => Promise<void> | void;
|
onLoadJson: (file: File | null) => Promise<void> | void;
|
||||||
onSelectPage: (pageIndex: number) => void;
|
onSelectPage: (pageIndex: number) => void;
|
||||||
onGroupEdit: (pageIndex: number, groupId: string, value: string) => void;
|
onGroupEdit: (pageIndex: number, groupId: string, value: string) => void;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user