zip download of single pdfs
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user