|
|
|
@ -82,6 +82,18 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QStr |
|
|
|
|
if (!pDocumentProxy || filename.length() == 0 || pDocumentProxy->pageCount() == 0) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
PDFMerger is supposed to be working only for PDFs using 1.0 to 1.4 standard, but I encountered no issue using 1.7 documents. |
|
|
|
|
Just tested with a few documents though so it could be a total mess to restore it without any possibility to disable it if an issue is encountered |
|
|
|
|
A new setting is introduced to handle that possibility. |
|
|
|
|
Also, calling simpleExporter here instead of the following code was done because I (wrongly) assumed that both codes was doing nearly the same thing, as I never |
|
|
|
|
tested to remove the part of pdf-merger throwing an exception if pdf version is > 1.4 and that calling the following lines without modifying the version check |
|
|
|
|
throws an exception and finally calls simpleExporter->persistsDocument |
|
|
|
|
calling simpleExporter directly also resulted in fixing two issues where pdf overlay could be badly scaled (not matching with scale of annotations) |
|
|
|
|
*/ |
|
|
|
|
bool usePDFMerger = UBSettings::settings()->pdfUsePDFMerger->get().toBool(); |
|
|
|
|
if (usePDFMerger) |
|
|
|
|
{ |
|
|
|
|
//PDF
|
|
|
|
|
qDebug() << "exporting document to PDF Merger" << filename; |
|
|
|
|
QPrinter pdfPrinter; |
|
|
|
@ -143,6 +155,11 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QStr |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pdfPainter) delete pdfPainter; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
mSimpleExporter->persistsDocument(pDocumentProxy, filename); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|