r23548 by jghali - Add support for PDF 1.6 and embedded OpenType fonts

scribus-commit scribus-commit at lists.scribus.net
Tue Mar 31 11:40:00 UTC 2020


Author: jghali
Date: Tue Mar 31 11:39:59 2020
New Revision: 23548

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23548
Log:
Add support for PDF 1.6 and embedded OpenType fonts

Added:
    trunk/Scribus/scribus/pdfversion.cpp
    trunk/Scribus/scribus/pdfversion.h
Modified:
    trunk/Scribus/Scribus.pro
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/commonstrings.cpp
    trunk/Scribus/scribus/commonstrings.h
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/pdflib_core.h
    trunk/Scribus/scribus/pdfoptions.cpp
    trunk/Scribus/scribus/pdfoptions.h
    trunk/Scribus/scribus/pdfoptionsio.cpp
    trunk/Scribus/scribus/pdfwriter.cpp
    trunk/Scribus/scribus/pdfwriter.h
    trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/scfonts.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/checkDocument.cpp
    trunk/Scribus/scribus/ui/pdfexportdialog.cpp
    trunk/Scribus/scribus/ui/pdfversioncombo.cpp
    trunk/Scribus/scribus/ui/pdfversioncombo.h
    trunk/Scribus/scribus/ui/pdfversionmodel.cpp
    trunk/Scribus/scribus/ui/pdfversionmodel.h
    trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
    trunk/Scribus/scribus/ui/prefs_pdfexport.h
    trunk/Scribus/scribus/ui/tabpdfoptions.cpp
    trunk/Scribus/scribus/ui/tabpdfoptions.h
    trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj.filters
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters

Modified: trunk/Scribus/Scribus.pro
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/Scribus.pro
==============================================================================
--- trunk/Scribus/Scribus.pro	(original)
+++ trunk/Scribus/Scribus.pro	Tue Mar 31 11:39:59 2020
@@ -143,6 +143,7 @@
            scribus/pdfoptions.h \
            scribus/pdfoptionsio.h \
            scribus/pdfstructs.h \
+           scribus/pdfversion.h \
            scribus/pdfwriter.h \
            scribus/pluginapi.h \
            scribus/pluginmanager.h \
@@ -1305,6 +1306,7 @@
            scribus/pdflib_core.cpp \
            scribus/pdfoptions.cpp \
            scribus/pdfoptionsio.cpp \
+           scribus/pdfversion.cpp \
            scribus/pdfwriter.cpp \
            scribus/pluginmanager.cpp \
            scribus/pp_proxy.cpp \

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt	(original)
+++ trunk/Scribus/scribus/CMakeLists.txt	Tue Mar 31 11:39:59 2020
@@ -683,6 +683,7 @@
 	pdflib_core.cpp
 	pdfoptions.cpp
 	pdfoptionsio.cpp
+	pdfversion.cpp
 	pdfwriter.cpp
 	pluginmanager.cpp
 	pp_proxy.cpp

Modified: trunk/Scribus/scribus/commonstrings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/commonstrings.cpp
==============================================================================
--- trunk/Scribus/scribus/commonstrings.cpp	(original)
+++ trunk/Scribus/scribus/commonstrings.cpp	Tue Mar 31 11:39:59 2020
@@ -166,6 +166,7 @@
 QString CommonStrings::PDF_1_3      = "";
 QString CommonStrings::PDF_1_4      = "";
 QString CommonStrings::PDF_1_5      = "";
+QString CommonStrings::PDF_1_6      = "";
 QString CommonStrings::PDF_X1a		= "";
 QString CommonStrings::PDF_X3       = "";
 QString CommonStrings::PDF_X4		= "";
@@ -433,6 +434,7 @@
 	CommonStrings::PDF_1_3      = "PDF 1.3";
 	CommonStrings::PDF_1_4      = "PDF 1.4";
 	CommonStrings::PDF_1_5      = "PDF 1.5";
+	CommonStrings::PDF_1_6      = "PDF 1.6";
 	CommonStrings::PDF_X1a      = "PDF/X-1a";
 	CommonStrings::PDF_X3       = "PDF/X-3";
 	CommonStrings::PDF_X4       = "PDF/X-4";

Modified: trunk/Scribus/scribus/commonstrings.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/commonstrings.h
==============================================================================
--- trunk/Scribus/scribus/commonstrings.h	(original)
+++ trunk/Scribus/scribus/commonstrings.h	Tue Mar 31 11:39:59 2020
@@ -255,6 +255,7 @@
 	static QString PDF_1_3;
 	static QString PDF_1_4;
 	static QString PDF_1_5;
+	static QString PDF_1_6;
 	static QString PDF_X1a;
 	static QString PDF_X3;
 	static QString PDF_X4;

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Tue Mar 31 11:39:59 2020
@@ -578,22 +578,22 @@
 
 bool PDFLibCore::PDF_IsPDFX()
 {
-	if (Options.Version == PDFOptions::PDFVersion_X1a)
+	if (Options.Version == PDFVersion::PDF_X1a)
 		return true;
-	if (Options.Version == PDFOptions::PDFVersion_X3)
+	if (Options.Version == PDFVersion::PDF_X3)
 		return true;
-	if (Options.Version == PDFOptions::PDFVersion_X4)
+	if (Options.Version == PDFVersion::PDF_X4)
 		return true;
 	return false;
 }
 
-bool PDFLibCore::PDF_IsPDFX(PDFOptions::PDFVersion ver)
-{
-	if (ver == PDFOptions::PDFVersion_X1a)
+bool PDFLibCore::PDF_IsPDFX(const PDFVersion& ver)
+{
+	if (ver == PDFVersion::PDF_X1a)
 		return true;
-	if (ver == PDFOptions::PDFVersion_X3)
+	if (ver == PDFVersion::PDF_X3)
 		return true;
-	if (ver == PDFOptions::PDFVersion_X4)
+	if (ver == PDFVersion::PDF_X4)
 		return true;
 	return false;
 }
@@ -1012,29 +1012,6 @@
 	UsedFontsF.clear();
 	
 	writer.writeHeader(Options.Version);
-	
-//	if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
-//		ObjCounter = 10;
-//	else
-//		ObjCounter = 9;
-//	switch (Options.Version)
-//	{
-//		case PDFOptions::PDFVersion_X1a:
-//		case PDFOptions::PDFVersion_X3:
-//		case PDFOptions::PDFVersion_13:
-//			PutDoc("%PDF-1.3\n");
-//			break;
-//		case PDFOptions::PDFVersion_14:
-//			PutDoc("%PDF-1.4\n");
-//			break;
-//		case PDFOptions::PDFVersion_X4:
-//		case PDFOptions::PDFVersion_15:
-//			PutDoc("%PDF-1.5\n");
-//			break;
-//	}
-//	if (PDF_IsPDFX())
-//		ObjCounter++;
-//	PutDoc("%\xc7\xec\x8f\xa2\n");
 
 	PDF_Begin_Catalog();
 	PDF_Begin_MetadataAndEncrypt();
@@ -1078,7 +1055,7 @@
 		writer.ThreadsObj = writer.newObject();
 		PutDoc("/Threads " + Pdf::toObjRef(writer.ThreadsObj) + "\n");
 	}
-	if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+	if (Options.exportsLayers())
 	{
 		writer.OCPropertiesObj = writer.newObject();
 		PutDoc("/OCProperties " + Pdf::toObjRef(writer.OCPropertiesObj) + "\n");
@@ -1088,7 +1065,7 @@
 		writer.OutputIntentObj = writer.newObject();
 		PutDoc("/OutputIntents [ " +  Pdf::toObjRef(writer.OutputIntentObj) + " ]\n");
 	}
-	if ((Options.Version == PDFOptions::PDFVersion_X4))
+	if ((Options.Version == PDFVersion::PDF_X4))
 	{
 		writer.MetaDataObj = writer.newObject();
 		PutDoc("/Metadata "+ Pdf::toObjRef(writer.MetaDataObj) + "\n");
@@ -1115,7 +1092,7 @@
 		PutDoc("/PageMode /FullScreen\n");
 	else if (Options.displayThumbs)
 		PutDoc("/PageMode /UseThumbs\n");
-	else if ((Options.Version == PDFOptions::PDFVersion_15) && (Options.displayLayers))
+	else if ((Options.Version == PDFVersion::PDF_15 || Options.Version == PDFVersion::PDF_16) && (Options.displayLayers))
 			PutDoc("/PageMode /UseOC\n");
 	if (!Options.openAction.isEmpty())
 	{
@@ -1140,7 +1117,7 @@
 //	Datum += "Z";
 
 	// only include XMP to PDF/X-4 at the moment, could easily be extended to include it to any PDF
-	if (Options.Version == PDFOptions::PDFVersion_X4)
+	if (Options.Version == PDFVersion::PDF_X4)
 		generateXMP(dt.toString("yyyy-MM-ddThh:mm:ssZ"));
 
 /* The following code makes the resulting PDF "Reader enabled" in Acrobat Reader 8
@@ -1195,7 +1172,7 @@
 	writer.setFileId(Pdf::toPdfDocEncoding(IDg));
 	if (Options.Encrypt)
 	{
-		writer.setEncryption((Options.Version == PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_15), Pdf::toPdfDocEncoding(Options.PassOwner), Pdf::toPdfDocEncoding(Options.PassUser), Options.Permissions);
+		writer.setEncryption(Options.Version.supports128BitsEncryption(), Pdf::toPdfDocEncoding(Options.PassOwner), Pdf::toPdfDocEncoding(Options.PassUser), Options.Permissions);
 	}
 	writer.startObj(writer.InfoObj);
 	PutDoc("<<\n/Creator " + EncString(QByteArray("Scribus ") + VERSION, writer.InfoObj) + "\n");
@@ -1210,14 +1187,14 @@
 	PutDoc("/Keywords " + EncStringUTF16(doc.documentInfo().keywords(), writer.InfoObj) + "\n");
 	PutDoc("/CreationDate " + EncString(Datum, writer.InfoObj) + "\n");
 	PutDoc("/ModDate " + EncString(Datum, writer.InfoObj) + "\n");
-	if (Options.Version == PDFOptions::PDFVersion_X1a)
+	if (Options.Version == PDFVersion::PDF_X1a)
 	{
 		PutDoc("/GTS_PDFXVersion (PDF/X-1:2001)\n");
 		PutDoc("/GTS_PDFXConformance (PDF/X-1a:2001)\n");
 	}
-	if (Options.Version == PDFOptions::PDFVersion_X3)
+	if (Options.Version == PDFVersion::PDF_X3)
 		PutDoc("/GTS_PDFXVersion (PDF/X-3:2002)\n");
-	if (Options.Version == PDFOptions::PDFVersion_X4)
+	if (Options.Version == PDFVersion::PDF_X4)
 		PutDoc("/GTS_PDFXVersion (PDF/X-4)\n");
 	PutDoc("/Trapped /False\n>>");
 	writer.endObj(writer.InfoObj);
@@ -1257,7 +1234,7 @@
 					StdFonts.insert("/ZapfDingbats", "");
 				if (pgit->itemText.length() > 0 || mustEmbed)
 				{
-					if (Options.Version < PDFOptions::PDFVersion_14)
+					if (Options.Version < PDFVersion::PDF_14)
 						StdFonts.insert(ind2PDFabr[pgit->annotation().Font()], "");
 					QString replacementName = pgit->itemText.defaultStyle().charStyle().font().replacementName();
 					ReallyUsed.insert(replacementName, DocFonts[replacementName]);
@@ -1292,7 +1269,7 @@
 					StdFonts.insert("/ZapfDingbats", "");
 				if (pgit->itemText.length() > 0 || mustEmbed)
 				{
-					if (Options.Version < PDFOptions::PDFVersion_14)
+					if (Options.Version < PDFVersion::PDF_14)
 						StdFonts.insert(ind2PDFabr[pgit->annotation().Font()], "");
 					QString replacementName = pgit->itemText.defaultStyle().charStyle().font().replacementName();
 					ReallyUsed.insert(replacementName, DocFonts[replacementName]);
@@ -1327,7 +1304,7 @@
 					StdFonts.insert("/ZapfDingbats", "");
 				if (pgit->itemText.length() > 0 || mustEmbed)
 				{
-					if (Options.Version < PDFOptions::PDFVersion_14)
+					if (Options.Version < PDFVersion::PDF_14)
 						StdFonts.insert(ind2PDFabr[pgit->annotation().Font()], "");
 					QString replacementName = pgit->itemText.defaultStyle().charStyle().font().replacementName();
 					ReallyUsed.insert(replacementName, DocFonts[replacementName]);
@@ -1367,7 +1344,7 @@
 						StdFonts.insert("/ZapfDingbats", "");
 					if (pgit->itemText.length() > 0)
 					{
-						if (Options.Version < PDFOptions::PDFVersion_14)
+						if (Options.Version < PDFVersion::PDF_14)
 							StdFonts.insert(ind2PDFabr[pgit->annotation().Font()], "");
 						QString replacementName = pgit->itemText.defaultStyle().charStyle().font().replacementName();
 						ReallyUsed.insert(replacementName, DocFonts[replacementName]);
@@ -1742,7 +1719,6 @@
 }
 
 PdfId PDFLibCore::PDF_EmbedFontObject(const QByteArray& font, const QByteArray& subtype)
-
 {
 	PdfId embeddedFontObject = writer.newObject();
 	writer.startObj(embeddedFontObject);
@@ -1812,11 +1788,11 @@
 		{
 			if (face.type() == ScFace::OTF)
 			{
-				PutDoc("/FontFile3 "+Pdf::toPdf(embeddedFontObject)+" 0 R\n");
+				PutDoc("/FontFile3 " + Pdf::toPdf(embeddedFontObject) + " 0 R\n");
 			}
 			else
 			{
-				PutDoc("/FontFile2 "+Pdf::toPdf(embeddedFontObject)+" 0 R\n");
+				PutDoc("/FontFile2 " + Pdf::toPdf(embeddedFontObject) + " 0 R\n");
 			}
 		}
 		else if (fformat == ScFace::PFB)
@@ -2336,7 +2312,9 @@
 		if (fformat == ScFace::SFNT || fformat == ScFace::TTCF)
 		{
 			QByteArray subtype;
-			if (face.type() == ScFace::OTF)
+			if (face.type() == ScFace::OTF && Options.supportsEmbeddedOpenTypeFonts())
+				subtype = "/OpenType";
+			else if (face.type() == ScFace::OTF)
 			{
 				subtype = "/CIDFontType0C";
 				QByteArray cff_bb = sfnt::getTable(bb, "CFF ");
@@ -2428,7 +2406,7 @@
 				
 				QByteArray subtype = (fformat == ScFace::SFNT || fformat == ScFace::TTCF) ? "/TrueType" : "/Type1";
 				
-				if ((face.isSymbolic() || !hasNeededGlyphNames || Options.Version == PDFOptions::PDFVersion_X4 || face.type() == ScFace::OTF) &&
+				if ((face.isSymbolic() || !hasNeededGlyphNames || Options.Version == PDFVersion::PDF_X4 || face.type() == ScFace::OTF) &&
 					(fformat == ScFace::SFNT || fformat == ScFace::TTCF))
 				{
 					pdfFont = PDF_EncodeCidFont(fontName, face, baseFont, fontDescriptor, gl, QMap<uint,uint>());
@@ -2438,7 +2416,7 @@
 					pdfFont = PDF_EncodeSimpleFont(fontName, face, baseFont, subtype, embeddedFontObject != 0, fontDescriptor, gl);
 				}
 
-				if ((Options.Version != PDFOptions::PDFVersion_X4) && (face.type() != ScFace::OTF))
+				if ((Options.Version != PDFVersion::PDF_X4) && (face.type() != ScFace::OTF))
 					PDF_EncodeFormFont(fontName, face, baseFont, subtype, fontDescriptor);
 			}
 			pdfFont.usage = Used_in_Content;
@@ -2505,7 +2483,7 @@
 		Transpar[HTName] = writeGState("/HT "+Pdf::toPdf(halftones)+" 0 R\n");
 		ResCount++;
 	}
-	if ((doc.HasCMS) && (Options.UseProfiles) && (Options.Version != PDFOptions::PDFVersion_X1a))
+	if ((doc.HasCMS) && (Options.UseProfiles) && (Options.Version != PDFVersion::PDF_X1a))
 	{
 		PdfId iccProfileObject = writer.newObject();
 		writer.startObj(iccProfileObject);
@@ -2600,7 +2578,7 @@
 
 void PDFLibCore::PDF_Begin_Layers()
 {
-	if ( ((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+	if (Options.exportsLayers())
 	{
 		ScLayer ll;
 		PdfOCGInfo ocg;
@@ -2664,9 +2642,9 @@
 	{
 		doc.Layers.levelToLayer(ll, Lnr);
 		PItems = doc.MasterItems;
-		if ((ll.isPrintable) || (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers)))
-		{
-			if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+		if (ll.isPrintable || Options.exportsLayers())
+		{
+			if (Options.exportsLayers())
 				PutPage("/OC /" + OCGEntries[ll.Name].Name + " BDC\n");
 			for (int a = 0; a < PItems.count(); ++a)
 			{
@@ -2776,7 +2754,7 @@
 					case PageItem::LatexFrame:
 						PutPage("q\n");
 						// Same functions as for ImageFrames work for LatexFrames too
-						if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+						if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 						{
 							PutPage(PDF_TransparenzFill(ite));
 						}
@@ -2840,7 +2818,7 @@
 						PutPage("Q\n");
 						if (((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0)))
 						{
-							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 								PutPage(PDF_TransparenzStroke(ite));
 							if (ite->NamedLStyle.isEmpty())
 							{
@@ -2895,7 +2873,7 @@
 					case PageItem::TextFrame:
 						break;
 					case PageItem::Line:
-						if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+						if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 							PutPage(PDF_TransparenzStroke(ite));
 						if (ite->NamedLStyle.isEmpty())
 						{
@@ -2971,7 +2949,7 @@
 					case PageItem::RegularPolygon:
 					case PageItem::Arc:
 						PutPage("q\n");
-						if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+						if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 						{
 							PutPage(PDF_TransparenzFill(ite));
 						}
@@ -3015,7 +2993,7 @@
 						PutPage("Q\n");
 						if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
 						{
-							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 								PutPage(PDF_TransparenzStroke(ite));
 							if ((ite->NamedLStyle.isEmpty()) && (ite->lineWidth() != 0.0))
 							{
@@ -3071,7 +3049,7 @@
 						if (ite->PoLine.size() > 3) // && ((ite->PoLine.point(0) != ite->PoLine.point(1)) || (ite->PoLine.point(2) != ite->PoLine.point(3))))
 						{
 							PutPage("q\n");
-							if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+							if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 							{
 								PutPage(PDF_TransparenzFill(ite));
 							}
@@ -3116,7 +3094,7 @@
 						}
 						if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
 						{
-							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+							if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 								PutPage(PDF_TransparenzStroke(ite));
 							if (ite->NamedLStyle.isEmpty())
 							{
@@ -3228,14 +3206,14 @@
 							{
 								PageItem* embedded = pat.items.at(em);
 								tmpD += "q\n";
-								tmpD +=  "1 0 0 1 "+FToStr(embedded->gXpos)+" "+FToStr(ite->height() - embedded->gYpos)+" cm\n";
+								tmpD +=  "1 0 0 1 " + FToStr(embedded->gXpos) + " " + FToStr(ite->height() - embedded->gYpos) + " cm\n";
 								QByteArray output;
 								if (!PDF_ProcessItem(output, embedded, pag, pag->pageNr(), true))
 									return false;
 								tmpD += output;
 								tmpD += "Q\n";
 							}
-							if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+							if (Options.supportsTransparency())
 								PutPage(Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite));
 							else
 								PutPage(tmpD);
@@ -3274,7 +3252,7 @@
 								tmpD += "Q\n";
 							}
 							groupStackPos.pop();
-							if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+							if (Options.supportsTransparency())
 								PutPage(Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite));
 							else
 								PutPage(Write_FormXObject(tmpD, ite));
@@ -3325,7 +3303,7 @@
 				                            .replace("%2", Pdf::toPdf(qHash(ite)));
 				pageData.XObjects[name] = templateObject;
 			}
-			if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+			if (Options.exportsLayers())
 				PutPage("EMC\n");
 		}
 		Lnr++;
@@ -3568,7 +3546,7 @@
 	}
 	pageData.ObjNum = WritePDFStream(Content);
 	int Gobj = 0;
-	if ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4))
+	if (Options.supportsTransparency())
 	{
 		Gobj = writer.newObject();
 		writer.startObj(Gobj);
@@ -3597,11 +3575,11 @@
 	PutDoc("/BleedBox ["+FToStr(markOffs)+" "+FToStr(markOffs)+" "+FToStr(maxBoxX-markOffs)+" "+FToStr(maxBoxY-markOffs)+"]\n");
 	PutDoc("/CropBox [0 0 "+FToStr(maxBoxX)+" "+FToStr(maxBoxY)+"]\n");
 	PutDoc("/TrimBox ["+FToStr(bleedLeft+markOffs)+" "+FToStr(Options.bleeds.bottom()+markOffs)+" "+FToStr(maxBoxX-bleedRight-markOffs)+" "+FToStr(maxBoxY-Options.bleeds.top()-markOffs)+"]\n");
-	if (Options.Version >= PDFOptions::PDFVersion_13) // PDF/X forbids having both art and trim box!
+	if (!Options.Version.isPDFX()) // PDF/X forbids having both art and trim box!
 		PutDoc("/ArtBox ["+FToStr(bleedLeft+markOffs)+" "+FToStr(Options.bleeds.bottom()+markOffs)+" "+FToStr(maxBoxX-bleedRight-markOffs)+" "+FToStr(maxBoxY-Options.bleeds.top()-markOffs)+"]\n");
 	PutDoc("/Rotate "+Pdf::toPdf(Options.RotateDeg)+"\n");
 	PutDoc("/Contents "+Pdf::toPdf(pageData.ObjNum)+" 0 R\n");
-	if ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) // && (Transpar.count() != 0))
+	if (Options.supportsTransparency()) // && (Transpar.count() != 0))
 		PutDoc("/Group "+Pdf::toPdf(Gobj)+" 0 R\n");
 	if (Options.Thumbnails)
 		PutDoc("/Thumb "+Pdf::toPdf(pageData.Thumb)+" 0 R\n");
@@ -3868,10 +3846,10 @@
 
 	if (!Options.MirrorH)
 		PutPage("1 0 0 1 0 0 cm\n");
-	if ((layer.isPrintable) || (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers)))
-	{
-		if ((((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4))) && (Options.useLayers))
-			PutPage("/OC /"+OCGEntries[layer.Name].Name+" BDC\n");
+	if (layer.isPrintable || Options.exportsLayers())
+	{
+		if (Options.exportsLayers())
+			PutPage("/OC /" + OCGEntries[layer.Name].Name + " BDC\n");
 		for (int am = 0; am < pag->FromMaster.count() && !abortExport; ++am)
 		{
 			ite = pag->FromMaster.at(am);
@@ -3886,7 +3864,7 @@
 			                             .replace("%2", Pdf::toPdf(qHash(ite)));
 			if ((!ite->asTextFrame()) && (!ite->asPathText()) && (!ite->asTable()))
 			{
-				if (((layer.transparency != 1) || (layer.blendMode != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+				if (((layer.transparency != 1) || (layer.blendMode != 0)) && Options.supportsTransparency())
 					content += (name + " Do\n");
 				else
 					PutPage(name + " Do\n");
@@ -3901,7 +3879,7 @@
 				ite->setYPos(ite->yPos() - mPage->yOffset() + pag->yOffset(), true);
 				if (!PDF_ProcessItem(output, ite, pag, pag->pageNr()))
 					return false;
-				if (((layer.transparency != 1) || (layer.blendMode != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+				if (((layer.transparency != 1) || (layer.blendMode != 0)) && Options.supportsTransparency())
 					content += output;
 				else
 					PutPage(output);
@@ -3911,7 +3889,7 @@
 			}
 		}
 		// Couldn't we use Write_TransparencyGroup() here?
-		if (((layer.transparency != 1) || (layer.blendMode != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) ||(Options.Version == PDFOptions::PDFVersion_X4)))
+		if (((layer.transparency != 1) || (layer.blendMode != 0)) && Options.supportsTransparency())
 		{
 			PdfId Gobj = writer.newObject();
 			writer.startObj(Gobj);
@@ -3952,7 +3930,7 @@
 			PutPage("/"+name+" Do\n");
 			PutPage("Q\n");
 		}
-		if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+		if (Options.exportsLayers())
 			PutPage("EMC\n");
 	}
 	return true;
@@ -3966,11 +3944,11 @@
 
 	int pc_exportpagesitems = usingGUI ? progressDialog->progress("ECPI") : 0;
 	PItems = (pag->pageNameEmpty()) ? doc.DocItems : doc.MasterItems;
-	if ((layer.isPrintable) || (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers)))
+	if (layer.isPrintable || Options.exportsLayers())
 	{
 		QByteArray inh;
-		if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
-			PutPage("/OC /"+OCGEntries[layer.Name].Name+" BDC\n");
+		if (Options.exportsLayers())
+			PutPage("/OC /" + OCGEntries[layer.Name].Name + " BDC\n");
 		for (int a = 0; a < PItems.count() && !abortExport; ++a)
 		{
 			ite = PItems.at(a);
@@ -3983,13 +3961,13 @@
 			}
 			if (!PDF_ProcessItem(output, ite, pag, PNr))
 				return false;
-			if (((layer.transparency != 1) || (layer.blendMode != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+			if (((layer.transparency != 1) || (layer.blendMode != 0)) && Options.supportsTransparency())
 				inh += output;
 			else
 				PutPage(output);
 		}
 		// Couldn't we use Write_TransparencyGroup() here?
-		if (((layer.transparency != 1) || (layer.blendMode != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) ||(Options.Version == PDFOptions::PDFVersion_X4)))
+		if (((layer.transparency != 1) || (layer.blendMode != 0)) && Options.supportsTransparency())
 		{
 			int Gobj = writer.newObject();
 			writer.startObj(Gobj);
@@ -4029,7 +4007,7 @@
 			PutPage(Pdf::toName(name) + " Do\n");
 			PutPage("Q\n");
 		}
-		if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+		if (Options.exportsLayers())
 			PutPage("EMC\n");
 	}
 	return true;
@@ -4182,7 +4160,7 @@
 
 QByteArray PDFLibCore::PDF_PutSoftShadow(PageItem* ite)
 {
-	if ((Options.Version < PDFOptions::PDFVersion_14 && Options.Version != PDFOptions::PDFVersion_X4) || !ite->hasSoftShadow() || ite->softShadowColor() == CommonStrings::None || !ite->printEnabled())
+	if (!Options.supportsTransparency() || !ite->hasSoftShadow() || ite->softShadowColor() == CommonStrings::None || !ite->printEnabled())
 		return "";
 	double maxSize;
 	QByteArray tmp("q\n");
@@ -4418,7 +4396,7 @@
 									   "/OPM 1\n");
 		tmp += Pdf::toName(ShName) + " gs\n";
 	}
-//	if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.Version >= PDFOptions::PDFVersion_14))
+//	if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.supportsTransparency()))
 //		tmp += PDF_Transparenz(ite);
 	if ((ite->isBookmark) && (Options.Bookmarks))
 		PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
@@ -4506,7 +4484,7 @@
 #ifdef HAVE_OSG
 			if (ite->asOSGFrame())
 			{
-				if (Options.Version != PDFOptions::PDFVersion_X3)
+				if (Options.Version != PDFVersion::PDF_X3)
 				{
 					if (!PDF_3DAnnotation(ite, PNr))
 						return false;
@@ -4516,7 +4494,7 @@
 #endif
 			tmp += "q\n";
 			// Same functions as for ImageFrames work for LatexFrames too
-			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4) ))
+			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 			{
 				tmp += PDF_TransparenzFill(ite);
 			}
@@ -4580,7 +4558,7 @@
 			tmp += "Q\n";
 			if (((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0)))
 			{
-				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4) ))
+				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 					tmp += PDF_TransparenzStroke(ite);
 				if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
 				{
@@ -4645,7 +4623,7 @@
 				break;
 			}
 			tmp += "q\n";
-			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4) ))
+			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 			{
 				tmp += PDF_TransparenzFill(ite);
 			}
@@ -4702,7 +4680,7 @@
 			tmp += "Q\n";
 			if (((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0)))
 			{
-				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4) ))
+				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 					tmp += PDF_TransparenzStroke(ite);
 				if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
 				{
@@ -4755,7 +4733,7 @@
 			}
 			break;
 		case PageItem::Line:
-			if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+			if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 				tmp += PDF_TransparenzStroke(ite);
 			if (ite->NamedLStyle.isEmpty())
 			{
@@ -4832,7 +4810,7 @@
 		case PageItem::RegularPolygon:
 		case PageItem::Arc:
 			tmp += "q\n";
-			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 			{
 				tmp += PDF_TransparenzFill(ite);
 			}
@@ -4876,7 +4854,7 @@
 			tmp += "Q\n";
 			if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
 			{
-				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 					tmp += PDF_TransparenzStroke(ite);
 				if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
 				{
@@ -4933,7 +4911,7 @@
 			if (ite->PoLine.size() > 3)  // && ((ite->PoLine.point(0) != ite->PoLine.point(1)) || (ite->PoLine.point(2) != ite->PoLine.point(3))))
 			{
 				tmp += "q\n";
-				if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+				if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 				{
 					tmp += PDF_TransparenzFill(ite);
 				}
@@ -4978,7 +4956,7 @@
 			}
 			if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
 			{
-				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+				if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 					tmp += PDF_TransparenzStroke(ite);
 				if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
 				{
@@ -5074,7 +5052,7 @@
 					tmp += "q\n";
 					if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
 					{
-						if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+						if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && Options.supportsTransparency())
 							tmp += PDF_TransparenzStroke(ite);
 						if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
 						{
@@ -5128,7 +5106,7 @@
 					tmp += "Q\n";
 				}
 			}
-			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+			if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && Options.supportsTransparency())
 			{
 				if (ite->GrMask > 0)
 					tmp += "q\n";
@@ -5168,7 +5146,7 @@
 					tmpD += "Q\n";
 				}
 				groupStackPos.pop();
-				if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+				if (Options.supportsTransparency())
 					tmp += Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite);
 				else
 					tmp += tmpD;
@@ -5207,7 +5185,7 @@
 					tmpD += "Q\n";
 				}
 				groupStackPos.pop();
-				if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
+				if (Options.supportsTransparency())
 					tmp += Write_TransparencyGroup(ite->fillTransparency(), ite->fillBlendmode(), tmpD, ite);
 				else
 					tmp += Write_FormXObject(tmpD, ite);
@@ -5538,7 +5516,7 @@
 			arrowTrans.scale(ml[ml.size()-1].Width, ml[ml.size()-1].Width);
 	}
 	arrow.map(arrowTrans);
-	if ((ite->lineTransparency() != 0) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+	if ((ite->lineTransparency() != 0) && Options.supportsTransparency())
 	{
 		QByteArray ShName = ResNam+Pdf::toPdf(ResCount);
 		ResCount++;
@@ -6835,7 +6813,7 @@
 		}
 	}
 	QByteArray TRes;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 	{
 		PdfId shadeObjectT = writer.newObject();
 		writer.startObj(shadeObjectT);
@@ -7085,7 +7063,7 @@
 		writer.endObj(spotObject);
 	}
 	QByteArray tmp;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 		tmp += Pdf::toName(TRes) + " gs\n";
 	tmp += "/Pattern cs\n";
 	tmp += "/Pattern"+Pdf::toPdf(patObject)+" scn\n";
@@ -7168,7 +7146,7 @@
 		Gcolors.append(SetGradientColor(mp4.colorName, mp4.shade));
 	}
 	QByteArray TRes("");
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 	{
 		PdfId shadeObjectT = writer.newObject();
 		writer.startObj(shadeObjectT);
@@ -7412,7 +7390,7 @@
 		writer.endObj(spotObject);
 	}
 	QByteArray tmp;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 		tmp += Pdf::toName(TRes) + " gs\n";
 	tmp += "/Pattern cs\n";
 	tmp += "/Pattern"+Pdf::toPdf(patObject)+" scn\n";
@@ -7476,7 +7454,7 @@
 	QLineF edge3 = QLineF(cP, QPointF(c->GrControl3.x(), -c->GrControl3.y()));
 	QLineF edge4 = QLineF(cP, QPointF(c->GrControl4.x(), -c->GrControl4.y()));
 	QByteArray TRes("");
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 	{
 		PdfId shadeObjectT = writer.newObject();
 		writer.startObj(shadeObjectT);
@@ -7845,7 +7823,7 @@
 		writer.endObj(spotObject);
 	}
 	QByteArray tmp;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 		tmp += Pdf::toName(TRes) + " gs\n";
 	tmp += "/Pattern cs\n";
 	tmp += "/Pattern"+Pdf::toPdf(patObject)+" scn\n";
@@ -7894,7 +7872,7 @@
 		Gcolors.append(SetGradientColor(colorNames.at(cst), colorShades[cst]));
 	}
 	QByteArray TRes("");
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 	{
 		PdfId shadeObjectT = writer.newObject();
 		writer.startObj(shadeObjectT);
@@ -8165,7 +8143,7 @@
 		writer.endObj(spotObject);
 	}
 	QByteArray tmp;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 		tmp += Pdf::toName(TRes) + " gs\n";
 	tmp += "/Pattern cs\n";
 	tmp += "/Pattern"+Pdf::toPdf(patObject)+" scn\n";
@@ -8328,7 +8306,7 @@
 		lastStop = actualStop;
 	}
 	QByteArray TRes;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 	{
 		QTransform mpM;
 		//#12058: cause problems with rotated objects
@@ -8618,7 +8596,7 @@
 		writer.endObj(spotObject);
 	}
 	QByteArray tmp;
-	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	if (Options.supportsTransparency() && transparencyFound)
 		tmp += Pdf::toName(TRes) + " gs\n";
 	if ((forArrow) || (!stroke))
 	{
@@ -8839,7 +8817,7 @@
 		cnx += " "+ putColor(ite->fillColor(), ite->fillShade(), false);
 	PutDoc("/DA " + EncString(cnx, annotationObj) + "\n");
 	int flg = ite->annotation().Flag();
-	if (Options.Version == PDFOptions::PDFVersion_13)
+	if (Options.Version == PDFVersion::PDF_13)
 		flg = flg & 522247;
 	PutDoc("/Ff "+Pdf::toPdf(flg)+"\n");
 	PutDoc("/FT /Btn\n");
@@ -9093,7 +9071,7 @@
 				cnx += Pdf::toName(StdFonts["/ZapfDingbats"]);
 			else
 			{
-				if (Options.Version < PDFOptions::PDFVersion_14)
+				if (Options.Version < PDFVersion::PDF_14)
 					cnx += Pdf::toName(StdFonts[ind2PDFabr[ite->annotation().Font()]]);
 				else
 					cnx += UsedFontsF[ite->itemText.defaultStyle().charStyle().font().replacementName()].name;
@@ -9106,7 +9084,7 @@
 				cnx += " "+ putColor(ite->fillColor(), ite->fillShade(), false);
 			PutDoc("/DA " + EncString(cnx, annotationObj) + "\n");
 			int flg = ite->annotation().Flag();
-			if (Options.Version == PDFOptions::PDFVersion_13)
+			if (Options.Version == PDFVersion::PDF_13)
 				flg = flg & 522247;
 			PutDoc("/Ff "+Pdf::toPdf(flg)+"\n");
 			QByteArray xs[] = {"N", "I", "O", "P"};
@@ -9408,7 +9386,7 @@
 		cc += "BT\n";
 		if (ite->itemText.defaultStyle().charStyle().fillColor() != CommonStrings::None)
 			cc += putColor(ite->itemText.defaultStyle().charStyle().fillColor(), ite->itemText.defaultStyle().charStyle().fillShade(), true);
-		if (Options.Version < PDFOptions::PDFVersion_14)
+		if (Options.Version < PDFVersion::PDF_14)
 			cc += "/"+StdFonts[ind2PDFabr[ite->annotation().Font()]];
 		else
 			cc += UsedFontsF[ite->itemText.defaultStyle().charStyle().font().replacementName()].name;
@@ -9431,7 +9409,7 @@
 		cc += "/Tx BMC\nBT\n";
 		if (ite->itemText.defaultStyle().charStyle().fillColor() != CommonStrings::None)
 			cc += putColor(ite->itemText.defaultStyle().charStyle().fillColor(), ite->itemText.defaultStyle().charStyle().fillShade(), true);
-		if (Options.Version < PDFOptions::PDFVersion_14)
+		if (Options.Version < PDFVersion::PDF_14)
 			cc += "/"+StdFonts[ind2PDFabr[ite->annotation().Font()]];
 		else
 			cc += UsedFontsF[ite->itemText.defaultStyle().charStyle().font().replacementName()].name;
@@ -9478,7 +9456,7 @@
 		cc += createBorderAppearance(ite);
 		cc += "/Tx BMC\nq\nBT\n";
 		cc += "0 g\n";
-		if (Options.Version < PDFOptions::PDFVersion_14)
+		if (Options.Version < PDFVersion::PDF_14)
 			cc += "/"+StdFonts[ind2PDFabr[ite->annotation().Font()]];
 		else
 			cc += UsedFontsF[ite->itemText.defaultStyle().charStyle().font().replacementName()].name;
@@ -10319,7 +10297,7 @@
 				QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.pdf");
 				QStringList opts;
 				opts.append("-dEPSCrop");
-				if (Options.Version >= PDFOptions::PDFVersion_14)
+				if (Options.Version >= PDFVersion::PDF_14)
 					opts.append( "-dCompatibilityLevel=1.4" );
 				else
 					opts.append( "-dCompatibilityLevel=1.3" );
@@ -10556,7 +10534,7 @@
 					// PDF-X/4 requires that CMYK images using the same profile as PDF/X output intent
 					// do not be tagged with an ICC profile so they can go through color conversion
 					// pipeline without alteration
-					if (Options.Version == PDFOptions::PDFVersion_X4)
+					if (Options.Version == PDFVersion::PDF_X4)
 						avoidPDFXOutputIntentProf = (profInUse == Options.PrintProf);
 					if (!ICCProfiles.contains(profInUse) && !avoidPDFXOutputIntentProf)
 					{
@@ -10654,7 +10632,7 @@
 			else
 			{
 				bool gotAlpha = false;
-				bool pdfVer14 = (Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4);
+				bool pdfVer14 = Options.supportsTransparency();
 				gotAlpha = img2.getAlpha(fn, c->pixm.imgInfo.actualPageNumber, im2, true, pdfVer14, afl, img.width(), img.height());
 				if (!gotAlpha)
 				{
@@ -10692,20 +10670,20 @@
 						compAlphaAvail = true;
 					}
 				}
-				if ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4))
-				{
-					PutDoc("/Width "+Pdf::toPdf(origWidth)+"\n");
-					PutDoc("/Height "+Pdf::toPdf(origHeight)+"\n");
+				if (Options.supportsTransparency())
+				{
+					PutDoc("/Width " + Pdf::toPdf(origWidth) + "\n");
+					PutDoc("/Height " + Pdf::toPdf(origHeight) + "\n");
 					PutDoc("/ColorSpace /DeviceGray\n");
 					PutDoc("/BitsPerComponent 8\n");
-					PutDoc("/Length "+Pdf::toPdf(im2.size())+"\n");
+					PutDoc("/Length " + Pdf::toPdf(im2.size()) + "\n");
 				}
 				else
 				{
-					PutDoc("/Width "+Pdf::toPdf(origWidth)+"\n");
-					PutDoc("/Height "+Pdf::toPdf(origHeight)+"\n");
+					PutDoc("/Width " + Pdf::toPdf(origWidth) + "\n");
+					PutDoc("/Height " + Pdf::toPdf(origHeight) + "\n");
 					PutDoc("/ImageMask true\n/BitsPerComponent 1\n");
-					PutDoc("/Length "+Pdf::toPdf(im2.size())+"\n");
+					PutDoc("/Length " + Pdf::toPdf(im2.size()) + "\n");
 				}
 				if ((Options.CompressMethod != PDFOptions::Compression_None) && compAlphaAvail)
 					PutDoc("/Filter /FlateDecode\n");
@@ -10846,10 +10824,10 @@
 //				PutDoc("/Decode [1 0 1 0 1 0 1 0]\n");
 			if (alphaM)
 			{
-				if ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4))
-					PutDoc("/SMask "+Pdf::toPdf(maskObj)+" 0 R\n");
+				if (Options.supportsTransparency())
+					PutDoc("/SMask " + Pdf::toPdf(maskObj) + " 0 R\n");
 				else
-					PutDoc("/Mask "+Pdf::toPdf(maskObj)+" 0 R\n");
+					PutDoc("/Mask " + Pdf::toPdf(maskObj) + " 0 R\n");
 			}
 			PutDoc(">>\nstream\n");
 			if (cm == PDFOptions::Compression_JPEG) // Fixme: should not do this with monochrome images?
@@ -11027,7 +11005,7 @@
 	dict.ColorSpace.append(asColorSpace(spotMapReg.values()));
 
 	dict.Properties.clear();
-	if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4))&& (Options.useLayers))
+	if (Options.exportsLayers())
 	{
 		ScLayer ll;
 		ll.isPrintable = false;
@@ -11266,7 +11244,7 @@
 
 void PDFLibCore::PDF_End_Layers()
 {
-	if (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers))
+	if (Options.exportsLayers())
 	{
 		QList<QByteArray> lay;
 		writer.startObj(writer.OCPropertiesObj);
@@ -11285,15 +11263,15 @@
 		}
 		for (int layc = 0; layc < lay.count(); ++layc)
 		{
-			if (Options.Version != PDFOptions::PDFVersion_X4)
+			if (Options.Version != PDFVersion::PDF_X4)
 				PutDoc(lay[layc]);
 		}
 		PutDoc("]\n");
-		if (Options.Version == PDFOptions::PDFVersion_X4)
+		if (Options.Version == PDFVersion::PDF_X4)
 		{
 			PutDoc("/BaseState /ON\n");
 			QString occdName = "Default";
-			PutDoc("/Name "+Pdf::toLiteralString(occdName)+"\n");
+			PutDoc("/Name " + Pdf::toLiteralString(occdName) + "\n");
 		}
 		PutDoc("/OFF [ ");
 		QHash<QString, PdfOCGInfo>::Iterator itoc;
@@ -11303,7 +11281,7 @@
 				PutDoc(Pdf::toObjRef(itoc.value().ObjNum) + " ");
 		}
 		PutDoc("]\n");
-		if (Options.Version != PDFOptions::PDFVersion_X4)
+		if (Options.Version != PDFVersion::PDF_X4)
 		{
 			PutDoc("/AS [<</Event /Print /OCGs [ ");
 			for (itoc = OCGEntries.begin(); itoc != OCGEntries.end(); ++itoc)
@@ -11353,12 +11331,12 @@
 		PutDoc("\nendstream");
 		writer.endObj(profileObj);
 
-//		if ((Options.Version == PDFOptions::PDFVersion_X4) && (Options.useLayers))
+//		if ((Options.Version == PDFVersion::PDF_X4) && (Options.useLayers))
 //		{
 //			XRef[9] = bytesWritten();
 //			PutDoc("10 0 obj\n");
 //		}
-//		if ((Options.Version == PDFOptions::PDFVersion_X3) || (Options.Version == PDFOptions::PDFVersion_X1a) || ((Options.Version == PDFOptions::PDFVersion_X4) && !(Options.useLayers)))
+//		if ((Options.Version == PDFVersion::PDF_X3) || (Options.Version == PDFVersion::PDF_X1a) || ((Options.Version == PDFVersion::PDF_X4) && !(Options.useLayers)))
 //		{
 //			XRef[8] = bytesWritten();
 //			PutDoc("9 0 obj\n");
@@ -11378,7 +11356,7 @@
 
 void PDFLibCore::PDF_End_Metadata()
 {
-	if (Options.Version == PDFOptions::PDFVersion_X4)
+	if (Options.Version == PDFVersion::PDF_X4)
 	{
 //		if (Options.useLayers) // OCProperties dictionary was included as '9 0 obj', OutputIntents was included as '10 0 obj'
 //		{
@@ -11480,14 +11458,14 @@
 		QDomElement descPDFXID = desc.cloneNode().toElement();
 		rdf.appendChild(descPDFXID);
 		QString pdfxidNS = "http://www.npes.org/pdfx/ns/id/";
-		if (Options.Version == PDFOptions::PDFVersion_X1a)
+		if (Options.Version == PDFVersion::PDF_X1a)
 		{
 			descPDFXID.setAttributeNS(pdfxidNS, "pdfx:GTS_PDFXConformance", "PDF/X-1a:2001");
 			descPDFXID.setAttribute("pdfx:GTS_PDFXVersion", "PDF/X-1:2001");
 		}
-		else if (Options.Version == PDFOptions::PDFVersion_X3)
+		else if (Options.Version == PDFVersion::PDF_X3)
 			descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-3");
-		else if (Options.Version == PDFOptions::PDFVersion_X4)
+		else if (Options.Version == PDFVersion::PDF_X4)
 			descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-4");
 	}
 

Modified: trunk/Scribus/scribus/pdflib_core.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdflib_core.h
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.h	(original)
+++ trunk/Scribus/scribus/pdflib_core.h	Tue Mar 31 11:39:59 2020
@@ -91,7 +91,7 @@
 	};
 
 	bool PDF_IsPDFX();
-	bool PDF_IsPDFX(PDFOptions::PDFVersion ver);
+	bool PDF_IsPDFX(const PDFVersion& ver);
 
 	bool PDF_Begin_Doc(const QString& fn, SCFonts &AllFonts, const QMap<QString, QMap<uint, FPointArray> >& DocFonts, BookMView* vi);
 	void PDF_Begin_Catalog();

Modified: trunk/Scribus/scribus/pdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptions.cpp	(original)
+++ trunk/Scribus/scribus/pdfoptions.cpp	Tue Mar 31 11:39:59 2020
@@ -17,3 +17,25 @@
 	// TODO: implement this method
 	return Verify_NoError;
 }
+
+bool PDFOptions::exportsLayers() const
+{
+	if (Version.supportsOCGs())
+		return useLayers;
+	return false;
+}
+
+bool PDFOptions::supportsEmbeddedOpenTypeFonts() const
+{
+	return Version.supportsEmbeddedOpenTypeFonts();
+}
+
+bool PDFOptions::supportsOCGs() const
+{
+	return Version.supportsOCGs();
+}
+
+bool PDFOptions::supportsTransparency() const
+{
+	return Version.supportsTransparency();
+}

Modified: trunk/Scribus/scribus/pdfoptions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdfoptions.h
==============================================================================
--- trunk/Scribus/scribus/pdfoptions.h	(original)
+++ trunk/Scribus/scribus/pdfoptions.h	Tue Mar 31 11:39:59 2020
@@ -14,9 +14,11 @@
  * @brief Defines class PDFOptions, used for loading/saving/passing around PDF options
  */
 
-#include "qstring.h"
-#include "qmap.h"
-#include "QList"
+#include <QList>
+#include <QMap>
+#include <QString>
+
+#include "pdfversion.h"
 #include "scribusapi.h"
 #include "scribusstructs.h"
 
@@ -44,18 +46,6 @@
 		Verify_OptionConflict,
 		Verify_OptionOutOfRange,
 		Verify_OtherError
-	};
-
-	enum PDFVersion
-	{
-		PDFVersion_13  = 13,
-		PDFVersion_14  = 14,
-		PDFVersion_15  = 15,
-		PDFVersion_X1a = 11,
-		PDFVersion_X3  = 12,
-		PDFVersion_X4  = 10,
-		PDFVersion_Min = 10,
-		PDFVersion_Max = 15,
 	};
 
 	enum PDFPageLayout
@@ -103,6 +93,11 @@
 	 */
 	PDFOptions::VerifyResults verify(QString* problemDescription);
 	PDFOptions::VerifyResults verify();
+
+	bool exportsLayers() const;
+	bool supportsEmbeddedOpenTypeFonts() const;
+	bool supportsOCGs() const;
+	bool supportsTransparency() const;
 
 	bool firstUse;
 	bool Thumbnails;

Modified: trunk/Scribus/scribus/pdfoptionsio.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdfoptionsio.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptionsio.cpp	(original)
+++ trunk/Scribus/scribus/pdfoptionsio.cpp	Tue Mar 31 11:39:59 2020
@@ -111,13 +111,13 @@
 	QString pdfVersString;
 	switch (m_opts->Version)
 	{
-		case PDFOptions::PDFVersion_X1a:
+		case PDFVersion::PDF_X1a:
 			pdfVersString = "X1a";
 			break;
-		case PDFOptions::PDFVersion_X3:
+		case PDFVersion::PDF_X3:
 			pdfVersString = "X3";
 			break;
-		case PDFOptions::PDFVersion_X4:
+		case PDFVersion::PDF_X4:
 			pdfVersString = "X4";
 			break;
 		default:
@@ -447,32 +447,37 @@
 		return false;
 	if (pdfVersString == "X1a")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_X1a;
+		m_opts->Version = PDFVersion::PDF_X1a;
 		return true;
 	}
 	if (pdfVersString == "X3")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_X3;
+		m_opts->Version = PDFVersion::PDF_X3;
 		return true;
 	}
 	if (pdfVersString == "X4")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_X4;
+		m_opts->Version = PDFVersion::PDF_X4;
 		return true;
 	}
 	if (pdfVersString == "13")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_13;
+		m_opts->Version = PDFVersion::PDF_13;
 		return true;
 	}
 	if (pdfVersString == "14")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_14;
+		m_opts->Version = PDFVersion::PDF_14;
 		return true;
 	}
 	if (pdfVersString == "15")
 	{
-		m_opts->Version = PDFOptions::PDFVersion_15;
+		m_opts->Version = PDFVersion::PDF_15;
+		return true;
+	}
+	if (pdfVersString == "16")
+	{
+		m_opts->Version = PDFVersion::PDF_16;
 		return true;
 	}
 	m_error = QObject::tr("Unable to read settings XML: %1").arg(QObject::tr("<pdfVersion> invalid", "Load PDF settings"));

Modified: trunk/Scribus/scribus/pdfwriter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdfwriter.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfwriter.cpp	(original)
+++ trunk/Scribus/scribus/pdfwriter.cpp	Tue Mar 31 11:39:59 2020
@@ -742,21 +742,24 @@
 //	}
 	
 	
-	void Writer::writeHeader(PDFOptions::PDFVersion Version)
+	void Writer::writeHeader(const PDFVersion& Version)
 	{
 		switch (Version)
 		{
-			case PDFOptions::PDFVersion_X1a:
-			case PDFOptions::PDFVersion_X3:
-			case PDFOptions::PDFVersion_13:
+			case PDFVersion::PDF_X1a:
+			case PDFVersion::PDF_X3:
+			case PDFVersion::PDF_13:
 				write("%PDF-1.3\n");
 				break;
-			case PDFOptions::PDFVersion_14:
+			case PDFVersion::PDF_14:
 				write("%PDF-1.4\n");
 				break;
-			case PDFOptions::PDFVersion_X4:
-			case PDFOptions::PDFVersion_15:
+			case PDFVersion::PDF_X4:
+			case PDFVersion::PDF_15:
 				write("%PDF-1.5\n");
+				break;
+			case PDFVersion::PDF_16:
+				write("%PDF-1.6\n");
 				break;
 		}
 		write("%\xc7\xec\x8f\xa2\n");

Modified: trunk/Scribus/scribus/pdfwriter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/pdfwriter.h
==============================================================================
--- trunk/Scribus/scribus/pdfwriter.h	(original)
+++ trunk/Scribus/scribus/pdfwriter.h	Tue Mar 31 11:39:59 2020
@@ -19,6 +19,7 @@
 
 #include "pdfoptions.h"
 #include "pdfstructs.h"
+#include "pdfversion.h"
 #include "scstreamfilter.h"
 
 namespace Pdf
@@ -177,7 +178,7 @@
 public:
 	
 	// writing
-	void writeHeader(PDFOptions::PDFVersion vers);
+	void writeHeader(const PDFVersion& vers);
 	void writeXrefAndTrailer();
 	void write(const QByteArray& bytes);
 	void write(const Pdf::ResourceDictionary& dict);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp	Tue Mar 31 11:39:59 2020
@@ -1179,7 +1179,7 @@
 					m_Doc->pdfOptions().RotateDeg = 0;
 				m_Doc->pdfOptions().PresentMode = static_cast<bool>(pg.attribute("PresentMode").toInt());
 				m_Doc->pdfOptions().PicRes = pg.attribute("PicRes").toInt();
-				m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)pg.attribute("Version").toInt();
+				m_Doc->pdfOptions().Version = (PDFVersion::Version) pg.attribute("Version").toInt();
 				m_Doc->pdfOptions().Resolution = pg.attribute("Resolution").toInt();
 				m_Doc->pdfOptions().Binding = pg.attribute("Binding").toInt();
 				m_Doc->pdfOptions().fileName = "";

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Tue Mar 31 11:39:59 2020
@@ -1596,7 +1596,7 @@
 	doc->pdfOptions().PresentMode = attrs.valueAsBool("PresentMode");
 	doc->pdfOptions().PicRes     = attrs.valueAsInt("PicRes");
 	// Fixme: check input pdf version
-	doc->pdfOptions().Version    = (PDFOptions::PDFVersion) attrs.valueAsInt("Version");
+	doc->pdfOptions().Version    = (PDFVersion::Version) attrs.valueAsInt("Version");
 	doc->pdfOptions().Resolution = attrs.valueAsInt("Resolution");
 	doc->pdfOptions().Binding    = attrs.valueAsInt("Binding");
 	doc->pdfOptions().fileName   = "";

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	Tue Mar 31 11:39:59 2020
@@ -636,7 +636,7 @@
 				m_Doc->pdfOptions().PresentMode = static_cast<bool>(pg.attribute("PresentMode").toInt());
 				m_Doc->pdfOptions().PicRes = pg.attribute("PicRes").toInt();
 				// Fixme: check input pdf version
-				m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)pg.attribute("Version").toInt();
+				m_Doc->pdfOptions().Version = (PDFVersion::Version) pg.attribute("Version").toInt();
 				m_Doc->pdfOptions().Resolution = pg.attribute("Resolution").toInt();
 				m_Doc->pdfOptions().Binding = pg.attribute("Binding").toInt();
 				m_Doc->pdfOptions().fileName = "";

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Tue Mar 31 11:39:59 2020
@@ -3271,7 +3271,7 @@
 	doc->pdfOptions().PresentMode = attrs.valueAsBool("PresentMode");
 	doc->pdfOptions().PicRes     = attrs.valueAsInt("PicRes");
 	// Fixme: check input pdf version
-	doc->pdfOptions().Version    = (PDFOptions::PDFVersion) attrs.valueAsInt("Version");
+	doc->pdfOptions().Version    = (PDFVersion::Version) attrs.valueAsInt("Version");
 	doc->pdfOptions().Resolution = attrs.valueAsInt("Resolution");
 	doc->pdfOptions().Binding    = attrs.valueAsInt("Binding");
 	doc->pdfOptions().fileName   = "";

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	Tue Mar 31 11:39:59 2020
@@ -821,7 +821,7 @@
 							}
 							delete jsNameTreeP;
 						}
-						m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)qMin(15, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
+						m_Doc->pdfOptions().Version = (PDFVersion::Version) qMin(16, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
 						ViewerPreferences *viewPrefs = pdfDoc->getCatalog()->getViewerPreferences();
 						if (viewPrefs)
 						{

Modified: trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp	Tue Mar 31 11:39:59 2020
@@ -1269,8 +1269,8 @@
 		pdfOptions.Bookmarks = false;
 
 // get PDF version
-	self->version = minmaxi(self->version, PDFOptions::PDFVersion_Min, PDFOptions::PDFVersion_Max);
-	pdfOptions.Version = (PDFOptions::PDFVersion) self->version;
+	self->version = minmaxi(self->version, PDFVersion::PDFVersion_Min, PDFVersion::PDFVersion_Max);
+	pdfOptions.Version = (PDFVersion::Version) self->version;
 
 // apply fonts attribute
 	pdfOptions.EmbedList.clear();
@@ -1292,9 +1292,9 @@
 	}
 // apply font embedding mode
 	pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyLong_AsLong(self->fontEmbedding);
-	if (pdfOptions.Version == PDFOptions::PDFVersion_X1a ||
-	    pdfOptions.Version == PDFOptions::PDFVersion_X3 ||
-	    pdfOptions.Version == PDFOptions::PDFVersion_X4)
+	if (pdfOptions.Version == PDFVersion::PDF_X1a ||
+	    pdfOptions.Version == PDFVersion::PDF_X3 ||
+	    pdfOptions.Version == PDFVersion::PDF_X4)
 	{
 		pdfOptions.FontEmbedding = PDFOptions::EmbedFonts;
 	}
@@ -1420,7 +1420,7 @@
 	if (self->encrypt)
 	{
 		int Perm = -64;
-		if (pdfOptions.Version == PDFOptions::PDFVersion_14)
+		if (pdfOptions.Version == PDFVersion::PDF_14)
 			Perm &= ~0x00240000;
 		if (self->allowPrinting)
 			Perm += 4;
@@ -1455,9 +1455,9 @@
 			pdfOptions.SolidProf = PyUnicode_asQString(self->solidpr);
 			pdfOptions.ImageProf = PyUnicode_asQString(self->imagepr);
 			pdfOptions.PrintProf = PyUnicode_asQString(self->printprofc);
-			if (pdfOptions.Version == PDFOptions::PDFVersion_X1a ||
-				pdfOptions.Version == PDFOptions::PDFVersion_X3 ||
-				pdfOptions.Version == PDFOptions::PDFVersion_X4)
+			if (pdfOptions.Version == PDFVersion::PDF_X1a ||
+				pdfOptions.Version == PDFVersion::PDF_X3 ||
+				pdfOptions.Version == PDFVersion::PDF_X4)
 			{
 				ScColorProfile profile;
 				profile = ScCore->defaultEngine.openProfileFromFile(ScCore->PrinterProfiles[pdfOptions.PrintProf]);

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/objpdffile.cpp	Tue Mar 31 11:39:59 2020
@@ -1269,13 +1269,13 @@
 		pdfOptions.Bookmarks = false;
 
 // get PDF version
-	self->version = minmaxi(self->version, PDFOptions::PDFVersion_Min, PDFOptions::PDFVersion_Max);
-	pdfOptions.Version = (PDFOptions::PDFVersion) self->version;
+	self->version = minmaxi(self->version, PDFVersion::PDFVersion_Min, PDFVersion::PDFVersion_Max);
+	pdfOptions.Version = (PDFVersion::Version) self->version;
 
 // apply fonts attribute
 	pdfOptions.EmbedList.clear();
 	int n = PyList_Size(self->fonts);
-	for ( int i=0; i<n; ++i)
+	for (int i = 0; i < n; ++i)
 	{
 		QString tmpFon;
 		tmpFon = QString(PyString_AsString(PyList_GetItem(self->fonts, i)));
@@ -1292,9 +1292,9 @@
 	}
 // apply font embedding mode
 	pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyInt_AsLong(self->fontEmbedding);
-	if (pdfOptions.Version == PDFOptions::PDFVersion_X1a ||
-	    pdfOptions.Version == PDFOptions::PDFVersion_X3 ||
-	    pdfOptions.Version == PDFOptions::PDFVersion_X4)
+	if (pdfOptions.Version == PDFVersion::PDF_X1a ||
+	    pdfOptions.Version == PDFVersion::PDF_X3 ||
+	    pdfOptions.Version == PDFVersion::PDF_X4)
 	{
 		pdfOptions.FontEmbedding = PDFOptions::EmbedFonts;
 	}
@@ -1421,7 +1421,7 @@
 	if (self->encrypt)
 	{
 		int Perm = -64;
-		if (pdfOptions.Version == PDFOptions::PDFVersion_14)
+		if (pdfOptions.Version == PDFVersion::PDF_14)
 			Perm &= ~0x00240000;
 		if (self->allowPrinting)
 			Perm += 4;
@@ -1456,9 +1456,9 @@
 			pdfOptions.SolidProf = PyString_AsString(self->solidpr);
 			pdfOptions.ImageProf = PyString_AsString(self->imagepr);
 			pdfOptions.PrintProf = PyString_AsString(self->printprofc);
-			if (pdfOptions.Version == PDFOptions::PDFVersion_X1a ||
-				pdfOptions.Version == PDFOptions::PDFVersion_X3 ||
-				pdfOptions.Version == PDFOptions::PDFVersion_X4)
+			if (pdfOptions.Version == PDFVersion::PDF_X1a ||
+				pdfOptions.Version == PDFVersion::PDF_X3 ||
+				pdfOptions.Version == PDFVersion::PDF_X4)
 			{
 				ScColorProfile profile;
 				profile = ScCore->defaultEngine.openProfileFromFile(ScCore->PrinterProfiles[pdfOptions.PrintProf]);

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Tue Mar 31 11:39:59 2020
@@ -437,7 +437,7 @@
 	appPrefs.pdfPrefs.embedPDF  = false;
 	appPrefs.pdfPrefs.Bookmarks = false;
 	appPrefs.pdfPrefs.PicRes = 300;
-	appPrefs.pdfPrefs.Version = PDFOptions::PDFVersion_14;
+	appPrefs.pdfPrefs.Version = PDFVersion::PDF_14;
 	appPrefs.pdfPrefs.Resolution = 300;
 	appPrefs.pdfPrefs.Binding = 0;
 	appPrefs.pdfPrefs.FontEmbedding = PDFOptions::EmbedFonts;
@@ -2556,7 +2556,7 @@
 			appPrefs.pdfPrefs.RotateDeg = dc.attribute("RotateDeg", "0").toInt();
 			appPrefs.pdfPrefs.PresentMode = static_cast<bool>(dc.attribute("PresentMode").toInt());
 			appPrefs.pdfPrefs.PicRes = dc.attribute("PicRes").toInt();
-			appPrefs.pdfPrefs.Version = (PDFOptions::PDFVersion) dc.attribute("Version").toInt();
+			appPrefs.pdfPrefs.Version = (PDFVersion::Version) dc.attribute("Version").toInt();
 			appPrefs.pdfPrefs.Resolution = dc.attribute("Resolution").toInt();
 			appPrefs.pdfPrefs.Binding = dc.attribute("Binding").toInt();
 			appPrefs.pdfPrefs.fileName = "";
@@ -2738,6 +2738,9 @@
 	checkerSettings.checkTransparency = false;
 	cp.insert(CommonStrings::PDF_1_4   , checkerSettings);
 	cp.insert(CommonStrings::PDF_1_5   , checkerSettings);
+	checkerSettings.checkFontIsOpenType = false;
+	cp.insert(CommonStrings::PDF_1_6   , checkerSettings);
+	checkerSettings.checkFontIsOpenType = true;
 	checkerSettings.checkTransparency = true;
 	checkerSettings.checkAnnotations = true;
 	checkerSettings.minResolution = 144.0;

Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp	(original)
+++ trunk/Scribus/scribus/scfonts.cpp	Tue Mar 31 11:39:59 2020
@@ -597,10 +597,7 @@
 			case ScFace::TYPE42:
 				t = ScFace(new ScFace_ttf(fam, sty, "", ts, qpsName, filename, faceIndex, features));
 				getSFontType(face, t.m_m->typeCode);
-				if (t.type() == ScFace::OTF)
-					t.subset(true);
-				else
-					t.subset(Subset);
+				t.subset(Subset);
 				break;
 			default:
 				/* catching any types not handled above to silence compiler */
@@ -840,34 +837,19 @@
 				case ScFace::SFNT:
 					t = ScFace(new ScFace_ttf(fam, sty, "", ts, qpsName, filename, faceIndex, features));
 					getSFontType(face, t.m_m->typeCode);
-					if (t.type() == ScFace::OTF) 
-					{
-						t.subset(true);
-					}
-					else
-						t.subset(Subset);
+					t.subset(Subset);
 					break;
 				case ScFace::TTCF:
 					t = ScFace(new ScFace_ttf(fam, sty, "", ts, qpsName, filename, faceIndex, features));
 					t.m_m->formatCode = ScFace::TTCF;
 					t.m_m->typeCode = ScFace::TTF;
 					getSFontType(face, t.m_m->typeCode);
-					if (t.type() == ScFace::OTF) 
-					{
-						t.subset(true);
-					}
-					else
-						t.subset(Subset);
+					t.subset(Subset);
 					break;
 				case ScFace::TYPE42:
 					t = ScFace(new ScFace_ttf(fam, sty, "", ts, qpsName, filename, faceIndex, features));
 					getSFontType(face, t.m_m->typeCode);
-					if (t.type() == ScFace::OTF) 
-					{
-						t.subset(true);
-					}
-					else
-						t.subset(Subset);
+					t.subset(Subset);
 					break;
 				default:
 				/* catching any types not handled above to silence compiler */

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Tue Mar 31 11:39:59 2020
@@ -442,7 +442,7 @@
 	Layers.addLayer( tr("Background") );
 	// FIXME: Check PDF version input
 	//TODO: Check if this is needed now we ue appPrefsData --> docPrefsData
-	pdfOptions().Version = (PDFOptions::PDFVersion)m_appPrefsData.pdfPrefs.Version;
+	pdfOptions().Version = m_appPrefsData.pdfPrefs.Version;
 
 	pdfOptions().firstUse = true;
 	docPatterns.clear();

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp	(original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp	Tue Mar 31 11:39:59 2020
@@ -167,18 +167,20 @@
 
 	if (mode == CheckDocument::checkPDF)
 	{
-		PDFOptions::PDFVersion pdfVersion = m_Doc->pdfOptions().Version;
-		if (pdfVersion == PDFOptions::PDFVersion_13)
+		PDFVersion pdfVersion = m_Doc->pdfOptions().Version;
+		if (pdfVersion == PDFVersion::PDF_13)
 			bestProfile = CommonStrings::PDF_1_3;
-		else if (pdfVersion == PDFOptions::PDFVersion_14)
+		else if (pdfVersion == PDFVersion::PDF_14)
 			bestProfile = CommonStrings::PDF_1_4;
-		else if (pdfVersion == PDFOptions::PDFVersion_15)
+		else if (pdfVersion == PDFVersion::PDF_15)
 			bestProfile = CommonStrings::PDF_1_5;
-		else if (pdfVersion == PDFOptions::PDFVersion_X1a)
+		else if (pdfVersion == PDFVersion::PDF_16)
+			bestProfile = CommonStrings::PDF_1_6;
+		else if (pdfVersion == PDFVersion::PDF_X1a)
 			bestProfile = CommonStrings::PDF_X1a;
-		else if (pdfVersion == PDFOptions::PDFVersion_X3)
+		else if (pdfVersion == PDFVersion::PDF_X3)
 			bestProfile = CommonStrings::PDF_X3;
-		else if (pdfVersion == PDFOptions::PDFVersion_X4)
+		else if (pdfVersion == PDFVersion::PDF_X4)
 			bestProfile = CommonStrings::PDF_X4;
 	}
 	else if (mode == CheckDocument::checkEPS)

Modified: trunk/Scribus/scribus/ui/pdfexportdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/pdfexportdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfexportdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/pdfexportdialog.cpp	Tue Mar 31 11:39:59 2020
@@ -126,7 +126,7 @@
 	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
 	Layout7->addWidget( cancelButton );
 	PDFExportLayout->addLayout( Layout7 );
-	if ((m_opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty()))
+	if ((m_opts.Version == PDFVersion::PDF_X3) && (Options->InfoString->text().isEmpty()))
 		okButton->setEnabled(false);
 	resize(sizeHint());
 //	setMaximumSize( sizeHint() );
@@ -336,7 +336,7 @@
 	if (Options->Encry->isChecked())
 	{
 		int Perm = -64;
-		if (Options->PDFVersionCombo->currentIndex() == 1)
+		if (Options->PDFVersionCombo->version() == PDFVersion::PDF_14)
 			Perm &= ~0x00240000;
 		if (Options->PrintSec->isChecked())
 			Perm += 4;
@@ -350,18 +350,7 @@
 		m_opts.PassOwner = Options->PassOwner->text();
 		m_opts.PassUser = Options->PassUser->text();
 	}
-	if (Options->PDFVersionCombo->currentIndex() == 0)
-		m_opts.Version = PDFOptions::PDFVersion_13;
-	if (Options->PDFVersionCombo->currentIndex() == 1)
-		m_opts.Version = PDFOptions::PDFVersion_14;
-	if (Options->PDFVersionCombo->currentIndex() == 2)
-		m_opts.Version = PDFOptions::PDFVersion_15;
-	if (Options->PDFVersionCombo->currentIndex() == 3)
-		m_opts.Version = PDFOptions::PDFVersion_X1a;
-	if (Options->PDFVersionCombo->currentIndex() == 4)
-		m_opts.Version = PDFOptions::PDFVersion_X3;
-	if (Options->PDFVersionCombo->currentIndex() == 5)
-		m_opts.Version = PDFOptions::PDFVersion_X4;
+	m_opts.Version = Options->PDFVersionCombo->version();
 	if (Options->OutCombo->currentIndex() == 0)
 	{
 		m_opts.UseRGB = true;
@@ -386,7 +375,7 @@
 			{
 				m_opts.UseProfiles = Options->EmbedProfs->isChecked();
 				m_opts.UseProfiles2 = Options->EmbedProfs2->isChecked();
-				if (m_opts.Version != PDFOptions::PDFVersion_X1a)
+				if (m_opts.Version != PDFVersion::PDF_X1a)
 				{
 					m_opts.Intent = Options->IntendS->currentIndex();
 					m_opts.Intent2 = Options->IntendI->currentIndex();
@@ -395,7 +384,7 @@
 					m_opts.ImageProf = Options->ImageP->currentText();
 				}
 				m_opts.PrintProf = Options->PrintProfC->currentText();
-				if ((m_opts.Version == PDFOptions::PDFVersion_X3) || (m_opts.Version == PDFOptions::PDFVersion_X1a) || (m_opts.Version == PDFOptions::PDFVersion_X4))
+				if ((m_opts.Version == PDFVersion::PDF_X3) || (m_opts.Version == PDFVersion::PDF_X1a) || (m_opts.Version == PDFVersion::PDF_X4))
 				{
 					ScColorProfile hIn = m_doc->colorEngine.openProfileFromFile( m_printerProfiles[m_opts.PrintProf] );
 					m_cmsDescriptor = hIn.productDescription();

Modified: trunk/Scribus/scribus/ui/pdfversioncombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/pdfversioncombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversioncombo.cpp	(original)
+++ trunk/Scribus/scribus/ui/pdfversioncombo.cpp	Tue Mar 31 11:39:59 2020
@@ -26,40 +26,44 @@
 	}
 }
 
-PDFOptions::PDFVersion PdfVersionCombo::version() const
+PDFVersion PdfVersionCombo::version() const
 {
 	int curIndex = currentIndex();
 
 	if (curIndex == PdfVersionModel::ItemPDF_13)
-		return PDFOptions::PDFVersion_13;
+		return PDFVersion::PDF_13;
 	if (curIndex == PdfVersionModel::ItemPDF_14)
-		return PDFOptions::PDFVersion_14;
+		return PDFVersion::PDF_14;
 	if (curIndex == PdfVersionModel::ItemPDF_15)
-		return PDFOptions::PDFVersion_15;
+		return PDFVersion::PDF_15;
+	if (curIndex == PdfVersionModel::ItemPDF_16)
+		return PDFVersion::PDF_16;
 	if (curIndex == PdfVersionModel::ItemPDFX_1a)
-		return PDFOptions::PDFVersion_X1a;
+		return PDFVersion::PDF_X1a;
 	if (curIndex == PdfVersionModel::ItemPDFX_3)
-		return PDFOptions::PDFVersion_X3;
+		return PDFVersion::PDF_X3;
 	if (curIndex == PdfVersionModel::ItemPDFX_4)
-		return PDFOptions::PDFVersion_X4;
-	return PDFOptions::PDFVersion_14;
+		return PDFVersion::PDF_X4;
+	return PDFVersion::PDF_14;
 }
 
-bool PdfVersionCombo::versionIs(PDFOptions::PDFVersion version) const
+bool PdfVersionCombo::versionIs(const PDFVersion& version) const
 {
 	int curIndex = currentIndex();
 
-	if (version == PDFOptions::PDFVersion_13)
+	if (version == PDFVersion::PDF_13)
 		return (curIndex == PdfVersionModel::ItemPDF_13);
-	if (version == PDFOptions::PDFVersion_14)
+	if (version == PDFVersion::PDF_14)
 		return (curIndex == PdfVersionModel::ItemPDF_14);
-	if (version == PDFOptions::PDFVersion_15)
+	if (version == PDFVersion::PDF_15)
 		return (curIndex == PdfVersionModel::ItemPDF_15);
-	if (version == PDFOptions::PDFVersion_X1a)
+	if (version == PDFVersion::PDF_16)
+		return (curIndex == PdfVersionModel::ItemPDF_16);
+	if (version == PDFVersion::PDF_X1a)
 		return (curIndex == PdfVersionModel::ItemPDFX_1a);
-	if (version == PDFOptions::PDFVersion_X3)
+	if (version == PDFVersion::PDF_X3)
 		return (curIndex == PdfVersionModel::ItemPDFX_3);
-	if (version == PDFOptions::PDFVersion_X4)
+	if (version == PDFVersion::PDF_X4)
 		return (curIndex == PdfVersionModel::ItemPDFX_4);
 	return false;
 }
@@ -76,35 +80,37 @@
 	return false;
 }
 
-void PdfVersionCombo::setVersion(PDFOptions::PDFVersion version)
+void PdfVersionCombo::setVersion(const PDFVersion& version)
 {
-	if ((version == PDFOptions::PDFVersion_X1a) && !m_isPdfXEnabled)
+	if ((version == PDFVersion::PDF_X1a) && !m_isPdfXEnabled)
 	{
 		setCurrentIndex(PdfVersionModel::ItemPDF_13);
 		return;
 	}
-	if ((version == PDFOptions::PDFVersion_X3) && !m_isPdfXEnabled)
+	if ((version == PDFVersion::PDF_X3) && !m_isPdfXEnabled)
 	{
 		setCurrentIndex(PdfVersionModel::ItemPDF_13);
 		return;
 	}
-	if ((version == PDFOptions::PDFVersion_X4) && !m_isPdfXEnabled)
+	if ((version == PDFVersion::PDF_X4) && !m_isPdfXEnabled)
 	{
 		setCurrentIndex(PdfVersionModel::ItemPDF_15);
 		return;
 	}
 	
-	if (version == PDFOptions::PDFVersion_13)
+	if (version == PDFVersion::PDF_13)
 		setCurrentIndex(PdfVersionModel::ItemPDF_13);
-	else if (version == PDFOptions::PDFVersion_14)
+	else if (version == PDFVersion::PDF_14)
 		setCurrentIndex(PdfVersionModel::ItemPDF_14);
-	else if  (version == PDFOptions::PDFVersion_15)
+	else if  (version == PDFVersion::PDF_15)
 		setCurrentIndex(PdfVersionModel::ItemPDF_15);
-	else if  (version == PDFOptions::PDFVersion_X1a)
+	else if  (version == PDFVersion::PDF_16)
+		setCurrentIndex(PdfVersionModel::ItemPDF_16);
+	else if  (version == PDFVersion::PDF_X1a)
 		setCurrentIndex(PdfVersionModel::ItemPDFX_1a);
-	else if  (version == PDFOptions::PDFVersion_X3)
+	else if  (version == PDFVersion::PDF_X3)
 		setCurrentIndex(PdfVersionModel::ItemPDFX_3);
-	else if  (version == PDFOptions::PDFVersion_X4)
+	else if  (version == PDFVersion::PDF_X4)
 		setCurrentIndex(PdfVersionModel::ItemPDFX_4);
 }
 
@@ -114,14 +120,14 @@
 		return;
 	m_isPdfXEnabled = enabled;
 	
-	PDFOptions::PDFVersion oldVersion = version();
+	PDFVersion oldVersion = version();
 	if (!enabled)
 	{
-		if ((oldVersion == PDFOptions::PDFVersion_X1a) && !enabled) 
+		if ((oldVersion == PDFVersion::PDF_X1a) && !enabled) 
 			setCurrentIndex((int) PdfVersionModel::ItemPDF_13);
-		if ((oldVersion == PDFOptions::PDFVersion_X3) && !enabled) 
+		if ((oldVersion == PDFVersion::PDF_X3) && !enabled) 
 			setCurrentIndex((int) PdfVersionModel::ItemPDF_13);
-		if ((oldVersion == PDFOptions::PDFVersion_X4) && !enabled) 
+		if ((oldVersion == PDFVersion::PDF_X4) && !enabled) 
 			setCurrentIndex((int) PdfVersionModel::ItemPDF_15);
 	}
 	m_pdfVersionModel->setPdfXEnabled(enabled);

Modified: trunk/Scribus/scribus/ui/pdfversioncombo.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/pdfversioncombo.h
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversioncombo.h	(original)
+++ trunk/Scribus/scribus/ui/pdfversioncombo.h	Tue Mar 31 11:39:59 2020
@@ -11,6 +11,7 @@
 
 #include "scribusapi.h"
 #include "pdfoptions.h"
+#include "pdfversion.h"
 
 class PdfVersionModel;
 
@@ -26,12 +27,12 @@
 	PdfVersionCombo(QWidget* parent=0);
 	~PdfVersionCombo();
 
-	PDFOptions::PDFVersion version() const;
+	PDFVersion version() const;
 
-	bool versionIs(PDFOptions::PDFVersion version) const;
+	bool versionIs(const PDFVersion& version) const;
 	bool versionIsPDFX() const;
 
-	void setVersion(PDFOptions::PDFVersion version);
+	void setVersion(const PDFVersion& version);
 	void setPDFXEnabled(bool enabled);
 	
 private:

Modified: trunk/Scribus/scribus/ui/pdfversionmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/pdfversionmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversionmodel.cpp	(original)
+++ trunk/Scribus/scribus/ui/pdfversionmodel.cpp	Tue Mar 31 11:39:59 2020
@@ -14,7 +14,7 @@
 	          : QAbstractItemModel(parent)
 {
 	
-	m_enabledVec << true << true << true << false << false << false;
+	m_enabledVec << true << true << true << true << false << false << false;
 }
 
 void PdfVersionModel::clear()
@@ -45,6 +45,8 @@
 			return tr("PDF 1.4 (Acrobat 5)");
 		if (row == ItemPDF_15)
 			return tr("PDF 1.5 (Acrobat 6)");
+		if (row == ItemPDF_16)
+			return tr("PDF 1.6 (Acrobat 7)");
 		if (row == ItemPDFX_1a)
 			return tr("PDF/X-1a");
 		if (row == ItemPDFX_3)

Modified: trunk/Scribus/scribus/ui/pdfversionmodel.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/pdfversionmodel.h
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversionmodel.h	(original)
+++ trunk/Scribus/scribus/ui/pdfversionmodel.h	Tue Mar 31 11:39:59 2020
@@ -27,9 +27,10 @@
 		ItemPDF_13 = 0,
 		ItemPDF_14 = 1,
 		ItemPDF_15 = 2,
-		ItemPDFX_1a = 3,
-		ItemPDFX_3  = 4,
-		ItemPDFX_4  = 5
+		ItemPDF_16 = 3,
+		ItemPDFX_1a = 4,
+		ItemPDFX_3  = 5,
+		ItemPDFX_4  = 6
 	};
 
 	//! Remove all colors from list;

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.cpp	Tue Mar 31 11:39:59 2020
@@ -257,7 +257,7 @@
 {
 	exportingPDF=exporting;
 	enablePDFExportTabs(exportingPDF);
-	AllFonts=prefsData->fontPrefs.AvailFonts;
+	AllFonts = prefsData->fontPrefs.AvailFonts;
 	int unitIndex = prefsData->docSetupPrefs.docUnitIndex;
 	unitRatio = unitGetRatioFromIndex(unitIndex);
 	unitChange(unitIndex);
@@ -272,14 +272,14 @@
 	clipToPrinterMarginsCheckBox->setChecked(prefsData->pdfPrefs.doClip);
 	bool cmsUse = m_doc ? (ScCore->haveCMS() && m_doc->HasCMS) : false;
 	if (!cmsUse)
-		pdfVersionComboBox->setVersion(PDFOptions::PDFVersion_14);
+		pdfVersionComboBox->setVersion(PDFVersion::PDF_14);
 	pdfVersionComboBox->setVersion(prefsData->pdfPrefs.Version);
 	pageBindingComboBox->setCurrentIndex(prefsData->pdfPrefs.Binding);
 	generateThumbnailsCheckBox->setChecked(prefsData->pdfPrefs.Thumbnails);
 	saveLinkedTextFramesAsArticlesCheckBox->setChecked(prefsData->pdfPrefs.Articles);
 	includeBookmarksCheckBox->setChecked(prefsData->pdfPrefs.Bookmarks);
 	includeLayersCheckBox->setChecked(prefsData->pdfPrefs.useLayers);
-	includeLayersCheckBox->setEnabled(prefsData->pdfPrefs.Version == PDFOptions::PDFVersion_15 || prefsData->pdfPrefs.Version == PDFOptions::PDFVersion_X4);
+	includeLayersCheckBox->setEnabled(prefsData->pdfPrefs.Version.supportsOCGs());
 
 	epsExportResolutionSpinBox->setValue(prefsData->pdfPrefs.Resolution);
 	embedPDFAndEPSFilesCheckBox->setChecked(prefsData->pdfPrefs.embedPDF);
@@ -354,7 +354,8 @@
 			for (int fe = 0; fe < docFonts.count(); ++ fe)
 			{
 				const QString& fontName = docFonts.at(fe);
-				if (Opts.EmbedList.contains(fontName))
+				const ScFace fontFace = AllFonts[fontName];
+				if (Opts.EmbedList.contains(fontName) && (!fontFace.isOTF() || Opts.supportsEmbeddedOpenTypeFonts()) && !fontFace.subset())
 					addFontItem(fontName, embeddedFontsListWidget);
 				else
 				{
@@ -418,10 +419,7 @@
 			facingPagesLeftRadioButton->setChecked(true);
 		else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
 			facingPagesRightRadioButton->setChecked(true);
-		if ((Opts.Version == PDFOptions::PDFVersion_15) || (Opts.Version == PDFOptions::PDFVersion_X4))
-			useLayersRadioButton->setEnabled(true);
-		else
-			useLayersRadioButton->setEnabled(false);
+		useLayersRadioButton->setEnabled(Opts.Version.supportsOCGs());
 	}
 
 	useEncryptionCheckBox->setChecked( prefsData->pdfPrefs.Encrypt );
@@ -568,11 +566,11 @@
 	printPageInfoCheckBox->setChecked(prefsData->pdfPrefs.docInfoMarks);
 	if (!cmsUse)
 		enablePDFXWidgets(false);
-	if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X1a) && (!PDFXProfiles.isEmpty()))
+	if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty()))
 		enablePDFX(3);
-	else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X3) && (!PDFXProfiles.isEmpty()))
+	else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty()))
 		enablePDFX(4);
-	else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X4) && (!PDFXProfiles.isEmpty()))
+	else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty()))
 		enablePDFX(5);
 	else
 		enablePDFXWidgets(false);
@@ -587,7 +585,7 @@
 		effectTypeComboBox->addItem( tr("Glitter"));
 		effectTypeComboBox->addItem( tr("Split"));
 		effectTypeComboBox->addItem( tr("Wipe"));
-		if (Opts.Version == PDFOptions::PDFVersion_15)
+		if (Opts.Version.supportsPDF15PresentationEffects())
 		{
 			effectTypeComboBox->addItem( tr("Push"));
 			effectTypeComboBox->addItem( tr("Cover"));
@@ -697,7 +695,7 @@
 	if (useEncryptionCheckBox->isChecked())
 	{
 		int Perm = -64;
-		if (pdfVersionComboBox->currentIndex() == 1)
+		if (pdfVersionComboBox->version() == PDFVersion::PDF_14)
 			Perm &= ~0x00240000;
 		if (allowPrintingCheckBox->isChecked())
 			Perm += 4;
@@ -828,7 +826,7 @@
 {
 	enableLPI(i);
 	bool setter = false;
-	if (i == 1 && (!pdfVersionComboBox->versionIs(PDFOptions::PDFVersion_X1a)))
+	if (i == 1 && (!pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a)))
 		setter = true;
 	enableSolidsImagesWidgets(setter);
 }
@@ -990,11 +988,14 @@
 	solidColorRenderingIntentComboBox->setEnabled(setter);
 }
 
-void Prefs_PDFExport::enablePDFX(int i)
-{
-	includeLayersCheckBox->setEnabled((i == 2) || (i == 5));
+void Prefs_PDFExport::enablePDFX(int)
+{
+	PDFVersion pdfVer = pdfVersionComboBox->version();
+
+	includeLayersCheckBox->setEnabled(pdfVer.supportsOCGs());
 	if (useLayersRadioButton)
-		useLayersRadioButton->setEnabled((i == 2) || (i == 5));
+		useLayersRadioButton->setEnabled(pdfVer.supportsOCGs());
+
 	if (m_doc != nullptr && exportingPDF)
 	{
 		int currentEff = effectTypeComboBox->currentIndex();
@@ -1007,7 +1008,7 @@
 		effectTypeComboBox->addItem( tr("Glitter"));
 		effectTypeComboBox->addItem( tr("Split"));
 		effectTypeComboBox->addItem( tr("Wipe"));
-		if (i == 2)
+		if (pdfVer.supportsPDF15PresentationEffects())
 		{
 			effectTypeComboBox->addItem( tr("Push"));
 			effectTypeComboBox->addItem( tr("Cover"));
@@ -1034,8 +1035,9 @@
 		connect(effectTypeComboBox, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
 	}
 
-	if (i < 3)  // not PDF/X
-	{
+	if (!pdfVer.isPDFX())  // not PDF/X
+	{
+		checkEmbeddableFonts();
 		fontEmbeddingCombo->setNoEmbeddingEnabled(true);
 		enablePDFXWidgets(false);
 		tabWidget->setTabEnabled(2, true);
@@ -1055,7 +1057,7 @@
 	outputIntentionComboBox->setCurrentIndex(1);
 	outputIntentionComboBox->setEnabled(false);
 	enableProfiles(1);
-	if ((i == 4) || (i == 5)) // X3 or X4, enforcing color profiles on images
+	if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images
 	{
 		useImageProfileCheckBox->setChecked(true);
 		useImageProfileCheckBox->setEnabled(false);
@@ -1098,10 +1100,10 @@
 void Prefs_PDFExport::addPDFVersions(bool addPDFXStrings)
 {
 	disconnect(pdfVersionComboBox, SIGNAL(activated(int)), this, SLOT(enablePDFX(int)));
-	PDFOptions::PDFVersion currVersion = pdfVersionComboBox->version();
+	PDFVersion currVersion = pdfVersionComboBox->version();
 	pdfVersionComboBox->setPDFXEnabled(addPDFXStrings);
 	if (!addPDFXStrings)
-		currVersion = qMax(PDFOptions::PDFVersion_13, qMin(currVersion, PDFOptions::PDFVersion_15));
+		currVersion = qMax(PDFVersion::PDF_13, qMin((PDFVersion::Version) currVersion, PDFVersion::PDF_16));
 	pdfVersionComboBox->setVersion(currVersion);
 	connect(pdfVersionComboBox, SIGNAL(activated(int)), this, SLOT(enablePDFX(int)));
 }
@@ -1127,6 +1129,8 @@
 
 void Prefs_PDFExport::EmbedAll()
 {
+	PDFVersion pdfVer = pdfVersionComboBox->version();
+
 	embeddedFontsListWidget->clear();
 	subsettedFontsListWidget->clear();
 	toSubsetButton->setEnabled(false);
@@ -1136,10 +1140,11 @@
 	if (m_doc)
 		docFonts = m_doc->usedFonts().keys();
 
-	for (int a=0; a < docFonts.count(); ++a)
-	{
-		const QString& fontName = docFonts.at(a);
-		if (!AllFonts[fontName].subset())
+	for (int i = 0; i < docFonts.count(); ++i)
+	{
+		const QString& fontName = docFonts.at(i);
+		const ScFace fontFace = AllFonts[fontName];
+		if (!fontFace.subset() && (!fontFace.isOTF() || pdfVer.supportsEmbeddedOpenTypeFonts()))
 		{
 			QListWidgetItem* item = addFontItem(fontName, embeddedFontsListWidget);
 			if (AnnotationFonts.contains(item->text()))
@@ -1186,6 +1191,26 @@
 void Prefs_PDFExport::OutlineAll()
 {
 	// Nothing to do at this point
+}
+
+void Prefs_PDFExport::checkEmbeddableFonts()
+{
+	PDFVersion pdfVer = pdfVersionComboBox->version();
+
+	for (int i = 0; i < embeddedFontsListWidget->count(); ++i)
+	{
+		QListWidgetItem* item = embeddedFontsListWidget->item(i);
+		QString fontName = item->text();
+		if (AnnotationFonts.contains(fontName))
+			continue;
+		const ScFace fontFace = AllFonts[fontName];
+		if (fontFace.isOTF() && !pdfVer.supportsEmbeddedOpenTypeFonts())
+		{
+			delete embeddedFontsListWidget->takeItem(i);
+			addFontItem(fontName, subsettedFontsListWidget);
+			--i;
+		}
+	}
 }
 
 void Prefs_PDFExport::doDocBleeds()
@@ -1349,38 +1374,47 @@
 
 void Prefs_PDFExport::RemoveSubset()
 {
-	QString currentFont = subsettedFontsListWidget->currentItem()->text();
-	const ScFace fontFace = AllFonts[currentFont];
-	if ((fontFace.type() != ScFace::OTF) && (!fontFace.subset()))
-	{
-		embeddedFontsListWidget->addItem(currentFont);
-		delete subsettedFontsListWidget->takeItem(subsettedFontsListWidget->currentRow());
-	}
+	PDFVersion pdfVer = pdfVersionComboBox->version();
+
+	QList<QListWidgetItem*> selection = subsettedFontsListWidget->selectedItems();
+	for (int i = 0; i < selection.count() ; ++i)
+	{
+		QListWidgetItem* fontItem = selection[i];
+		QString currentFont = fontItem->text();
+		const ScFace fontFace = AllFonts[currentFont];
+		if (fontFace.isOTF() && !pdfVer.supportsEmbeddedOpenTypeFonts())
+			continue;
+		if (fontFace.subset())
+			continue;
+		addFontItem(currentFont, embeddedFontsListWidget);
+		int currentRow = subsettedFontsListWidget->row(fontItem);
+		delete subsettedFontsListWidget->takeItem(currentRow);
+	}
+
 	subsettedFontsListWidget->clearSelection();
-	if (subsettedFontsListWidget->count() == 0)
-		fromSubsetButton->setEnabled(false);
+	fromSubsetButton->setEnabled(false);
 }
 
 void Prefs_PDFExport::PutToSubset()
 {
-	QString currentFont = embeddedFontsListWidget->currentItem()->text();
-	if (subsettedFontsListWidget->count() != 0)
-	{
-		if (subsettedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
+	QList<QListWidgetItem*> selection = embeddedFontsListWidget->selectedItems();
+	for (int i = 0; i < selection.count() ; ++i)
+	{
+		QListWidgetItem* fontItem = selection[i];
+		QString currentFont = fontItem->text();
+		if (subsettedFontsListWidget->count() != 0)
+		{
+			if (subsettedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
+				addFontItem(currentFont, subsettedFontsListWidget);
+		}
+		else
+		{
 			addFontItem(currentFont, subsettedFontsListWidget);
-	}
-	else
-	{
-		addFontItem(currentFont, subsettedFontsListWidget);
-	}
-	delete embeddedFontsListWidget->takeItem(embeddedFontsListWidget->currentRow());
+		}
+		int itemRow = embeddedFontsListWidget->row(fontItem);
+		delete embeddedFontsListWidget->takeItem(itemRow);
+	}
+
 	embeddedFontsListWidget->clearSelection();
-	if (embeddedFontsListWidget->count() == 0)
-	{
-		toSubsetButton->setEnabled(false);
-	}
-	else if (!(embeddedFontsListWidget->currentItem()->flags() & Qt::ItemIsSelectable))
-	{
-		toSubsetButton->setEnabled(false);
-	}
-}
+	toSubsetButton->setEnabled(false);
+}

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.h	Tue Mar 31 11:39:59 2020
@@ -72,6 +72,7 @@
 
 	protected:
 		QListWidgetItem* addFontItem(const QString& fontName, QListWidget* fontList);
+		void checkEmbeddableFonts();
 		void setCustomRenderingWidgetsShown(bool);
 		void setSolidsImagesWidgetsShown(bool);
 		void enableCustomRenderingWidgets(bool);

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp	(original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp	Tue Mar 31 11:39:59 2020
@@ -347,17 +347,14 @@
 	ClipMarg->setChecked(Opts.doClip);
 	bool cmsUse = (ScCore->haveCMS() && m_Doc->HasCMS);
 	if (!cmsUse)
-		PDFVersionCombo->setVersion(PDFOptions::PDFVersion_14);
+		PDFVersionCombo->setVersion(PDFVersion::PDF_14);
 	PDFVersionCombo->setVersion(Opts.Version);
 	ComboBind->setCurrentIndex(Opts.Binding);
 	CheckBox1->setChecked(Opts.Thumbnails);
 	Article->setChecked(Opts.Articles);
 	CheckBM->setChecked(Opts.Bookmarks);
 	useLayers->setChecked(Opts.useLayers);
-	if (Opts.Version == PDFOptions::PDFVersion_15 || Opts.Version == PDFOptions::PDFVersion_X4)
-		useLayers->setEnabled(true);
-	else
-		useLayers->setEnabled(false);
+	useLayers->setEnabled(Opts.Version.supportsOCGs());
 	Resolution->setValue(Opts.Resolution);
 	EmbedPDF->setChecked(Opts.embedPDF);
 	Compression->setChecked( Opts.Compress );
@@ -370,9 +367,9 @@
 	ValC->setEnabled(DSColor->isChecked());
 
 	m_docFonts = DocFonts.keys();
-	if (Opts.Version == PDFOptions::PDFVersion_X1a ||
-		Opts.Version == PDFOptions::PDFVersion_X3  ||
-		Opts.Version == PDFOptions::PDFVersion_X4 )
+	if (Opts.Version == PDFVersion::PDF_X1a ||
+		Opts.Version == PDFVersion::PDF_X3  ||
+		Opts.Version == PDFVersion::PDF_X4 )
 	{
 		if (Opts.FontEmbedding != PDFOptions::EmbedFonts &&
 			Opts.FontEmbedding != PDFOptions::OutlineFonts)
@@ -467,7 +464,7 @@
 		{
 			QString fontName = m_docFonts.at(fe);
 			const ScFace fontFace = AllFonts[fontName];
-			if (Opts.EmbedList.contains(fontName) && (!fontFace.isOTF()))
+			if (Opts.EmbedList.contains(fontName) && (!fontFace.isOTF() || Opts.supportsEmbeddedOpenTypeFonts()) && !fontFace.subset())
 				addFontItem(fontName, EmbedList);
 			else
 			{
@@ -531,10 +528,7 @@
 		facingPagesLeft->setChecked(true);
 	else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
 		facingPagesRight->setChecked(true);
-	if ((Opts.Version == PDFOptions::PDFVersion_15) || (Opts.Version == PDFOptions::PDFVersion_X4))
-		useLayers2->setEnabled(true);
-	else
-		useLayers2->setEnabled(false);
+	useLayers2->setEnabled(Opts.Version.supportsOCGs());
 
 	Encry->setChecked( Opts.Encrypt );
 	PassOwner->setText(Opts.PassOwner);
@@ -657,11 +651,11 @@
 	docInfoMarks->setChecked(Opts.docInfoMarks);
 	if (!cmsUse)
 		X3Group->setEnabled(false);
-	if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X1a) && (!PDFXProfiles.isEmpty()))
+	if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty()))
 		EnablePDFX(3);
-	else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X3) && (!PDFXProfiles.isEmpty()))
+	else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty()))
 		EnablePDFX(4);
-	else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X4) && (!PDFXProfiles.isEmpty()))
+	else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty()))
 		EnablePDFX(5);
 	else
 		X3Group->setEnabled(false);
@@ -674,7 +668,7 @@
 	EffectType->addItem( tr("Glitter"));
 	EffectType->addItem( tr("Split"));
 	EffectType->addItem( tr("Wipe"));
-	if (Opts.Version == PDFOptions::PDFVersion_15)
+	if (Opts.Version.supportsPDF15PresentationEffects())
 	{
 		EffectType->addItem( tr("Push"));
 		EffectType->addItem( tr("Cover"));
@@ -747,7 +741,7 @@
 	if (Encry->isChecked())
 	{
 		int Perm = -64;
-		if (PDFVersionCombo->currentIndex() == 1)
+		if (PDFVersionCombo->version() == PDFVersion::PDF_14)
 			Perm &= ~0x00240000;
 		if (PrintSec->isChecked())
 			Perm += 4;
@@ -845,20 +839,22 @@
 void TabPDFOptions::enableCMS(bool enable)
 {
 	QSignalBlocker blocker(PDFVersionCombo);
-	PDFOptions::PDFVersion currVersion = PDFVersionCombo->version();
+	PDFVersion currVersion = PDFVersionCombo->version();
 	PDFVersionCombo->setPDFXEnabled(enable);
 	cms = enable;
 	if (!enable)
-		currVersion = qMax(PDFOptions::PDFVersion_13, qMin(currVersion, PDFOptions::PDFVersion_15));
+		currVersion = qMax(PDFVersion::PDF_13, qMin((PDFVersion::Version) currVersion, PDFVersion::PDF_16));
 	PDFVersionCombo->setVersion(currVersion);
 	EnablePr(1);
 }
 
-void TabPDFOptions::EnablePDFX(int a)
-{
-	useLayers->setEnabled((a == 2) || (a == 5));
+void TabPDFOptions::EnablePDFX(int /*a*/)
+{
+	PDFVersion pdfVer = PDFVersionCombo->version();
+
+	useLayers->setEnabled(pdfVer.supportsOCGs());
 	if (useLayers2)
-		useLayers2->setEnabled((a == 2) || (a == 5));
+		useLayers2->setEnabled(pdfVer.supportsOCGs());
 
 	int currentEff = EffectType->currentIndex();
 	disconnect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
@@ -870,7 +866,7 @@
 	EffectType->addItem( tr("Glitter"));
 	EffectType->addItem( tr("Split"));
 	EffectType->addItem( tr("Wipe"));
-	if (a == 2)
+	if (pdfVer.supportsPDF15PresentationEffects())
 	{
 		EffectType->addItem( tr("Push"));
 		EffectType->addItem( tr("Cover"));
@@ -896,8 +892,9 @@
 	}
 	connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
 
-	if (a < 3)  // not PDF/X
-	{
+	if (!pdfVer.isPDFX())  // not PDF/X
+	{
+		checkEmbeddableFonts();
 		fontEmbeddingCombo->setNoEmbeddingEnabled(true);
 		X3Group->setEnabled(false);
 		setTabEnabled(indexOf(tabSecurity), true);
@@ -911,19 +908,20 @@
 		EnablePr(OutCombo->currentIndex());
 		return;
 	}
+
 	// PDF/X is selected
 	disconnect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
 	OutCombo->setCurrentIndex(1);
 	OutCombo->setEnabled(false);
 	EnablePr(1);
-	if (a == 3) // X1, no profile embedding
+	if (pdfVer == PDFVersion::PDF_X1a) // X1, no profile embedding
 	{
 		EmbedProfs->setChecked(false);
 		EmbedProfs->setEnabled(false);
 		EmbedProfs2->setChecked(false);
 		EmbedProfs2->setEnabled(false);
 	}
-	if ((a == 4) || (a == 5)) // X3 or X4, enforcing color profiles on images
+	if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images
 	{
 		EmbedProfs->setEnabled(true);
 		EmbedProfs2->setChecked(true);
@@ -1003,7 +1001,7 @@
 	EnableLPI(a);
 	bool setter = false;
 	if (a == 1)
-		setter = !PDFVersionCombo->versionIs(PDFOptions::PDFVersion_X1a);
+		setter = !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a);
 
 	solidsProfileGroup->setEnabled(setter);
 	imageProfileGroup->setEnabled(setter);
@@ -1295,13 +1293,17 @@
 
 void TabPDFOptions::RemoveSubset()
 {
+	PDFVersion pdfVer = PDFVersionCombo->version();
+
 	QList<QListWidgetItem*> selection = SubsetList->selectedItems();
 	for (int i = 0; i < selection.count() ; ++i)
 	{
 		QListWidgetItem* fontItem = selection[i];
 		QString currentFont = fontItem->text();
 		const ScFace fontFace = AllFonts[currentFont];
-		if (fontFace.isOTF() || fontFace.subset())
+		if (fontFace.isOTF() && !pdfVer.supportsEmbeddedOpenTypeFonts())
+			continue;
+		if (fontFace.subset())
 			continue;
 		addFontItem(currentFont, EmbedList);
 		int currentRow = SubsetList->row(fontItem);
@@ -1348,6 +1350,7 @@
 
 void TabPDFOptions::SelSFont(QListWidgetItem*)
 {
+	PDFVersion pdfVer = PDFVersionCombo->version();
 	QList<QListWidgetItem*> selection = SubsetList->selectedItems();
 	int enabledForEmbedding = selection.count();
 
@@ -1355,7 +1358,9 @@
 	{
 		const QListWidgetItem* item = selection.at(i);
 		const ScFace face = AllFonts[item->text()];
-		if (face.isOTF() || face.subset())
+		if (face.isOTF() && !pdfVer.supportsEmbeddedOpenTypeFonts())
+			enabledForEmbedding--;
+		else if (face.subset())
 			enabledForEmbedding--;
 	}
 
@@ -1366,15 +1371,18 @@
 
 void TabPDFOptions::EmbedAll()
 {
+	PDFVersion pdfVer = PDFVersionCombo->version();
+
 	EmbedList->clear();
 	SubsetList->clear();
 	ToSubset->setEnabled(false);
 	FromSubset->setEnabled(false);
+
 	for (int i = 0; i < m_docFonts.count(); ++i)
 	{
 		QString fontName = m_docFonts.at(i);
 		const ScFace fontFace = AllFonts[fontName];
-		if (!fontFace.subset() && !fontFace.isOTF())
+		if (!fontFace.subset() && (!fontFace.isOTF() || pdfVer.supportsEmbeddedOpenTypeFonts()))
 		{
 			QListWidgetItem* item = addFontItem(fontName, EmbedList);
 			if (m_annotationFonts.contains(item->text()))
@@ -1409,6 +1417,26 @@
 		else
 		{
 			addFontItem(fontName, SubsetList);
+		}
+	}
+}
+
+void TabPDFOptions::checkEmbeddableFonts()
+{
+	PDFVersion pdfVer = PDFVersionCombo->version();
+
+	for (int i = 0; i < EmbedList->count(); ++i)
+	{
+		QListWidgetItem* item = EmbedList->item(i);
+		QString fontName = item->text();
+		if (m_annotationFonts.contains(fontName))
+			continue;
+		const ScFace fontFace = AllFonts[fontName];
+		if (fontFace.isOTF() && !pdfVer.supportsEmbeddedOpenTypeFonts())
+		{
+			delete EmbedList->takeItem(i);
+			addFontItem(fontName, SubsetList);
+			--i;
 		}
 	}
 }

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/scribus/ui/tabpdfoptions.h
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.h	(original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.h	Tue Mar 31 11:39:59 2020
@@ -113,6 +113,7 @@
 	QString SelLPIcolor;
 
 	QListWidgetItem* addFontItem(const QString& fontName, QListWidget* fontList);
+	void checkEmbeddableFonts();
 
 private:
 	// Non-GUI protected members

Modified: trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj	Tue Mar 31 11:39:59 2020
@@ -344,6 +344,7 @@
     <ClInclude Include="..\..\..\scribus\palettes\paletteloader_sk1.h" />
     <ClInclude Include="..\..\..\scribus\palettes\paletteloader_swatchbook.h" />
     <ClInclude Include="..\..\..\scribus\pdfstructs.h" />
+    <ClInclude Include="..\..\..\scribus\pdfversion.h" />
     <ClInclude Include="..\..\..\scribus\pdfwriter.h" />
     <ClInclude Include="..\..\..\scribus\sccolorstructs.h" />
     <ClInclude Include="..\..\..\scribus\styles\cellstyle.h" />
@@ -882,6 +883,7 @@
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_ps.cpp" />
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_sk1.cpp" />
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_swatchbook.cpp" />
+    <ClCompile Include="..\..\..\scribus\pdfversion.cpp" />
     <ClCompile Include="..\..\..\scribus\pdfwriter.cpp" />
     <ClCompile Include="..\..\..\scribus\qtiocompressor.cpp" />
     <ClCompile Include="..\..\..\scribus\imagedataloaders\scimgdataloader_ora.cpp" />

Modified: trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2013/scribus-main/Scribus.vcxproj.filters	Tue Mar 31 11:39:59 2020
@@ -803,6 +803,9 @@
     <ClInclude Include="..\..\..\scribus\imagedataloaders\scimgdataloader_png.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\pdfversion.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2498,6 +2501,9 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\imagedataloaders\scimgdataloader_png.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\pdfversion.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	Tue Mar 31 11:39:59 2020
@@ -344,6 +344,7 @@
     <ClInclude Include="..\..\..\scribus\palettes\paletteloader_sk1.h" />
     <ClInclude Include="..\..\..\scribus\palettes\paletteloader_swatchbook.h" />
     <ClInclude Include="..\..\..\scribus\pdfstructs.h" />
+    <ClInclude Include="..\..\..\scribus\pdfversion.h" />
     <ClInclude Include="..\..\..\scribus\pdfwriter.h" />
     <ClInclude Include="..\..\..\scribus\sccolorstructs.h" />
     <ClInclude Include="..\..\..\scribus\styles\cellstyle.h" />
@@ -882,6 +883,7 @@
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_ps.cpp" />
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_sk1.cpp" />
     <ClCompile Include="..\..\..\scribus\palettes\paletteloader_swatchbook.cpp" />
+    <ClCompile Include="..\..\..\scribus\pdfversion.cpp" />
     <ClCompile Include="..\..\..\scribus\pdfwriter.cpp" />
     <ClCompile Include="..\..\..\scribus\qtiocompressor.cpp" />
     <ClCompile Include="..\..\..\scribus\imagedataloaders\scimgdataloader_ora.cpp" />

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23548&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	Tue Mar 31 11:39:59 2020
@@ -803,6 +803,9 @@
     <ClInclude Include="..\..\..\scribus\imagedataloaders\scimgdataloader_png.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\pdfversion.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2498,6 +2501,9 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\imagedataloaders\scimgdataloader_png.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\pdfversion.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>




More information about the scribus-commit mailing list