From 015235264736595d5983180c1f3cf786bfff6e2c Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Sun, 11 Apr 2010 21:12:30 +0200 Subject: [PATCH] Implemented the save function The document gets saved to the given path. --- zathura.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zathura.c b/zathura.c index eb5e79f..53cda92 100644 --- a/zathura.c +++ b/zathura.c @@ -2325,6 +2325,15 @@ cmd_quit(int argc, char** argv) gboolean cmd_save(int argc, char** argv) { + if(argc == 0 || !Zathura.PDF.document) + return TRUE; + + char* path = g_strdup_printf("file://%s", argv[0]); + g_static_mutex_lock(&(Zathura.Lock.pdflib_lock)); + poppler_document_save(Zathura.PDF.document, path, NULL); + g_static_mutex_unlock(&(Zathura.Lock.pdflib_lock)); + g_free(path); + return TRUE; }