add option to export background grid to pdf

preferencesAboutTextFull
letsfindaway 4 years ago
parent 4218f70158
commit 490b9dee3e
  1. 1
      resources/etc/OpenBoard.config
  2. 8
      src/adaptors/UBExportPDF.cpp
  3. 1
      src/core/UBSettings.cpp
  4. 1
      src/core/UBSettings.h

@ -128,6 +128,7 @@ Margin=20
PageFormat=A4
Resolution=300
ZoomBehavior=4
ExportBackgroundGrid=false
[Podcast]
AudioRecordingDevice=Default

@ -106,7 +106,15 @@ bool UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
// set background to white, no crossing for PDF output
bool isDark = scene->isDarkBackground();
UBPageBackground pageBackground = scene->pageBackground();
if (UBSettings::settings()->exportBackgroundGrid->get().toBool())
{
scene->setBackground(false, pageBackground);
}
else
{
scene->setBackground(false, UBPageBackground::plain);
}
// 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.

@ -409,6 +409,7 @@ void UBSettings::init()
pdfZoomBehavior = new UBSetting(this, "PDF", "ZoomBehavior", "4");
enableQualityLossToIncreaseZoomPerfs = new UBSetting(this, "PDF", "enableQualityLossToIncreaseZoomPerfs", true);
exportBackgroundGrid = new UBSetting(this, "PDF", "ExportBackgroundGrid", false);
podcastFramesPerSecond = new UBSetting(this, "Podcast", "FramesPerSecond", 10);
podcastVideoSize = new UBSetting(this, "Podcast", "VideoSize", "Medium");

@ -361,6 +361,7 @@ class UBSettings : public QObject
UBSetting* pdfZoomBehavior;
UBSetting* enableQualityLossToIncreaseZoomPerfs;
UBSetting* exportBackgroundGrid;
UBSetting* podcastFramesPerSecond;
UBSetting* podcastVideoSize;

Loading…
Cancel
Save