feat: add booklet download button, remove pdfjs-dist dependency
- Add save/download button to booklet toolbar with native file dialog - Add v2_booklet_save command to copy PDF to user-chosen location - Remove pdfjs-dist npm package (replaced by MuPDF backend) - Delete static/pdfjs/ files (~1.9MB: worker, WASM decoders, fallbacks) - Add bookletDownload i18n keys to all 4 locales
This commit is contained in:
14 files changed
+55
-322
No files matched your search
@@ -232,6 +232,26 @@ pub async fn v2_booklet_render_page(
|
||||
.map_err(|e| format!("Render task failed: {}", e))?
|
||||
}
|
||||
|
||||
/// Copy the current booklet PDF to a user-chosen destination.
|
||||
#[tauri::command]
|
||||
pub async fn v2_booklet_save(
|
||||
dest: String,
|
||||
state: tauri::State<'_, BookletState>,
|
||||
) -> Result<(), String> {
|
||||
let src = {
|
||||
let path_lock = state.current_path.lock().map_err(|e| e.to_string())?;
|
||||
path_lock
|
||||
.as_ref()
|
||||
.ok_or_else(|| "No booklet is open".to_string())?
|
||||
.clone()
|
||||
};
|
||||
|
||||
std::fs::copy(&src, &dest)
|
||||
.map_err(|e| format!("Failed to save booklet: {}", e))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Clean up the current booklet temp file.
|
||||
#[tauri::command]
|
||||
pub async fn v2_booklet_close(
|
||||
|
||||
Reference in new issue
Block a user