trying to maintain fixes that were committed with 1a425b0 + setPdfVersion to 1.4 to help ensure compatibilty with pdf-merger

preferencesAboutTextFull
Clément Fauconnier 2 years ago
parent bee87e38d5
commit 493b6ab72b
  1. 16
      src/adaptors/UBExportFullPDF.cpp
  2. 1
      src/adaptors/UBExportPDF.cpp

@ -99,13 +99,25 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QStr
// set background to white, no grid for PDF output
bool isDark = scene->isDarkBackground();
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
scene->setRenderingQuality(UBItem::RenderingQualityHigh, UBItem::CacheNotAllowed);
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());

@ -87,6 +87,7 @@ bool UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
pdfWriter.setPageMargins(QMarginsF());
pdfWriter.setTitle(pDocumentProxy->name());
pdfWriter.setCreator("OpenBoard PDF export");
pdfWriter.setPdfVersion(QPagedPaintDevice::PdfVersion_1_4);
//need to calculate screen resolution
QDesktopWidget* desktop = UBApplication::desktop();

Loading…
Cancel
Save