mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:16:00 +01:00
Implemented the save function
The document gets saved to the given path.
This commit is contained in:
parent
3999458f11
commit
0152352647
1 changed files with 9 additions and 0 deletions
|
@ -2325,6 +2325,15 @@ cmd_quit(int argc, char** argv)
|
||||||
gboolean
|
gboolean
|
||||||
cmd_save(int argc, char** argv)
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue