File indexing completed on 2024-05-05 04:01:43

0001 /*
0002     SPDX-FileCopyrightText: 2019 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #include "codepdfprinter.h"
0008 
0009 #include <QApplication>
0010 #include <QCommandLineParser>
0011 
0012 int main(int argc, char **argv)
0013 {
0014     QApplication app(argc, argv);
0015 
0016     QCommandLineParser parser;
0017     parser.addHelpOption();
0018     parser.addPositionalArgument(QStringLiteral("source"), QStringLiteral("The source file to print."));
0019     parser.addPositionalArgument(QStringLiteral("pdf"), QStringLiteral("The PDF file to print to."));
0020     parser.process(app);
0021 
0022     if (parser.positionalArguments().size() < 2) {
0023         parser.showHelp();
0024     }
0025 
0026     CodePdfPrinter printer;
0027     if (printer.openSourceFile(parser.positionalArguments().at(0))) {
0028         printer.printPdfFile(parser.positionalArguments().at(1));
0029     }
0030 
0031     return 0;
0032 }