|
|
|
|
@ -70,15 +70,17 @@ int XournalMain::run(int argc, char * argv[]) { |
|
|
|
|
GOptionContext * context = context = g_option_context_new("FILE"); |
|
|
|
|
|
|
|
|
|
bool optNoWarnSVN = false; |
|
|
|
|
bool optNoPdfCompress = false; |
|
|
|
|
gchar ** optFilename = NULL; |
|
|
|
|
gchar * pdfFilename = NULL; |
|
|
|
|
int openAtPageNumber = -1; |
|
|
|
|
|
|
|
|
|
GOptionEntry options[] = { |
|
|
|
|
{ "no-warn-svn", 'w', 0, G_OPTION_ARG_NONE, &optNoWarnSVN, "Do not warn this is a development release", NULL }, |
|
|
|
|
{ "create-pdf", 'p', 0, G_OPTION_ARG_FILENAME, &pdfFilename, "PDF output filename" , NULL}, |
|
|
|
|
{ "page", 'n', 0, G_OPTION_ARG_INT, &openAtPageNumber, "Jump to Page (first Page: 1)", "N" }, |
|
|
|
|
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &optFilename, "<input>" , NULL}, |
|
|
|
|
{ "no-warn-svn", 'w', 0, G_OPTION_ARG_NONE, &optNoWarnSVN, "Do not warn this is a development release", NULL }, |
|
|
|
|
{ "pdf-no-compress", 0, 0, G_OPTION_ARG_NONE, &optNoPdfCompress, "Don't compress PDF files (for debugging)", NULL }, |
|
|
|
|
{ "create-pdf", 'p', 0, G_OPTION_ARG_FILENAME, &pdfFilename, "PDF output filename", NULL }, |
|
|
|
|
{ "page", 'n', 0, G_OPTION_ARG_INT, &openAtPageNumber, "Jump to Page (first Page: 1)", "N" }, |
|
|
|
|
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &optFilename, "<input>", NULL }, |
|
|
|
|
{ NULL } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -98,6 +100,10 @@ int XournalMain::run(int argc, char * argv[]) { |
|
|
|
|
// Init threads (used for our Sheduler, Jobs)
|
|
|
|
|
g_thread_init(NULL); |
|
|
|
|
|
|
|
|
|
if(optNoPdfCompress) { |
|
|
|
|
PdfWriter::setCompressPdfOutput(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pdfFilename && optFilename && *optFilename) { |
|
|
|
|
return exportPdf(*optFilename, pdfFilename); |
|
|
|
|
} |
|
|
|
|
|