Index: scribus/pagesize.cpp
===================================================================
--- scribus/pagesize.cpp	(revision 27090)
+++ scribus/pagesize.cpp	(working copy)
@@ -27,25 +27,50 @@
 
 PageSize::PageSize(const QString& sizeName)
 {
-	init(sizeName);
+	initByName(sizeName);
 }
 
 PageSize::PageSize(double w, double h)
-        : m_width(w),
-          m_height(h)
 {
-	m_pageSizeName = CommonStrings::customPageSize;
-	m_trPageSizeName = CommonStrings::trCustomPageSize;
+	initByDimensions(QSizeF(w, h));
 }
 
 PageSize& PageSize::operator=(const PageSize& other)
 {
-	init(other.name());
+	initByDimensions(QSizeF(other.width(), other.height()));
 	return *this;
 }
 
-void PageSize::init(const QString& sizeName)
+void PageSize::initByDimensions(QSizeF sizePt)
 {
+	generateSizeList();
+
+	PageSizeInfo page = pageInfoByDimensions(sizePt);
+	if (page.sizeName.isEmpty())
+	{
+		// qDebug() << Q_FUNC_INFO << "Don't found page" << sizePt;
+		m_width = sizePt.width();
+		m_height = sizePt.height();
+		m_pageUnitIndex = -1;
+		m_pageSizeName = CommonStrings::customPageSize;
+		m_trPageSizeName = CommonStrings::trCustomPageSize;
+		m_category = PageSizeInfo::Custom;
+		return;
+	}
+
+	// qDebug() << Q_FUNC_INFO << "Found page" << page.sizeName << sizePt;
+
+	m_width = page.width;
+	m_height = page.height;
+	m_pageUnitIndex = page.pageUnitIndex;
+	m_pageSizeName = page.sizeName;
+	m_trPageSizeName = page.trSizeName;
+	m_category = page.category;
+
+}
+
+void PageSize::initByName(const QString& sizeName)
+{
 	m_width = 0.0;
 	m_height = 0.0;
 	m_pageUnitIndex = -1;
@@ -124,13 +149,14 @@
 	return map;
 }
 
-PageSizeInfoMap PageSize::sizesByDimensions(QSize sizePt) const
+PageSizeInfoMap PageSize::sizesByDimensions(QSizeF sizePt) const
 {
 	PageSizeInfoMap map;
 
 	for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
 	{
-		if (it.value().width == sizePt.width() && it.value().height == sizePt.height())
+		if ((qFuzzyCompare(it.value().width, sizePt.width()) && qFuzzyCompare(it.value().height, sizePt.height())) // portrait
+			|| (qFuzzyCompare(it.value().width, sizePt.height()) && qFuzzyCompare(it.value().height, sizePt.width()))) // landscape
 			map.insert(it.value().sizeName, it.value());
 	}
 
@@ -137,6 +163,13 @@
 	return map;
 }
 
+PageSizeInfo PageSize::pageInfoByDimensions(QSizeF sizePt) const
+{
+	PageSizeInfoMap list = sizesByDimensions(sizePt);
+	return (list.empty()) ? PageSizeInfo() : list.first();
+}
+
+
 PageSizeInfoMap PageSize::activePageSizes() const
 {
 	PageSizeInfoMap map;
Index: scribus/pagesize.h
===================================================================
--- scribus/pagesize.h	(revision 27090)
+++ scribus/pagesize.h	(working copy)
@@ -61,13 +61,13 @@
 		Swedish = 57,
 	};
 
-	double width;
-	double height;
+	double width {0.0};
+	double height {0.0};
 	QString trSizeName;
 	QString sizeName;
 	QString sizeLabel;
-	int pageUnitIndex;
-	Category category;
+	int pageUnitIndex {-1};
+	Category category {PageSizeInfo::Custom};
 };
 
 using PageSizeInfoMap = QMap<QString, PageSizeInfo>;
@@ -80,7 +80,6 @@
 	PageSize(double, double);
 	PageSize& operator=(const PageSize& other);
 
-	void init(const QString&);
 	const QString& name() const { return m_pageSizeName; }
 	const QString& nameTR() const { return m_trPageSizeName; }
 	PageSizeInfo::Category category() const { return m_category; };
@@ -93,9 +92,11 @@
 	static QStringList defaultSizesList();
 	PageSizeCategoriesMap categories() const;
 	PageSizeInfoMap sizesByCategory(PageSizeInfo::Category category) const;
-	PageSizeInfoMap sizesByDimensions(QSize sizePt) const;
+	PageSizeInfoMap sizesByDimensions(QSizeF sizePt) const;
 	PageSizeInfoMap activePageSizes() const;
-	const PageSizeInfoMap& pageSizes() const { return m_pageSizeList; };
+	const PageSizeInfoMap& pageSizes() const { return m_pageSizeList; }
+	PageSizeInfo pageInfoByDimensions(double width, double height) const { return pageInfoByDimensions(QSizeF(width, height));}
+	PageSizeInfo pageInfoByDimensions(QSizeF sizePt) const;
 	void printSizeList() const;
 
 private:
@@ -107,6 +108,8 @@
 	QString m_trPageSizeName;
 	PageSizeInfo::Category m_category {PageSizeInfo::Custom};
 
+	void initByName(const QString&); // legacy support for < 1.7.1
+	void initByDimensions(QSizeF sizePt);
 	void generateSizeList();
 	void addPageSize(const QString id, double width, double height, int unitIndex, PageSizeInfo::Category category);
 	void addPageSize(const QString id, const QString name, double width, double height, int unitIndex, PageSizeInfo::Category category);
Index: scribus/plugins/fileloader/scribus171format/scribus171format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus171format/scribus171format.cpp	(revision 27090)
+++ scribus/plugins/fileloader/scribus171format/scribus171format.cpp	(working copy)
@@ -2529,7 +2529,7 @@
 	//Remove uppercase in 1.8
 	if (attrs.hasAttribute("PAGESIZE"))
 	{
-		m_Doc->setPageSize(attrs.valueAsString("PAGESIZE"));
+		// m_Doc->setPageSize(attrs.valueAsString("PAGESIZE"));
 		m_Doc->setPageOrientation(attrs.valueAsInt("ORIENTATION", 0));
 		m_Doc->FirstPnum = attrs.valueAsInt("FIRSTNUM", 1);
 		m_Doc->setPagePositioning(attrs.valueAsInt("BOOK", 0));
@@ -2569,6 +2569,9 @@
 		m_Doc->setHyphAutoCheck(attrs.valueAsBool("AUTOCHECK", false));
 		m_Doc->GuideLock = attrs.valueAsBool("GUIDELOCK", false);
 
+		PageSize ps = PageSize(m_Doc->pageWidth(), m_Doc->pageHeight());
+		m_Doc->setPageSize(ps.name());
+
 		m_Doc->rulerXoffset = attrs.valueAsDouble("rulerXoffset", 0.0);
 		m_Doc->rulerYoffset = attrs.valueAsDouble("rulerYoffset", 0.0);
 		m_Doc->SnapGuides = attrs.valueAsBool("SnapToGuides", false);
@@ -2595,7 +2598,7 @@
 	}
 	else
 	{
-		m_Doc->setPageSize(attrs.valueAsString("PageSize"));
+		// m_Doc->setPageSize(attrs.valueAsString("PageSize"));
 		m_Doc->setPageOrientation(attrs.valueAsInt("PageOrientation", 0));
 		m_Doc->FirstPnum = attrs.valueAsInt("FirstPageNumber", 1);
 		m_Doc->setPagePositioning(attrs.valueAsInt("PagePositioning", 0));
@@ -4771,8 +4774,6 @@
 	else
 		mpName = attrs.valueAsString("MasterPageName", "Normal");
 	newPage->setMasterPageName(m_Doc->masterPageMode() ? QString() : mpName);
-	if (attrs.hasAttribute("Size"))
-		newPage->setSize(attrs.valueAsString("Size"));
 	if (attrs.hasAttribute("Orientation"))
 		newPage->setOrientation(attrs.valueAsInt("Orientation"));
 
@@ -4800,16 +4801,8 @@
 	else
 		newPage->setHeight(attrs.valueAsDouble("PageHeight"));
 
-	//14704: Double check the page size should not be Custom in case the size doesn't match a standard size
-	if (attrs.hasAttribute("Size"))
-	{
-		QString pageSize(attrs.valueAsString("Size"));
-		PageSize ps(pageSize);
-		if (!compareDouble(ps.width(), newPage->width()) || !compareDouble(ps.height(), newPage->height()))
-			newPage->setSize(CommonStrings::customPageSize);
-		else
-			newPage->setSize(pageSize);
-	}
+	PageSize ps(newPage->width(), newPage->height());
+	newPage->setSize(ps.name());
 
 	newPage->setInitialHeight(newPage->height());
 	newPage->setInitialWidth(newPage->width());
Index: scribus/plugins/fileloader/scribus171format/scribus171format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus171format/scribus171format_save.cpp	(revision 27090)
+++ scribus/plugins/fileloader/scribus171format/scribus171format_save.cpp	(working copy)
@@ -333,7 +333,7 @@
 	docu.writeAttribute("BleedRight", m_Doc->bleeds()->right());
 	docu.writeAttribute("BleedBottom", m_Doc->bleeds()->bottom());
 	docu.writeAttribute("PageOrientation", m_Doc->pageOrientation());
-	docu.writeAttribute("PageSize", m_Doc->pageSize());
+	// docu.writeAttribute("PageSize", m_Doc->pageSize());
 	docu.writeAttribute("FirstPageNumber", m_Doc->FirstPnum);
 	docu.writeAttribute("PagePositioning", m_Doc->pagePositioning());
 	if (m_Doc->usesAutomaticTextFrames())
@@ -1797,7 +1797,7 @@
 		docu.writeAttribute("PageNumber",page->pageNr());
 		docu.writeAttribute("PageName",page->pageName());
 		docu.writeAttribute("MasterPageName",page->masterPageName());
-		docu.writeAttribute("Size", page->size());
+		// docu.writeAttribute("Size", page->size());
 		docu.writeAttribute("Orientation", page->orientation());
 		docu.writeAttribute("LeftPage", page->LeftPg);
 		docu.writeAttribute("Preset", page->marginPreset);
Index: scribus/plugins/import/ai/importai.cpp
===================================================================
--- scribus/plugins/import/ai/importai.cpp	(revision 27090)
+++ scribus/plugins/import/ai/importai.cpp	(working copy)
@@ -136,7 +136,7 @@
 	baseX = 0;
 	baseY = 0;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -241,7 +241,7 @@
 	docWidth = b - x;
 	docHeight = h - y;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -379,7 +379,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(b - x, h - y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(b - x, h - y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/cdr/importcdr.cpp
===================================================================
--- scribus/plugins/import/cdr/importcdr.cpp	(revision 27090)
+++ scribus/plugins/import/cdr/importcdr.cpp	(working copy)
@@ -49,7 +49,7 @@
 	docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -155,7 +155,7 @@
 	}
 	else if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 	{
-		m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+		m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 		ScCore->primaryMainWindow()->HaveNewDoc();
 		ret = true;
 		baseX = 0;
Index: scribus/plugins/import/cgm/importcgm.cpp
===================================================================
--- scribus/plugins/import/cgm/importcgm.cpp	(revision 27090)
+++ scribus/plugins/import/cgm/importcgm.cpp	(working copy)
@@ -101,7 +101,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -206,7 +206,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/cvg/importcvg.cpp
===================================================================
--- scribus/plugins/import/cvg/importcvg.cpp	(revision 27090)
+++ scribus/plugins/import/cvg/importcvg.cpp	(working copy)
@@ -55,7 +55,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -165,7 +165,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/drw/importdrw.cpp
===================================================================
--- scribus/plugins/import/drw/importdrw.cpp	(revision 27090)
+++ scribus/plugins/import/drw/importdrw.cpp	(working copy)
@@ -62,7 +62,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -180,7 +180,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/emf/importemf.cpp
===================================================================
--- scribus/plugins/import/emf/importemf.cpp	(revision 27090)
+++ scribus/plugins/import/emf/importemf.cpp	(working copy)
@@ -438,7 +438,7 @@
 	baseY = 0;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -586,7 +586,7 @@
 	}
 	else if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 	{
-		m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+		m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 		ScCore->primaryMainWindow()->HaveNewDoc();
 		m_Doc->setPageHeight(docHeight);
 		m_Doc->setPageWidth(docWidth);
Index: scribus/plugins/import/fh/importfh.cpp
===================================================================
--- scribus/plugins/import/fh/importfh.cpp	(revision 27090)
+++ scribus/plugins/import/fh/importfh.cpp	(working copy)
@@ -56,7 +56,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -163,7 +163,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/idml/importidml.cpp
===================================================================
--- scribus/plugins/import/idml/importidml.cpp	(revision 27090)
+++ scribus/plugins/import/idml/importidml.cpp	(working copy)
@@ -154,7 +154,7 @@
 		docWidth = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
 		docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 		m_Doc = new ScribusDoc();
-		m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -242,7 +242,7 @@
 	}
 
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(1, 1, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -340,7 +340,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/odg/importodg.cpp
===================================================================
--- scribus/plugins/import/odg/importodg.cpp	(revision 27090)
+++ scribus/plugins/import/odg/importodg.cpp	(working copy)
@@ -172,7 +172,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/oodraw/oodrawimp.cpp
===================================================================
--- scribus/plugins/import/oodraw/oodrawimp.cpp	(revision 27090)
+++ scribus/plugins/import/oodraw/oodrawimp.cpp	(working copy)
@@ -308,7 +308,7 @@
 	double width = !properties.attribute( "fo:page-width" ).isEmpty() ? parseUnit(properties.attribute( "fo:page-width" ) ) : 550.0;
 	double height = !properties.attribute( "fo:page-height" ).isEmpty() ? parseUnit(properties.attribute( "fo:page-height" ) ) : 841.0;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -456,7 +456,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 		}
Index: scribus/plugins/import/pages/importpages.cpp
===================================================================
--- scribus/plugins/import/pages/importpages.cpp	(revision 27090)
+++ scribus/plugins/import/pages/importpages.cpp	(working copy)
@@ -239,7 +239,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/pct/importpct.cpp
===================================================================
--- scribus/plugins/import/pct/importpct.cpp	(revision 27090)
+++ scribus/plugins/import/pct/importpct.cpp	(working copy)
@@ -62,7 +62,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -181,7 +181,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			m_Doc->setPageHeight(docHeight);
 			m_Doc->setPageWidth(docWidth);
Index: scribus/plugins/import/pdf/importpdf.cpp
===================================================================
--- scribus/plugins/import/pdf/importpdf.cpp	(revision 27090)
+++ scribus/plugins/import/pdf/importpdf.cpp	(working copy)
@@ -164,7 +164,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, 0, 0, 0, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, 0, 0, 0, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 		}
Index: scribus/plugins/import/pm/importpm.cpp
===================================================================
--- scribus/plugins/import/pm/importpm.cpp	(revision 27090)
+++ scribus/plugins/import/pm/importpm.cpp	(working copy)
@@ -54,7 +54,7 @@
 	docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -161,7 +161,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/pub/importpub.cpp
===================================================================
--- scribus/plugins/import/pub/importpub.cpp	(revision 27090)
+++ scribus/plugins/import/pub/importpub.cpp	(working copy)
@@ -57,7 +57,7 @@
 	docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -164,7 +164,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/qxp/importqxp.cpp
===================================================================
--- scribus/plugins/import/qxp/importqxp.cpp	(revision 27090)
+++ scribus/plugins/import/qxp/importqxp.cpp	(working copy)
@@ -74,7 +74,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
@@ -184,7 +184,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/shape/importshape.cpp
===================================================================
--- scribus/plugins/import/shape/importshape.cpp	(revision 27090)
+++ scribus/plugins/import/shape/importshape.cpp	(working copy)
@@ -72,7 +72,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -181,7 +181,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/sml/importsml.cpp
===================================================================
--- scribus/plugins/import/sml/importsml.cpp	(revision 27090)
+++ scribus/plugins/import/sml/importsml.cpp	(working copy)
@@ -70,7 +70,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -179,7 +179,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/svg/svgplugin.cpp
===================================================================
--- scribus/plugins/import/svg/svgplugin.cpp	(revision 27090)
+++ scribus/plugins/import/svg/svgplugin.cpp	(working copy)
@@ -237,7 +237,7 @@
 	QDomElement docElem = inpdoc.documentElement();
 	QSizeF wh = parseWidthHeight(docElem);
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(wh.width(), wh.height(), 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -411,7 +411,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(width, height, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 		}
Index: scribus/plugins/import/svm/importsvm.cpp
===================================================================
--- scribus/plugins/import/svm/importsvm.cpp	(revision 27090)
+++ scribus/plugins/import/svm/importsvm.cpp	(working copy)
@@ -308,7 +308,7 @@
 	baseY = 0;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -457,7 +457,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			m_Doc->setPageHeight(docHeight);
 			m_Doc->setPageWidth(docWidth);
Index: scribus/plugins/import/viva/importviva.cpp
===================================================================
--- scribus/plugins/import/viva/importviva.cpp	(revision 27090)
+++ scribus/plugins/import/viva/importviva.cpp	(working copy)
@@ -115,7 +115,7 @@
 	docWidth = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
 	docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -166,7 +166,7 @@
 {
 	bool success = false;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(1, 1, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -252,7 +252,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/vsd/importvsd.cpp
===================================================================
--- scribus/plugins/import/vsd/importvsd.cpp	(revision 27090)
+++ scribus/plugins/import/vsd/importvsd.cpp	(working copy)
@@ -67,7 +67,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -174,7 +174,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/wmf/wmfimport.cpp
===================================================================
--- scribus/plugins/import/wmf/wmfimport.cpp	(revision 27090)
+++ scribus/plugins/import/wmf/wmfimport.cpp	(working copy)
@@ -301,7 +301,7 @@
 	double width  = m_BBox.width() * scale;
 	double height = m_BBox.height() * scale;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -566,7 +566,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(fabs(width), fabs(height), 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(fabs(width), fabs(height), 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 		}
Index: scribus/plugins/import/wpg/importwpg.cpp
===================================================================
--- scribus/plugins/import/wpg/importwpg.cpp	(revision 27090)
+++ scribus/plugins/import/wpg/importwpg.cpp	(working copy)
@@ -418,7 +418,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -525,7 +525,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 27090)
+++ scribus/plugins/import/xar/importxar.cpp	(working copy)
@@ -70,7 +70,7 @@
 		if (id != 0x0A0DA3A3)
 			return false;
 		m_Doc = new ScribusDoc();
-		m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -276,7 +276,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = m_Doc->currentPage()->xOffset() - x;
Index: scribus/plugins/import/xfig/importxfig.cpp
===================================================================
--- scribus/plugins/import/xfig/importxfig.cpp	(revision 27090)
+++ scribus/plugins/import/xfig/importxfig.cpp	(working copy)
@@ -63,7 +63,7 @@
 	docHeight = h - y;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -303,7 +303,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(b - x, h - y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(b - x, h - y, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/xps/importxps.cpp
===================================================================
--- scribus/plugins/import/xps/importxps.cpp	(revision 27090)
+++ scribus/plugins/import/xps/importxps.cpp	(working copy)
@@ -112,7 +112,7 @@
 		docWidth = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
 		docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 		m_Doc = new ScribusDoc();
-		m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
@@ -231,7 +231,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/import/zmf/importzmf.cpp
===================================================================
--- scribus/plugins/import/zmf/importzmf.cpp	(revision 27090)
+++ scribus/plugins/import/zmf/importzmf.cpp	(working copy)
@@ -53,7 +53,7 @@
 	docHeight = h;
 	progressDialog = nullptr;
 	m_Doc = new ScribusDoc();
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
@@ -163,7 +163,7 @@
 	{
 		if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
 		{
-			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+			m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
 			baseX = 0;
Index: scribus/plugins/scriptplugin/cmddoc.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmddoc.cpp	(revision 27090)
+++ scribus/plugins/scriptplugin/cmddoc.cpp	(working copy)
@@ -71,7 +71,7 @@
 								// columnDistance, numberCols, autoframes,
 								0, 1, false,
 								pagesType, unit, firstPageOrder,
-								orientation, firstPageNr, "Custom", true, numPages);
+								orientation, firstPageNr, QSizeF(), true, numPages);
 	ScCore->primaryMainWindow()->doc->setPageSetFirstPage(pagesType, firstPageOrder);
 
 	return PyLong_FromLong(static_cast<long>(ret));
@@ -107,7 +107,7 @@
 	lr  = value2pts(lr, unit);
 	rr  = value2pts(rr, unit);
 	btr = value2pts(btr, unit);
-	bool ret = ScCore->primaryMainWindow()->doFileNew(b, h, tpr, lr, rr, btr, 0, 1, false, ds, unit, fsl, ori, fNr, "Custom", true);
+	bool ret = ScCore->primaryMainWindow()->doFileNew(b, h, tpr, lr, rr, btr, 0, 1, false, ds, unit, fsl, ori, fNr, QSizeF(), true);
 	//	qApp->processEvents();
 	return PyLong_FromLong(static_cast<long>(ret));
 }
Index: scribus/plugins/shapes/shapepalette.cpp
===================================================================
--- scribus/plugins/shapes/shapepalette.cpp	(revision 27090)
+++ scribus/plugins/shapes/shapepalette.cpp	(working copy)
@@ -217,7 +217,7 @@
 		int w = shapes[key].width;
 		int h = shapes[key].height;
 		ScribusDoc *m_Doc = new ScribusDoc();
-		m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		m_Doc->setPage(w, h, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->setGUI(false, scMW, nullptr);
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 27090)
+++ scribus/prefsmanager.cpp	(working copy)
@@ -1377,8 +1377,8 @@
 	deDocumentSetup.setAttribute("UnitIndex", appPrefs.docSetupPrefs.docUnitIndex);
 	deDocumentSetup.setAttribute("PageSize", appPrefs.docSetupPrefs.pageSize);
 	deDocumentSetup.setAttribute("PageOrientation", appPrefs.docSetupPrefs.pageOrientation);
-	deDocumentSetup.setAttribute("PageWidth", ScCLocale::toQStringC(appPrefs.docSetupPrefs.pageWidth));
-	deDocumentSetup.setAttribute("PageHeight", ScCLocale::toQStringC(appPrefs.docSetupPrefs.pageHeight));
+	deDocumentSetup.setAttribute("PageWidth", appPrefs.docSetupPrefs.pageWidth);
+	deDocumentSetup.setAttribute("PageHeight", appPrefs.docSetupPrefs.pageHeight);
 	deDocumentSetup.setAttribute("MarginTop", ScCLocale::toQStringC(appPrefs.docSetupPrefs.margins.top()));
 	deDocumentSetup.setAttribute("MarginBottom", ScCLocale::toQStringC(appPrefs.docSetupPrefs.margins.bottom()));
 	deDocumentSetup.setAttribute("MarginLeft", ScCLocale::toQStringC(appPrefs.docSetupPrefs.margins.left()));
@@ -2072,8 +2072,8 @@
 			PageSize ps( dc.attribute("PageSize", PageSize::defaultSizesList().at(1)) );
 			appPrefs.docSetupPrefs.pageSize = (ps.name() == CommonStrings::customPageSize ) ? PageSize::defaultSizesList().at(1) : ps.name();
 			appPrefs.docSetupPrefs.pageOrientation = dc.attribute("PageOrientation", "0").toInt();
-			appPrefs.docSetupPrefs.pageWidth   = ScCLocale::toDoubleC(dc.attribute("PageWidth"), 595.0);
-			appPrefs.docSetupPrefs.pageHeight  = ScCLocale::toDoubleC(dc.attribute("PageHeight"), 842.0);
+			appPrefs.docSetupPrefs.pageWidth   = ScCLocale::toDoubleC(dc.attribute("PageWidth"), mm2pts(210));
+			appPrefs.docSetupPrefs.pageHeight  = ScCLocale::toDoubleC(dc.attribute("PageHeight"), mm2pts(297));
 			appPrefs.docSetupPrefs.margins.setTop(ScCLocale::toDoubleC(dc.attribute("MarginTop"), 9.0));
 			appPrefs.docSetupPrefs.margins.setBottom(ScCLocale::toDoubleC(dc.attribute("MarginBottom"), 40.0));
 			appPrefs.docSetupPrefs.margins.setLeft(ScCLocale::toDoubleC(dc.attribute("MarginLeft"), 9.0));
Index: scribus/sampleitem.cpp
===================================================================
--- scribus/sampleitem.cpp	(revision 27090)
+++ scribus/sampleitem.cpp	(working copy)
@@ -28,7 +28,7 @@
 	if (!m_Doc)
 		return;
 
-	m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_Doc->setPage(1, 1, 0, 0, 0, 0, 0, 0, false, false);
 	m_Doc->addPage(0);
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
Index: scribus/scpreview.cpp
===================================================================
--- scribus/scpreview.cpp	(revision 27090)
+++ scribus/scpreview.cpp	(working copy)
@@ -43,7 +43,7 @@
 		}
 
 		ScribusDoc *m_Doc = new ScribusDoc();
-		m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		m_Doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		m_Doc->setPage(gw, gh, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 27090)
+++ scribus/scribus.cpp	(working copy)
@@ -337,7 +337,7 @@
 	internalCopy = false;
 	internalCopyBuffer.clear();
 	m_doc = new ScribusDoc();
-	m_doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+	m_doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 	m_doc->setPage(100, 100, 0, 0, 0, 0, 0, 0, false, false);
 	m_doc->addPage(0);
 	m_doc->setGUI(false, this, nullptr);
@@ -2038,7 +2038,7 @@
 			bool autoframes = dia->autoTextFrame->isChecked();
 			int orientation = dia->orientation();
 			int pageCount = dia->pageCountSpinBox->value();
-			QString pagesize = dia->pageSizeName();
+			QSizeF pagesize(dia->pageWidth(), dia->pageHeight());
 			doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->marginPreset());
 			doc->setPageSetFirstPage(facingPages, firstPage);
 			doc->bleeds()->set(dia->bleedTop(), dia->bleedLeft(), dia->bleedBottom(), dia->bleedRight());
@@ -2114,7 +2114,7 @@
 	bool autoframes = dia->autoTextFrame->isChecked();
 	int orientation = dia->orientation();
 	int pageCount = dia->pageCountSpinBox->value();
-	QString pagesize = dia->pageSizeName();
+	QSizeF pagesize(dia->pageWidth(), dia->pageHeight());
 
 	if (doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->marginPreset()))
 	{
@@ -2136,12 +2136,12 @@
 }
 
 //TODO move to core, assign doc to doc list, optionally create gui for it
-ScribusDoc *ScribusMainWindow::newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
+ScribusDoc *ScribusMainWindow::newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, QSizeF defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
 {
 	return doFileNew(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, columnCount, autoTextFrames, pageArrangement, unitIndex, firstPageLocation, orientation, firstPageNumber, defaultPageSize, requiresGUI, pageCount, showView, marginPreset);
 }
 
-ScribusDoc *ScribusMainWindow::doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
+ScribusDoc *ScribusMainWindow::doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, QSizeF defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
 {
 	if (HaveDoc)
 		outlinePalette->buildReopenVals();
@@ -8673,7 +8673,7 @@
 					ScriXmlDoc ss;
 					if (ss.readElemHeader(data, false, &gx, &gy, &gw, &gh))
 					{
-						doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+						doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 						HaveNewDoc();
 						doc->reformPages(true);
 						slotElemRead(data, doc->currentPage()->xOffset(), doc->currentPage()->yOffset(), false, false, doc, view);
@@ -8711,7 +8711,7 @@
 				ScriXmlDoc ss;
 				if (ss.readElemHeader(text, false, &gx, &gy, &gw, &gh))
 				{
-					doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, "Custom", true);
+					doFileNew(gw, gh, 0, 0, 0, 0, 0, 0, false, false, 0, false, 0, 1, QSizeF(), true);
 					HaveNewDoc();
 					doc->reformPages(true);
 					slotElemRead(text, doc->currentPage()->xOffset(), doc->currentPage()->yOffset(), false, false, doc, view);
@@ -9225,7 +9225,7 @@
 			if (fmt)
 			{
 				ScribusDoc *s_doc = new ScribusDoc();
-				s_doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+				s_doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 				s_doc->setPage(100, 100, 0, 0, 0, 0, 0, 0, false, false);
 				s_doc->addPage(0);
 				s_doc->setGUI(false, this, nullptr);
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(revision 27090)
+++ scribus/scribus.h	(working copy)
@@ -154,8 +154,8 @@
 	inline bool scriptIsRunning(void) const { return (m_ScriptRunning > 0); }
 	inline void setScriptRunning(bool value) { m_ScriptRunning += (value ? 1 : -1); }
 
-	ScribusDoc* doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount = 1, bool showView = true, int marginPreset = 0);
-	ScribusDoc* newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount = 1, bool showView = true, int marginPreset = 0);
+	ScribusDoc* doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, QSizeF defaultPageSize, bool requiresGUI, int pageCount = 1, bool showView = true, int marginPreset = 0);
+	ScribusDoc* newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, QSizeF defaultPageSize, bool requiresGUI, int pageCount = 1, bool showView = true, int marginPreset = 0);
 	bool DoFileSave(const QString& fileName, QString* savedFileName = nullptr, uint formatID = FORMATID_CURRENTEXPORT);
 
 	void changeEvent(QEvent *e) override;
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 27090)
+++ scribus/scribusdoc.cpp	(working copy)
@@ -680,12 +680,13 @@
 	return retList;
 }
 
-void ScribusDoc::setup(int unitIndex, int fp, int firstLeft, int orientation, int firstPageNumber, const QString& defaultPageSize, const QString& documentName)
+void ScribusDoc::setup(int unitIndex, int fp, int firstLeft, int orientation, int firstPageNumber, QSizeF pageSize, const QString& documentName)
 {
 	m_docPrefsData.docSetupPrefs.docUnitIndex = unitIndex;
 	setPageSetFirstPage(fp, firstLeft);
 	m_docPrefsData.docSetupPrefs.pageOrientation = orientation;
-	m_docPrefsData.docSetupPrefs.pageSize = defaultPageSize;
+	PageSize ps(pageSize.width(), pageSize.height());
+	m_docPrefsData.docSetupPrefs.pageSize = ps.name();
 	FirstPnum = firstPageNumber;
 	m_docPrefsData.docSetupPrefs.pagePositioning = fp;
 	setDocumentFileName(documentName);
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 27090)
+++ scribus/scribusdoc.h	(working copy)
@@ -107,7 +107,7 @@
 	bool inASpecialEditMode() const;
 	QList<PageItem*> getAllItems(const QList<PageItem*> &items) const;
 	QList<PageItem*> *parentGroup(PageItem* item, QList<PageItem*> *list);
-	void setup(int, int, int, int, int, const QString&, const QString&);
+	void setup(int, int, int, int, int, QSizeF pageSize, const QString&);
 	void setLoading(bool);
 	bool isLoading() const;
 	void setModified(bool);
@@ -222,10 +222,10 @@
 
 	double pageHeight() const { return m_docPrefsData.docSetupPrefs.pageHeight; }
 	double pageWidth() const { return m_docPrefsData.docSetupPrefs.pageWidth; }
-	const QString& pageSize() const { return m_docPrefsData.docSetupPrefs.pageSize; }
+	const QString& pageSize() const { return m_docPrefsData.docSetupPrefs.pageSize; } // legacy support for < 1.7.1
 	void setPageHeight(double h) { m_docPrefsData.docSetupPrefs.pageHeight = h; }
 	void setPageWidth(double w) { m_docPrefsData.docSetupPrefs.pageWidth = w; }
-	void setPageSize(const QString& s) { m_docPrefsData.docSetupPrefs.pageSize = s; }
+	void setPageSize(const QString& s) { m_docPrefsData.docSetupPrefs.pageSize = s; } // legacy support for < 1.7.1
 
 	int marginPreset() const { return m_docPrefsData.docSetupPrefs.marginPreset; }
 	void setMarginPreset(int mp) { m_docPrefsData.docSetupPrefs.marginPreset = mp; }
Index: scribus/ui/colorsandfills.cpp
===================================================================
--- scribus/ui/colorsandfills.cpp	(revision 27090)
+++ scribus/ui/colorsandfills.cpp	(working copy)
@@ -1951,7 +1951,7 @@
 	if (fmt)
 	{
 		std::unique_ptr<ScribusDoc> s_doc(new ScribusDoc());
-		s_doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+		s_doc->setup(0, 1, 1, 1, 1, QSizeF(), "Custom");
 		s_doc->setPage(100, 100, 0, 0, 0, 0, 0, 0, false, false);
 		s_doc->addPage(0);
 		s_doc->setGUI(false, mainWin, nullptr);
Index: scribus/ui/inspage.cpp
===================================================================
--- scribus/ui/inspage.cpp	(revision 27090)
+++ scribus/ui/inspage.cpp	(working copy)
@@ -248,7 +248,7 @@
 	textLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7);
 	dsGroupBox7Layout->addWidget(textLabel1, 0, 0, Qt::AlignTop | Qt::AlignRight);
 	pageSizeSelector = new PageSizeSelector(dsGroupBox7);
-	pageSizeSelector->setPageSize(m_doc->pageSize());
+	pageSizeSelector->setPageSize(m_doc->pageWidth(), m_doc->pageHeight());
 	textLabel1->setBuddy(pageSizeSelector);
 	dsGroupBox7Layout->addWidget(pageSizeSelector, 0, 1);
 	textLabel2 = new QLabel( tr( "Orie&ntation:" ), dsGroupBox7);
Index: scribus/ui/newdocdialog.cpp
===================================================================
--- scribus/ui/newdocdialog.cpp	(revision 27090)
+++ scribus/ui/newdocdialog.cpp	(working copy)
@@ -133,7 +133,6 @@
 {
 	int orientation = prefsManager.appPrefs.docSetupPrefs.pageOrientation;
 	int pagePositioning = prefsManager.appPrefs.docSetupPrefs.pagePositioning;
-	QString pageSize = prefsManager.appPrefs.docSetupPrefs.pageSize;
 	double pageHeight = prefsManager.appPrefs.docSetupPrefs.pageHeight;
 	double pageWidth = prefsManager.appPrefs.docSetupPrefs.pageWidth;
 
@@ -165,11 +164,11 @@
 		pageLayoutButtons->button(2)->setChecked(true);
 	}
 
-	listPageFormats->setValues(pageSize, orientation, PageSizeInfo::Preferred, PageSizeList::NameAsc);
+	listPageFormats->setValues(QSizeF(pageWidth, pageHeight), orientation, PageSizeInfo::Preferred, PageSizeList::NameAsc);
 
 	pageSizeSelector->setHasFormatSelector(false);
 	pageSizeSelector->setHasCustom(false);
-	pageSizeSelector->setPageSize(pageSize);
+	pageSizeSelector->setPageSize(pageWidth, pageHeight);
 	pageSizeSelector->setCurrentCategory(PageSizeInfo::Preferred);
 
 	widthSpinBox->setMinimum(pts2value(1.0, m_unitIndex));
@@ -194,7 +193,6 @@
 	marginGroup->setPageHeight(pageHeight);
 	marginGroup->setPageWidth(pageWidth);
 	marginGroup->setFacingPages(!(pagePositioning == singlePage));
-	marginGroup->setPageSize(pageSize);
 	marginGroup->setMarginPreset(prefsManager.appPrefs.docSetupPrefs.marginPreset);
 
 	MarginStruct bleed;
@@ -204,7 +202,6 @@
 	bleedGroup->setPageHeight(pageHeight);
 	bleedGroup->setPageWidth(pageWidth);
 	bleedGroup->setFacingPages(!(pagePositioning == singlePage));
-	bleedGroup->setPageSize(pageSize);
 	bleedGroup->setMarginPreset(prefsManager.appPrefs.docSetupPrefs.marginPreset);
 
 	pageCountSpinBox->setMaximum( 10000 );
@@ -214,7 +211,7 @@
 	pageCountLabel->setPixmap(iconManager.loadPixmap("panel-page"));
 
 	setDocLayout(pagePositioning);
-	setSize(pageSize);
+	setSize(QSizeF(pageWidth, pageHeight));
 	setOrientation(orientation);
 
 	numberOfCols->setButtonSymbols( QSpinBox::UpDownArrows );
@@ -341,8 +338,8 @@
 	marginGroup->setPageWidth(m_pageWidth);
 	bleedGroup->setPageWidth(m_pageWidth);
 	listPageFormats->clearSelection();
-	m_pageSize = CommonStrings::customPageSize;
-	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, m_layoutFirstPage);
+	listPageFormats->setDimensions(m_pageWidth, m_pageHeight);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_choosenLayout, m_layoutFirstPage);
 
 	int newOrientation = (widthSpinBox->value() > heightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != m_orientation)
@@ -363,8 +360,8 @@
 	marginGroup->setPageHeight(m_pageHeight);
 	bleedGroup->setPageHeight(m_pageHeight);	
 	listPageFormats->clearSelection();
-	m_pageSize = CommonStrings::customPageSize;
-	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, m_layoutFirstPage);
+	listPageFormats->setDimensions(m_pageWidth, m_pageHeight);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_choosenLayout, m_layoutFirstPage);
 
 	int newOrientation = (widthSpinBox->value() > heightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != m_orientation)
@@ -381,10 +378,11 @@
 void NewDocDialog::changePageSize(const QModelIndex &ic)
 {
 	int unit = ic.data(PageSizeList::Unit).toInt();
-	QString sizeName = ic.data(PageSizeList::Name).toString();
+	double width = ic.data(PageSizeList::Width).toDouble();
+	double height = ic.data(PageSizeList::Height).toDouble();
 
 	setUnit(unit);
-	setPageSize(sizeName);
+	setPageSize(QSizeF(width, height));
 
 	QSignalBlocker sig(unitOfMeasureComboBox);
 	unitOfMeasureComboBox->setCurrentIndex(unit);
@@ -504,7 +502,9 @@
 		heightSpinBox->setValue((ori == portraitPage) ? qMax(w, h) : qMin(w, h));
 		m_pageWidth  = (ori == portraitPage) ? qMin(pw, ph) : qMax(pw, ph);
 		m_pageHeight = (ori == portraitPage) ? qMax(pw, ph) : qMin(pw, ph);
-		listPageFormats->setOrientation(ori);
+		// listPageFormats->setDimensions(pw, ph);
+		// listPageFormats->setOrientation(ori);
+		listPageFormats->setValues(QSizeF(pw, ph), ori, listPageFormats->category(), listPageFormats->sortMode());
 	}
 	// #869 pv - defined constants added + code repeat (check w/h)
 	(ori == portraitPage) ? m_orientation = portraitPage : m_orientation = landscapePage;
@@ -513,7 +513,7 @@
 	marginGroup->setPageWidth(m_pageWidth);
 	bleedGroup->setPageHeight(m_pageHeight);
 	bleedGroup->setPageWidth(m_pageWidth);
-	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, m_layoutFirstPage);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_choosenLayout, m_layoutFirstPage);
 
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
@@ -539,27 +539,22 @@
 	}
 }
 
-void NewDocDialog::setPageSize(const QString &size)
+void NewDocDialog::setPageSize(QSizeF size)
 {
 	setSize(size);
-
-	if (size != CommonStrings::customPageSize)
-		setOrientation(pageOrientationButtons->checkedId());
-
-	marginGroup->setPageSize(size);
-	bleedGroup->setPageSize(size);
-
+	setOrientation(pageOrientationButtons->checkedId());
 }
 
-void NewDocDialog::setSize(const QString& gr)
+void NewDocDialog::setSize(QSizeF size)
 {
 	m_pageWidth = widthSpinBox->value() / m_unitRatio;
 	m_pageHeight = heightSpinBox->value() / m_unitRatio;
-	m_pageSize = gr;
 
+	PageSize ps(size.width(), size.height());
+
 	disconnect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	disconnect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
-	if (m_pageSize == CommonStrings::trCustomPageSize || m_pageSize == CommonStrings::customPageSize)
+	if (ps.name() == CommonStrings::customPageSize)
 	{
 		widthSpinBox->setEnabled(true);
 		heightSpinBox->setEnabled(true);
@@ -566,16 +561,15 @@
 	}
 	else
 	{
-		PageSize ps2(m_pageSize);
 		if (pageOrientationButtons->checkedId() == portraitPage)
 		{
-			m_pageWidth = ps2.width();
-			m_pageHeight = ps2.height();
+			m_pageWidth = ps.width();
+			m_pageHeight = ps.height();
 		}
 		else
 		{
-			m_pageWidth = ps2.height();
-			m_pageHeight = ps2.width();
+			m_pageWidth = ps.height();
+			m_pageHeight = ps.width();
 		}
 	}
 	widthSpinBox->setValue(m_pageWidth * m_unitRatio);
@@ -584,7 +578,7 @@
 	marginGroup->setPageWidth(m_pageWidth);
 	bleedGroup->setPageHeight(m_pageHeight);
 	bleedGroup->setPageWidth(m_pageWidth);
-	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, m_layoutFirstPage);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_choosenLayout, m_layoutFirstPage);
 
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
@@ -597,7 +591,7 @@
 	bleedGroup->setFacingPages(layout != singlePage);
 	m_choosenLayout = layout;
 	m_layoutFirstPage = prefsManager.appPrefs.pageSets[m_choosenLayout].FirstPage;
-	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, m_layoutFirstPage);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_choosenLayout, m_layoutFirstPage);
 }
 
 void NewDocDialog::setDocFirstPage(int firstPage)
@@ -694,6 +688,5 @@
 	if (listPageFormats->category() == category)
 		return;
 
-	listPageFormats->setFormat(m_pageSize);
-	listPageFormats->setCategory(category);
+	listPageFormats->setValues(QSizeF(m_pageWidth, m_pageHeight), listPageFormats->orientation(), category, listPageFormats->sortMode());
 }
Index: scribus/ui/newdocdialog.h
===================================================================
--- scribus/ui/newdocdialog.h	(revision 27090)
+++ scribus/ui/newdocdialog.h	(working copy)
@@ -61,8 +61,7 @@
 	void createNewDocPage();
 	void createOpenDocPage();
 	void createRecentDocPage();
-	void setSize(const QString& gr);
-	QString pageSizeName() const { return m_pageSize; };
+	void setSize(QSizeF size);
 
 	QFileDialog *fileDialog {nullptr};
 
@@ -94,7 +93,7 @@
 	void ExitOK();
 	void setOrientation(int ori);
 	void setLayout(int layoutId);
-	void setPageSize(const QString &);
+	void setPageSize(QSizeF size);
 	void setDocLayout(int layout);
 	void setDocFirstPage(int firstPage);
 	/*! Opens document on doubleclick
@@ -132,7 +131,6 @@
 	double m_distance { 11.0 };
 	QString m_unitSuffix;
 	QString m_selectedFile;
-	QString m_pageSize;
 	int m_unitIndex { 0 };
 	int m_tabSelected { 0 };
 	bool m_onStartup { false };
Index: scribus/ui/newmarginwidget.cpp
===================================================================
--- scribus/ui/newmarginwidget.cpp	(revision 27090)
+++ scribus/ui/newmarginwidget.cpp	(working copy)
@@ -7,11 +7,12 @@
 
 #include "newmarginwidget.h"
 #include "iconmanager.h"
+#include "pagesize.h"
+#include "scribusapp.h"
 #include "scrspinbox.h"
-#include "units.h"
 #include "ui/marginpresetlayout.h"
 #include "ui/useprintermarginsdialog.h"
-#include "scribusapp.h"
+#include "units.h"
 
 NewMarginWidget::NewMarginWidget(QWidget* parent)
 	: QWidget(parent)
@@ -300,12 +301,6 @@
 	emit marginChanged(m_marginData);
 }
 
-void NewMarginWidget::setPageSize(const QString& pageSize)
-{
-	m_pageSize = pageSize;
-}
-
-
 void NewMarginWidget::updateMarginSpinValues()
 {
 	bool leftBlocked = leftMarginSpinBox->blockSignals(true);
@@ -401,7 +396,9 @@
 void NewMarginWidget::setMarginsToPrinterMargins()
 {
 	QSizeF pageDimensions(m_pageWidth, m_pageHeight);
-	UsePrinterMarginsDialog upm(parentWidget(), pageDimensions, m_pageSize, unitGetRatioFromIndex(m_unitIndex), unitGetSuffixFromIndex(m_unitIndex));
+	PageSize ps(m_pageWidth, m_pageHeight);
+
+	UsePrinterMarginsDialog upm(parentWidget(), pageDimensions, ps.nameTR(), unitGetRatioFromIndex(m_unitIndex), unitGetSuffixFromIndex(m_unitIndex));
 	if (upm.exec() != QDialog::Accepted)
 		return;
 
Index: scribus/ui/newmarginwidget.h
===================================================================
--- scribus/ui/newmarginwidget.h	(revision 27090)
+++ scribus/ui/newmarginwidget.h	(working copy)
@@ -36,8 +36,6 @@
 		void setPageWidth(double);
 		/*! \brief Setup the spinboxes properties (min/max value etc.) by height */
 		void setPageHeight(double);
-		/*! \brief Set the page size for margin getting from cups */
-		void setPageSize(const QString&);
 		void setNewUnit(int unitIndex);
 		void setNewValues(const MarginStruct& margs);
 		/*! \brief Setup the presetCombo without changing the margin values, only used by tabdocument */
@@ -64,7 +62,6 @@
 
 		MarginStruct m_marginData;
 		MarginStruct m_savedMarginData;
-		QString m_pageSize;
 		bool   m_facingPages {false};
 		double m_pageHeight {0.0};
 		double m_pageWidth {0.0};
Index: scribus/ui/pagepropertiesdialog.cpp
===================================================================
--- scribus/ui/pagepropertiesdialog.cpp	(revision 27090)
+++ scribus/ui/pagepropertiesdialog.cpp	(working copy)
@@ -59,7 +59,7 @@
 	TextLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7 );
 	dsGroupBox7Layout->addWidget( TextLabel1, 0, 0, Qt::AlignTop | Qt::AlignRight);
 	pageSizeSelector = new PageSizeSelector(dsGroupBox7);
-	pageSizeSelector->setPageSize(doc->currentPage()->size());
+	pageSizeSelector->setPageSize(doc->currentPage()->width(), doc->currentPage()->height());
 	TextLabel1->setBuddy(pageSizeSelector);
 	dsGroupBox7Layout->addWidget(pageSizeSelector, 0, 1);
 	TextLabel2 = new QLabel( tr( "Orie&ntation:" ), dsGroupBox7 );
@@ -249,7 +249,6 @@
 	heightSpinBox->setValue(m_pageHeight * m_unitRatio);
 	marginWidget->setPageHeight(m_pageHeight);
 	marginWidget->setPageWidth(m_pageWidth);
-	marginWidget->setPageSize(gr);
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
 }
Index: scribus/ui/prefs_documentsetup.cpp
===================================================================
--- scribus/ui/prefs_documentsetup.cpp	(revision 27090)
+++ scribus/ui/prefs_documentsetup.cpp	(working copy)
@@ -184,12 +184,10 @@
 	marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::MarginWidgetFlags);
 	marginsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
 	marginsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
-//	marginsWidget->setPageSize(prefsPageSizeName);
 	marginsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
 	bleedsWidget->setup(prefsData->docSetupPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::BleedWidgetFlags);
 	bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
 	bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
-//	bleedsWidget->setPageSize(prefsPageSizeName);
 	bleedsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
 	saveCompressedCheckBox->setChecked(prefsData->docSetupPrefs.saveCompressed);
 	emergencyCheckBox->setChecked(prefsData->miscPrefs.saveEmergencyFile);
@@ -271,21 +269,12 @@
 
 void Prefs_DocumentSetup::setupPageSizes(struct ApplicationPrefs *prefsData)
 {
-	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
+	double width = prefsData->docSetupPrefs.pageWidth;
+	double height = prefsData->docSetupPrefs.pageHeight;
 
-	PageSize ps(prefsPageSizeName);
+	pageSizeSelector->setPageSize(width, height);
+	prefsPageSizeName = pageSizeSelector->pageSize();
 
-	// try to find coresponding page size by dimensions
-	if (ps.name() == CommonStrings::customPageSize)
-	{
-		PageSizeInfoMap pages = ps.sizesByDimensions(QSize(prefsData->docSetupPrefs.pageWidth, prefsData->docSetupPrefs.pageHeight));
-		if (pages.count() > 0)
-			prefsPageSizeName = pages.firstKey();
-	}
-
-	pageSizeSelector->setPageSize(prefsPageSizeName);
-	marginsWidget->setPageSize(prefsPageSizeName);
-	bleedsWidget->setPageSize(prefsPageSizeName);
 }
 
 void Prefs_DocumentSetup::pageLayoutChanged(int i)
@@ -299,9 +288,9 @@
 {
 	pageW = pageWidthSpinBox->value() / unitRatio;
 	marginsWidget->setPageWidth(pageW);
-	QString psText = pageSizeSelector->pageSizeTR();
-	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeSelector->setPageSize(CommonStrings::customPageSize);
+
+	pageSizeSelector->setPageSize(pageW, pageH);
+
 	int newOrientation = (pageWidthSpinBox->value() > pageHeightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != pageOrientationComboBox->currentIndex())
 	{
@@ -315,9 +304,9 @@
 {
 	pageH = pageHeightSpinBox->value() / unitRatio;
 	marginsWidget->setPageHeight(pageH);
-	QString psText = pageSizeSelector->pageSizeTR();
-	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeSelector->setPageSize(CommonStrings::customPageSize);
+
+	pageSizeSelector->setPageSize(pageW, pageH);
+
 	int newOrientation = (pageWidthSpinBox->value() > pageHeightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != pageOrientationComboBox->currentIndex())
 	{
@@ -370,7 +359,6 @@
 	pageHeightSpinBox->setValue(pageH * unitRatio);
 	marginsWidget->setPageHeight(pageH);
 	marginsWidget->setPageWidth(pageW);
-	marginsWidget->setPageSize(newSize);
 	pageWidthSpinBox->blockSignals(false);
 	pageHeightSpinBox->blockSignals(false);
 }
Index: scribus/ui/prefs_pdfexport.cpp
===================================================================
--- scribus/ui/prefs_pdfexport.cpp	(revision 27090)
+++ scribus/ui/prefs_pdfexport.cpp	(working copy)
@@ -413,7 +413,6 @@
 	bleedsWidget->setup(prefsData->pdfPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::BleedWidgetFlags);
 	bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
 	bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
-	bleedsWidget->setPageSize(prefsData->docSetupPrefs.pageSize);
 	bleedsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
 //
 	useCustomRenderingCheckBox->setChecked(prefsData->pdfPrefs.UseLPI);
Index: scribus/ui/widgets/pagesizelist.cpp
===================================================================
--- scribus/ui/widgets/pagesizelist.cpp	(revision 27090)
+++ scribus/ui/widgets/pagesizelist.cpp	(working copy)
@@ -39,16 +39,16 @@
 	setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
 }
 
-void PageSizeList::setFormat(QString format)
+void PageSizeList::setDimensions(double width, double height)
 {
-	loadPageSizes(format, m_orientation, m_category);
-	m_name = format;
+	loadPageSizes(QSizeF(width, height), m_orientation, m_category);
+	m_dimensions = QSizeF(width, height);
 	setSortMode(m_sortMode);
 }
 
 void PageSizeList::setOrientation(int orientation)
 {
-	loadPageSizes(m_name, orientation, m_category);
+	loadPageSizes(m_dimensions, orientation, m_category);
 	m_orientation = orientation;
 	setSortMode(m_sortMode);
 }
@@ -55,7 +55,7 @@
 
 void PageSizeList::setCategory(PageSizeInfo::Category category)
 {
-	loadPageSizes(m_name, m_orientation, category);
+	loadPageSizes(m_dimensions, m_orientation, category);
 	m_category = category;
 	setSortMode(m_sortMode);
 }
@@ -87,21 +87,21 @@
 	}
 }
 
-void PageSizeList::setValues(QString format, int orientation, PageSizeInfo::Category category, SortMode sortMode)
+void PageSizeList::setValues(QSizeF dimensions, int orientation, PageSizeInfo::Category category, SortMode sortMode)
 {
-	loadPageSizes(format, orientation, category);
-	m_name = format;
+	loadPageSizes(dimensions, orientation, category);
+	m_dimensions = dimensions;
 	m_orientation = orientation;
 	m_category = category;
 	setSortMode(sortMode);
 }
 
-void PageSizeList::loadPageSizes(QString name, int orientation, PageSizeInfo::Category category)
+void PageSizeList::loadPageSizes(QSizeF dimensions, int orientation, PageSizeInfo::Category category)
 {
 	QSignalBlocker sig(this);
 
-	PageSize ps(name);
-	PageSize pref(PrefsManager::instance().appPrefs.docSetupPrefs.pageSize);
+	PageSize pref(PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth, PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight);
+	PageSize ps(dimensions.width(), dimensions.height());
 
 	int sel = -1;
 
@@ -109,8 +109,9 @@
 	m_model->setSortRole(ItemData::Name);
 	m_model->sort(0, Qt::AscendingOrder);
 
-	if (m_category == category && this->selectionModel()->currentIndex().isValid())
-		sel = this->selectionModel()->currentIndex().row();
+	// enable if list selection should be remembered
+	// if (m_category == category && this->selectionModel()->currentIndex().isValid())
+	// 	sel = this->selectionModel()->currentIndex().row();
 
 	m_model->clear();
 
@@ -134,10 +135,14 @@
 			itemA->setData(QVariant(item.category), ItemData::Category);
 			itemA->setData(QVariant(item.sizeName), ItemData::Name);
 			itemA->setData(QVariant(item.width * item.height), ItemData::Dimension);
+			itemA->setData(QVariant(item.width), ItemData::Width);
+			itemA->setData(QVariant(item.height), ItemData::Height);
 			m_model->appendRow(itemA);
 
-			if (sel == -1 && item.sizeName == ps.name())
+			// select item with name match OR equal size
+			if (sel == -1 && (item.sizeName == ps.name() || (item.width == ps.width() && item.height == ps.height())))
 				sel = itemA->row();
+
 		}
 	}
 
Index: scribus/ui/widgets/pagesizelist.h
===================================================================
--- scribus/ui/widgets/pagesizelist.h	(revision 27090)
+++ scribus/ui/widgets/pagesizelist.h	(working copy)
@@ -33,13 +33,14 @@
 		Category = Qt::UserRole + 2,
 		Name = Qt::UserRole + 3,
 		Dimension = Qt::UserRole + 4,
+		Width = Qt::UserRole + 5,
+		Height = Qt::UserRole + 6
 	};
 
 	PageSizeList(QWidget* parent);
 	~PageSizeList() = default;
 
-	void setFormat(QString format);
-	const QString& format() const { return m_name; };
+	void setDimensions(double width, double height);
 
 	void setOrientation(int orientation);
 	int orientation() const { return m_orientation; };
@@ -50,12 +51,12 @@
 	void setSortMode(SortMode sortMode);
 	SortMode sortMode() const { return m_sortMode; };
 
-	void setValues(QString format, int orientation, PageSizeInfo::Category category, SortMode sortMode);
+	void setValues(QSizeF dimensions, int orientation, PageSizeInfo::Category category, SortMode sortMode);
 
 	void updateGeometries() override;
 
 private:
-	QString m_name {PageSize::defaultSizesList().at(1)};
+	QSizeF m_dimensions;
 	int m_orientation {0};
 	PageSizeInfo::Category m_category {PageSizeInfo::Preferred};
 	SortMode m_sortMode {SortMode::NameAsc};
@@ -62,7 +63,7 @@
 	QStandardItemModel* m_model { nullptr };
 
 	QIcon sizePreview(QSize iconSize, QSize pageSize) const;
-	void loadPageSizes(QString name, int orientation, PageSizeInfo::Category category);
+	void loadPageSizes(QSizeF dimensions, int orientation, PageSizeInfo::Category category);
 };
 
 
Index: scribus/ui/widgets/pagesizepreview.h
===================================================================
--- scribus/ui/widgets/pagesizepreview.h	(revision 27090)
+++ scribus/ui/widgets/pagesizepreview.h	(working copy)
@@ -13,20 +13,26 @@
 public:
 	explicit PageSizePreview(QWidget *parent = nullptr);
 
-	void setPageHeight(double height) { m_height = height; update(); };
-	void setPageWidth(double width) { m_width = width; update(); };
-	void setMargins(const MarginStruct& margins) { m_margins = margins; update(); };
-	void setBleeds(const MarginStruct& bleeds) { m_bleeds = bleeds; update(); };
-	void setPageName(const QString& name) {
-		PageSize ps(name);
+	void setPageHeight(double height)
+	{
+		PageSize ps(m_width, height);
 		m_name = ps.nameTR();
+		m_height = height;
 		update();
 	};
+	void setPageWidth(double width)
+	{
+		PageSize ps(width, m_height);
+		m_width = width;
+		update();
+	};
+	void setMargins(const MarginStruct& margins) { m_margins = margins; update(); };
+	void setBleeds(const MarginStruct& bleeds) { m_bleeds = bleeds; update(); };
 	void setLayout(int layout) { m_layout = layout; update(); };
 	void setFirstPage(int firstPage) { m_firstPage = firstPage; update(); };
-	void setPage(double height, double width, const MarginStruct& margins, const MarginStruct& bleeds, QString name, int layout, int firstPage)
+	void setPage(double height, double width, const MarginStruct& margins, const MarginStruct& bleeds, int layout, int firstPage)
 	{
-		PageSize ps(name);
+		PageSize ps(width, height);
 
 		m_height = height;
 		m_width = width;
Index: scribus/ui/widgets/pagesizeselector.cpp
===================================================================
--- scribus/ui/widgets/pagesizeselector.cpp	(revision 27090)
+++ scribus/ui/widgets/pagesizeselector.cpp	(working copy)
@@ -49,7 +49,7 @@
 	m_hasCustom = hasCustom;
 
 	if (!m_sizeName.isEmpty())
-		setPageSize(m_sizeName);
+		setPageSize(m_size.width(), m_size.height());
 }
 
 void PageSizeSelector::setCurrentCategory(PageSizeInfo::Category category)
@@ -59,10 +59,8 @@
 		comboCategory->setCurrentIndex(index);
 }
 
-void PageSizeSelector::setPageSize(QString name)
+void PageSizeSelector::setup(PageSize ps)
 {
-	PageSize ps(name);
-
 	m_sizeName = ps.name();
 	m_sizeCategory = ps.category();
 	m_trSizeName = ps.nameTR();
@@ -89,7 +87,7 @@
 	{
 		comboCategory->addItem(it.value(), it.key());
 		if (it.key() == m_sizeCategory)
-			index = comboCategory->count() - 1;			
+			index = comboCategory->count() - 1;
 	}
 
 	comboCategory->setCurrentIndex(index);
@@ -102,6 +100,13 @@
 	setFormat(m_sizeCategory, m_sizeName);
 }
 
+void PageSizeSelector::setPageSize(double width, double height)
+{
+	m_size = QSizeF(width, height);
+	PageSize ps(width, height);
+	setup(ps);
+}
+
 void PageSizeSelector::setFormat(PageSizeInfo::Category category, QString name)
 {
 	if (!hasFormatSelector())
Index: scribus/ui/widgets/pagesizeselector.h
===================================================================
--- scribus/ui/widgets/pagesizeselector.h	(revision 27090)
+++ scribus/ui/widgets/pagesizeselector.h	(working copy)
@@ -29,7 +29,7 @@
 public:
 	explicit PageSizeSelector(QWidget *parent = nullptr);
 
-	void setPageSize(QString name);
+	void setPageSize(double width, double height);
 	void setHasFormatSelector(bool isVisble );
 	void setHasCustom(bool hasCustom);
 	bool hasCustom() const { return m_hasCustom; };
@@ -46,10 +46,12 @@
 
 	QString m_sizeName;
 	QString m_trSizeName;
+	QSizeF m_size;
 	PageSizeInfo::Category m_sizeCategory;
 	bool m_hasFormatSelector {true};
 	bool m_hasCustom {true};
 
+	void setup(PageSize ps);
 	void setFormat(PageSizeInfo::Category category, QString name);
 
 signals:
