zip download of single pdfs

This commit is contained in:
2026-05-17 02:57:39 +02:00
parent 13097b73fc
commit 4b0046a943
11 changed files with 272 additions and 27 deletions

View File

@@ -38,6 +38,10 @@ import {
} from './pdf/pdfService';
import { usePdfThumbnails } from './pdf/usePdfThumbnails';
import { usePdfGeneratedOutputs } from './hooks/usePdfGeneratedOutputs';
import {
createSplitResultsZip,
createSplitZipFilename,
} from './pdf/pdfZipService';
import {
createSelectionPdfName,
createSelectionWorkspaceName,
@@ -85,6 +89,7 @@ const App: React.FC = () => {
const {
splitDownloads,
splitZipDownload,
subsetDownload,
exportDownload,
replaceSplitResults,
@@ -916,7 +921,11 @@ const App: React.FC = () => {
setIsBusy(true);
try {
const result = await splitIntoSinglePages(pdf);
replaceSplitResults(result);
const zipBlob = await createSplitResultsZip(result);
replaceSplitResults(result, {
blob: zipBlob,
filename: createSplitZipFilename(pdf.name),
});
} catch (e) {
console.error(e);
setError('Error while splitting PDF (see console).');
@@ -1242,6 +1251,7 @@ const App: React.FC = () => {
onOpenSelectionAsWorkspace={handleOpenSelectionAsWorkspace}
onExportReordered={handleExportReordered}
splitDownloads={splitDownloads}
splitZipDownload={splitZipDownload}
subsetDownload={subsetDownload}
exportDownload={exportDownload}
/>