|
|
@ -99,13 +99,25 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QStr |
|
|
|
// set background to white, no grid for PDF output
|
|
|
|
// set background to white, no grid for PDF output
|
|
|
|
bool isDark = scene->isDarkBackground(); |
|
|
|
bool isDark = scene->isDarkBackground(); |
|
|
|
UBPageBackground pageBackground = scene->pageBackground(); |
|
|
|
UBPageBackground pageBackground = scene->pageBackground(); |
|
|
|
scene->setBackground(false, UBPageBackground::plain); |
|
|
|
|
|
|
|
|
|
|
|
bool exportDark = isDark && UBSettings::settings()->exportBackgroundColor->get().toBool(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UBSettings::settings()->exportBackgroundGrid->get().toBool()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
scene->setBackground(exportDark, pageBackground); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
scene->setBackground(exportDark, UBPageBackground::plain); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set high res rendering
|
|
|
|
// set high res rendering
|
|
|
|
scene->setRenderingQuality(UBItem::RenderingQualityHigh, UBItem::CacheNotAllowed); |
|
|
|
scene->setRenderingQuality(UBItem::RenderingQualityHigh, UBItem::CacheNotAllowed); |
|
|
|
scene->setRenderingContext(UBGraphicsScene::PdfExport); |
|
|
|
scene->setRenderingContext(UBGraphicsScene::PdfExport); |
|
|
|
|
|
|
|
|
|
|
|
QSize pageSize = scene->nominalSize(); |
|
|
|
// pageSize is the output PDF page size; it is set to equal the scene's boundary size; if the contents
|
|
|
|
|
|
|
|
// of the scene overflow from the boundaries, they will be scaled down.
|
|
|
|
|
|
|
|
QSize pageSize = scene->sceneSize(); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject()); |
|
|
|
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject()); |
|
|
|
|
|
|
|
|
|
|
|