View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017422 | Scribus | Import / Export | public | 2025-02-17 17:44 | 2025-03-30 18:50 |
Reporter | ImYoric | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Summary | 0017422: Export to PDF/X-1a:2003 would be useful | ||||
Description | My printer requires specifically PDF/X-1a:2003. Scribus does not support this format. I'll find a way to convert, but in the future, it would be great if Scribus could support export to PDF/X-1a:2003! | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
""" PDF/X-1a:2003 – such a file has to be a PDF 1.4 file but it should not contain any transparency and JBIG2 compression should not be used to compress images. """ ... Is that all? If it's the case, how hard would be to support it, since we already support 1.4 and, if i recall correctly, we already detect transparencies? |
|
May be that means, it is to be considered that Scribus manages by itself the flatening of transparencies if they exist. Other point i found it that there should be only CMYK or Spot Colors, and no profile. I guess going to read the specs would be a starting point to evaluate what’s to be done. |
|
What printer do you use? From GWG Group, see also video from GWG. https://www.youtube.com/watch?v=L9mLbX9y3es https://www.insights4print.ceo/2024/01/move-over-pdf-x-1a-stop-using-a-20-year-old-standard/ |
|
@flagsoft I'm going through DriveThruCards, I don't know which printer they use https://help.drivethrupartners.com/hc/en-us/articles/12780748203543-Specifications-for-Print-Cards#h_01HE0RZVRRBYXN1AM74Y51C1G8 |
|
of course, it would be wonderful if scribus could flatten the transparencies. but if your printer or client requires PDF/X-1a:2003 and what you have is scribus, you might already be happy that scribus can create this type of pdf, even if this means that you have to remove yourself all transparencies. i admit that i only had a look at the summary page and did not read the full specification. luckily, i think that the restrictions on the color are already in the PDF/X-1a:2001 that scribus already supports. |
|
I think adding support for PDF/X-1a:2003 would indeed require minimal change to our PDF exporter: writing %PDF-1.4 instead of %PDF-1.3 at the start of the file + a few other minor changes. Most of the required changes would in fact involve modifications to the UI. |
|
@jghali i might take some time to make the patch for the UI... i guess it's mostly about adding the string in a few places... |
|
@jghali @ale: I've attached a patch which applies against the current Version16x branch. It seems to work as far as I can tell. But I'm not sure about conformance, or whether the preflight checker settings are quite right... pdfx1a2003.patch (19,060 bytes)
diff -Nurpd a/scribus/commonstrings.cpp b/scribus/commonstrings.cpp --- a/scribus/commonstrings.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/commonstrings.cpp 2025-03-29 18:29:04.792564903 +0100 @@ -185,6 +185,7 @@ QString CommonStrings::PDF_1_4; QString CommonStrings::PDF_1_5; QString CommonStrings::PDF_1_6; QString CommonStrings::PDF_X1a; +QString CommonStrings::PDF_X1a_2003; QString CommonStrings::PDF_X3; QString CommonStrings::PDF_X4; @@ -458,8 +459,9 @@ void CommonStrings::languageChange() 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_X1a = "PDF/X-1a:2001"; + CommonStrings::PDF_X1a_2003 = "PDF/X-1a:2003"; + CommonStrings::PDF_X3 = "PDF/X-3:2002"; CommonStrings::PDF_X4 = "PDF/X-4"; CommonStrings::PostScript1 = "PostScript Level 1"; diff -Nurpd a/scribus/commonstrings.h b/scribus/commonstrings.h --- a/scribus/commonstrings.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/commonstrings.h 2025-03-29 18:29:04.792564903 +0100 @@ -261,6 +261,7 @@ public: static QString PDF_1_5; static QString PDF_1_6; static QString PDF_X1a; + static QString PDF_X1a_2003; static QString PDF_X3; static QString PDF_X4; diff -Nurpd a/scribus/pdflib_core.cpp b/scribus/pdflib_core.cpp --- a/scribus/pdflib_core.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdflib_core.cpp 2025-03-29 18:29:04.792564903 +0100 @@ -618,6 +618,8 @@ bool PDFLibCore::PDF_IsPDFX() const { if (Options.Version == PDFVersion::PDF_X1a) return true; + if (Options.Version == PDFVersion::PDF_X1a_2003) + return true; if (Options.Version == PDFVersion::PDF_X3) return true; if (Options.Version == PDFVersion::PDF_X4) @@ -629,6 +631,8 @@ bool PDFLibCore::PDF_IsPDFX(const PDFVer { if (ver == PDFVersion::PDF_X1a) return true; + if (ver == PDFVersion::PDF_X1a_2003) + return true; if (ver == PDFVersion::PDF_X3) return true; if (ver == PDFVersion::PDF_X4) @@ -1143,6 +1147,11 @@ void PDFLibCore::PDF_Begin_MetadataAndEn PutDoc("/GTS_PDFXVersion (PDF/X-1:2001)\n"); PutDoc("/GTS_PDFXConformance (PDF/X-1a:2001)\n"); } + if (Options.Version == PDFVersion::PDF_X1a_2003) + { + PutDoc("/GTS_PDFXVersion (PDF/X-1:2003)\n"); + PutDoc("/GTS_PDFXConformance (PDF/X-1a:2003)\n"); + } if (Options.Version == PDFVersion::PDF_X3) PutDoc("/GTS_PDFXVersion (PDF/X-3:2002)\n"); if (Options.Version == PDFVersion::PDF_X4) @@ -2456,7 +2465,7 @@ void PDFLibCore::PDF_Begin_Colors() Transpar[HTName] = writeGState("/HT " + Pdf::toPdf(halftones) + " 0 R\n"); ResCount++; } - if ((doc.HasCMS) && (Options.UseProfiles) && (Options.Version != PDFVersion::PDF_X1a)) + if ((doc.HasCMS) && (Options.UseProfiles) && ((Options.Version != PDFVersion::PDF_X1a) || (Options.Version != PDFVersion::PDF_X1a_2003))) { PdfId iccProfileObject = writer.newObject(); writer.startObj(iccProfileObject); @@ -11895,6 +11904,11 @@ void PDFLibCore::generateXMP(const QStri descPDFXID.setAttributeNS(pdfxidNS, "pdfx:GTS_PDFXConformance", "PDF/X-1a:2001"); descPDFXID.setAttribute("pdfx:GTS_PDFXVersion", "PDF/X-1:2001"); } + if (Options.Version == PDFVersion::PDF_X1a_2003) + { + descPDFXID.setAttributeNS(pdfxidNS, "pdfx:GTS_PDFXConformance", "PDF/X-1a:2003"); + descPDFXID.setAttribute("pdfx:GTS_PDFXVersion", "PDF/X-1:2003"); + } else if (Options.Version == PDFVersion::PDF_X3) descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-3"); else if (Options.Version == PDFVersion::PDF_X4) diff -Nurpd a/scribus/pdfoptionsio.cpp b/scribus/pdfoptionsio.cpp --- a/scribus/pdfoptionsio.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfoptionsio.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -114,6 +114,9 @@ void PDFOptionsIO::buildSettings() case PDFVersion::PDF_X1a: pdfVersString = "X1a"; break; + case PDFVersion::PDF_X1a_2003: + pdfVersString = "X1a:2003"; + break; case PDFVersion::PDF_X3: pdfVersString = "X3"; break; @@ -450,6 +453,11 @@ bool PDFOptionsIO::readPDFVersion() m_opts->Version = PDFVersion::PDF_X1a; return true; } + if (pdfVersString == "X1a:2003") + { + m_opts->Version = PDFVersion::PDF_X1a_2003; + return true; + } if (pdfVersString == "X3") { m_opts->Version = PDFVersion::PDF_X3; diff -Nurpd a/scribus/pdfversion.h b/scribus/pdfversion.h --- a/scribus/pdfversion.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfversion.h 2025-03-29 18:29:04.796564849 +0100 @@ -18,10 +18,11 @@ public: PDF_14 = 14, PDF_15 = 15, PDF_16 = 16, - PDF_X1a = 11, - PDF_X3 = 12, - PDF_X4 = 10, - PDFVersion_Min = 10, + PDF_X1a = 9, + PDF_X1a_2003 = 10, + PDF_X3 = 11, + PDF_X4 = 12, + PDFVersion_Min = 9, PDFVersion_Max = 16, }; diff -Nurpd a/scribus/pdfwriter.cpp b/scribus/pdfwriter.cpp --- a/scribus/pdfwriter.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfwriter.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -707,6 +707,7 @@ namespace Pdf case PDFVersion::PDF_13: write("%PDF-1.3\n"); break; + case PDFVersion::PDF_X1a_2003: case PDFVersion::PDF_14: write("%PDF-1.4\n"); break; diff -Nurpd a/scribus/plugins/scriptplugin/objpdffile.cpp b/scribus/plugins/scriptplugin/objpdffile.cpp --- a/scribus/plugins/scriptplugin/objpdffile.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/plugins/scriptplugin/objpdffile.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -1424,6 +1424,7 @@ static PyObject *PDFfile_save(PDFfile *s // Apply font embedding mode pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyLong_AsLong(self->fontEmbedding); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X4) { @@ -1586,6 +1587,7 @@ static PyObject *PDFfile_save(PDFfile *s pdfOptions.ImageProf = PyUnicode_asQString(self->imagepr); pdfOptions.PrintProf = PyUnicode_asQString(self->printprofc); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X4) { diff -Nurpd a/scribus/plugins/scriptplugin_py2x/objpdffile.cpp b/scribus/plugins/scriptplugin_py2x/objpdffile.cpp --- a/scribus/plugins/scriptplugin_py2x/objpdffile.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/plugins/scriptplugin_py2x/objpdffile.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -1407,6 +1407,7 @@ static PyObject *PDFfile_save(PDFfile *s // Apply font embedding mode pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyLong_AsLong(self->fontEmbedding); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X4) { @@ -1569,6 +1570,7 @@ static PyObject *PDFfile_save(PDFfile *s pdfOptions.ImageProf = PyString_AsString(self->imagepr); pdfOptions.PrintProf = PyString_AsString(self->printprofc); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X4) { diff -Nurpd a/scribus/prefsmanager.cpp b/scribus/prefsmanager.cpp --- a/scribus/prefsmanager.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/prefsmanager.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -2840,6 +2840,7 @@ void PrefsManager::initDefaultCheckerPre checkerSettings.checkNotCMYKOrSpot = true; checkerSettings.checkDeviceColorsAndOutputIntent = false; cp.insert(CommonStrings::PDF_X1a , checkerSettings); + cp.insert(CommonStrings::PDF_X1a_2003 , checkerSettings); checkerSettings.checkNotCMYKOrSpot = false; checkerSettings.checkDeviceColorsAndOutputIntent = true; checkerSettings.checkTransparency = false; diff -Nurpd a/scribus/ui/checkDocument.cpp b/scribus/ui/checkDocument.cpp --- a/scribus/ui/checkDocument.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/checkDocument.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -172,6 +172,8 @@ QString CheckDocument::bestCheckerProfil bestProfile = CommonStrings::PDF_1_6; else if (pdfVersion == PDFVersion::PDF_X1a) bestProfile = CommonStrings::PDF_X1a; + else if (pdfVersion == PDFVersion::PDF_X1a_2003) + bestProfile = CommonStrings::PDF_X1a_2003; else if (pdfVersion == PDFVersion::PDF_X3) bestProfile = CommonStrings::PDF_X3; else if (pdfVersion == PDFVersion::PDF_X4) diff -Nurpd a/scribus/ui/outputpreview_pdf.cpp b/scribus/ui/outputpreview_pdf.cpp --- a/scribus/ui/outputpreview_pdf.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/outputpreview_pdf.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -536,7 +536,7 @@ bool OutputPreview_PDF::createPreviewFil m_pdfOptions.Thumbnails = false; //Disable thumbnails too QString profileDescription; - if ((m_pdfOptions.Version == PDFVersion::PDF_X3) || (m_pdfOptions.Version == PDFVersion::PDF_X1a) || (m_pdfOptions.Version == PDFVersion::PDF_X4)) + if ((m_pdfOptions.Version == PDFVersion::PDF_X1a) || (m_pdfOptions.Version == PDFVersion::PDF_X1a_2003) || (m_pdfOptions.Version == PDFVersion::PDF_X3) || (m_pdfOptions.Version == PDFVersion::PDF_X4)) { if (m_pdfOptions.Info.isEmpty()) { @@ -1044,7 +1044,7 @@ void OutputPreview_PDF::setUiOptionsToPD } // PDF/X-1, no profile embedding - if (pdfOptions.Version == PDFVersion::PDF_X1a) + if (pdfOptions.Version == PDFVersion::PDF_X1a || pdfOptions.Version == PDFVersion::PDF_X1a_2003) { pdfOptions.UseProfiles = false; pdfOptions.UseProfiles2 = false; diff -Nurpd a/scribus/ui/pdfexportdialog.cpp b/scribus/ui/pdfexportdialog.cpp --- a/scribus/ui/pdfexportdialog.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfexportdialog.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -373,7 +373,7 @@ void PDFExportDialog::updateDocOptions() { m_opts.UseProfiles = Options->EmbedProfs->isChecked(); m_opts.UseProfiles2 = Options->EmbedProfs2->isChecked(); - if (m_opts.Version != PDFVersion::PDF_X1a) + if ((m_opts.Version != PDFVersion::PDF_X1a) || (m_opts.Version != PDFVersion::PDF_X1a_2003)) { m_opts.Intent = Options->IntendS->currentIndex(); m_opts.Intent2 = Options->IntendI->currentIndex(); @@ -382,7 +382,7 @@ void PDFExportDialog::updateDocOptions() m_opts.ImageProf = Options->ImageP->currentText(); } m_opts.PrintProf = Options->PrintProfC->currentText(); - if ((m_opts.Version == PDFVersion::PDF_X3) || (m_opts.Version == PDFVersion::PDF_X1a) || (m_opts.Version == PDFVersion::PDF_X4)) + if ((m_opts.Version == PDFVersion::PDF_X1a) || (m_opts.Version == PDFVersion::PDF_X1a_2003) || (m_opts.Version == PDFVersion::PDF_X3) || (m_opts.Version == PDFVersion::PDF_X4)) { m_opts.Info = Options->InfoString->text(); m_opts.Encrypt = false; diff -Nurpd a/scribus/ui/pdfversioncombo.cpp b/scribus/ui/pdfversioncombo.cpp --- a/scribus/ui/pdfversioncombo.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversioncombo.cpp 2025-03-29 18:29:04.796564849 +0100 @@ -40,6 +40,8 @@ PDFVersion PdfVersionCombo::version() co return PDFVersion::PDF_16; if (curIndex == PdfVersionModel::ItemPDFX_1a) return PDFVersion::PDF_X1a; + if (curIndex == PdfVersionModel::ItemPDFX_1a_2003) + return PDFVersion::PDF_X1a_2003; if (curIndex == PdfVersionModel::ItemPDFX_3) return PDFVersion::PDF_X3; if (curIndex == PdfVersionModel::ItemPDFX_4) @@ -61,6 +63,8 @@ bool PdfVersionCombo::versionIs(const PD return (curIndex == PdfVersionModel::ItemPDF_16); if (version == PDFVersion::PDF_X1a) return (curIndex == PdfVersionModel::ItemPDFX_1a); + if (version == PDFVersion::PDF_X1a_2003) + return (curIndex == PdfVersionModel::ItemPDFX_1a_2003); if (version == PDFVersion::PDF_X3) return (curIndex == PdfVersionModel::ItemPDFX_3); if (version == PDFVersion::PDF_X4) @@ -73,6 +77,8 @@ bool PdfVersionCombo::versionIsPDFX() co int curIndex = currentIndex(); if (curIndex == PdfVersionModel::ItemPDFX_1a) return true; + if (curIndex == PdfVersionModel::ItemPDFX_1a_2003) + return true; if (curIndex == PdfVersionModel::ItemPDFX_3) return true; if (curIndex == PdfVersionModel::ItemPDFX_4) @@ -87,6 +93,11 @@ void PdfVersionCombo::setVersion(const P setCurrentIndex(PdfVersionModel::ItemPDF_13); return; } + if ((version == PDFVersion::PDF_X1a_2003) && !m_isPdfXEnabled) + { + setCurrentIndex(PdfVersionModel::ItemPDF_14); + return; + } if ((version == PDFVersion::PDF_X3) && !m_isPdfXEnabled) { setCurrentIndex(PdfVersionModel::ItemPDF_13); @@ -108,6 +119,8 @@ void PdfVersionCombo::setVersion(const P setCurrentIndex(PdfVersionModel::ItemPDF_16); else if (version == PDFVersion::PDF_X1a) setCurrentIndex(PdfVersionModel::ItemPDFX_1a); + else if (version == PDFVersion::PDF_X1a_2003) + setCurrentIndex(PdfVersionModel::ItemPDFX_1a_2003); else if (version == PDFVersion::PDF_X3) setCurrentIndex(PdfVersionModel::ItemPDFX_3); else if (version == PDFVersion::PDF_X4) @@ -125,6 +138,8 @@ void PdfVersionCombo::setPDFXEnabled(boo { if ((oldVersion == PDFVersion::PDF_X1a) && !enabled) setCurrentIndex((int) PdfVersionModel::ItemPDF_13); + if ((oldVersion == PDFVersion::PDF_X1a_2003) && !enabled) + setCurrentIndex((int) PdfVersionModel::ItemPDF_14); if ((oldVersion == PDFVersion::PDF_X3) && !enabled) setCurrentIndex((int) PdfVersionModel::ItemPDF_13); if ((oldVersion == PDFVersion::PDF_X4) && !enabled) diff -Nurpd a/scribus/ui/pdfversionmodel.cpp b/scribus/ui/pdfversionmodel.cpp --- a/scribus/ui/pdfversionmodel.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversionmodel.cpp 2025-03-29 18:32:05.818142325 +0100 @@ -11,7 +11,7 @@ for which a new license (GPL+exception) PdfVersionModel::PdfVersionModel(QObject *parent) : QAbstractItemModel(parent) { - m_enabledVec << true << true << true << true << false << false << false; + m_enabledVec << true << true << true << true << false << false << false << false; } int PdfVersionModel::columnCount(const QModelIndex &/*parent*/) const @@ -41,6 +41,8 @@ QVariant PdfVersionModel::data(const QMo return tr("PDF 1.6 (Acrobat 7)"); if (row == ItemPDFX_1a) return tr("PDF/X-1a:2001"); + if (row == ItemPDFX_1a_2003) + return tr("PDF/X-1a:2003"); if (row == ItemPDFX_3) return tr("PDF/X-3:2002"); if (row == ItemPDFX_4) @@ -110,8 +112,9 @@ int PdfVersionModel::rowCount(const QMod void PdfVersionModel::setPdfXEnabled(bool enabled) { //beginResetModel(); - m_enabledVec[ItemPDFX_1a] = enabled; - m_enabledVec[ItemPDFX_3] = enabled; - m_enabledVec[ItemPDFX_4] = enabled; + m_enabledVec[ItemPDFX_1a] = enabled; + m_enabledVec[ItemPDFX_1a_2003] = enabled; + m_enabledVec[ItemPDFX_3] = enabled; + m_enabledVec[ItemPDFX_4] = enabled; //endResetModel(); } diff -Nurpd a/scribus/ui/pdfversionmodel.h b/scribus/ui/pdfversionmodel.h --- a/scribus/ui/pdfversionmodel.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversionmodel.h 2025-03-29 18:29:04.796564849 +0100 @@ -29,8 +29,9 @@ public: ItemPDF_15 = 2, ItemPDF_16 = 3, ItemPDFX_1a = 4, - ItemPDFX_3 = 5, - ItemPDFX_4 = 6 + ItemPDFX_1a_2003 = 5, + ItemPDFX_3 = 6, + ItemPDFX_4 = 7 }; //! Reimplement QAbstractItemModel columnCount() diff -Nurpd a/scribus/ui/prefs_pdfexport.cpp b/scribus/ui/prefs_pdfexport.cpp --- a/scribus/ui/prefs_pdfexport.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/prefs_pdfexport.cpp 2025-03-29 18:29:04.800564796 +0100 @@ -540,10 +540,12 @@ void Prefs_PDFExport::restoreDefaults(st enablePDFXWidgets(false); if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty())) enablePDFX(3); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) + if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a_2003) && (!PDFXProfiles.isEmpty())) enablePDFX(4); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) enablePDFX(5); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + enablePDFX(6); else enablePDFXWidgets(false); @@ -798,7 +800,7 @@ void Prefs_PDFExport::enableProfiles(int { enableLPI(i); bool setter = false; - if (i == 1 && (!pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a))) + if (i == 1 && (!pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a) && !pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a_2003))) setter = true; enableSolidsImagesWidgets(setter); } diff -Nurpd a/scribus/ui/tabpdfoptions.cpp b/scribus/ui/tabpdfoptions.cpp --- a/scribus/ui/tabpdfoptions.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/tabpdfoptions.cpp 2025-03-29 18:29:04.800564796 +0100 @@ -368,6 +368,7 @@ void TabPDFOptions::restoreDefaults(cons m_docFonts = DocFonts.keys(); if (Opts.Version == PDFVersion::PDF_X1a || + Opts.Version == PDFVersion::PDF_X1a_2003 || Opts.Version == PDFVersion::PDF_X3 || Opts.Version == PDFVersion::PDF_X4 ) { @@ -593,10 +594,12 @@ void TabPDFOptions::restoreDefaults(cons X3Group->setEnabled(false); if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty())) EnablePDFX(3); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) + if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a_2003) && (!PDFXProfiles.isEmpty())) EnablePDFX(4); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) EnablePDFX(5); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + EnablePDFX(6); else X3Group->setEnabled(false); @@ -851,7 +854,7 @@ void TabPDFOptions::EnablePDFX(int /*a*/ OutCombo->setCurrentIndex(1); OutCombo->setEnabled(false); EnablePr(1); - if (pdfVer == PDFVersion::PDF_X1a) // X1, no profile embedding + if (pdfVer == PDFVersion::PDF_X1a || pdfVer == PDFVersion::PDF_X1a_2003) // X1, no profile embedding { EmbedProfs->setChecked(false); EmbedProfs->setEnabled(false); @@ -938,7 +941,7 @@ void TabPDFOptions::EnablePr(int a) EnableLPI(a); bool setter = false; if (a == 1) - setter = !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a); + setter = !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a) && !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a_2003); solidsProfileGroup->setEnabled(setter); imageProfileGroup->setEnabled(setter); |
|
i only skimmed through the patch (since i have no deep knowledge of the pdf standards), but you seem to have a good job. thanks! |
|
Attached is a revised patch, that also add PDF/X-3:2003 in addition to PDF/X-1a:2003... pdfx2003.patch (24,773 bytes)
diff -Nurpd a/scribus/commonstrings.cpp b/scribus/commonstrings.cpp --- a/scribus/commonstrings.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/commonstrings.cpp 2025-03-30 15:05:49.690068820 +0200 @@ -185,7 +185,9 @@ QString CommonStrings::PDF_1_4; QString CommonStrings::PDF_1_5; QString CommonStrings::PDF_1_6; QString CommonStrings::PDF_X1a; +QString CommonStrings::PDF_X1a_2003; QString CommonStrings::PDF_X3; +QString CommonStrings::PDF_X3_2003; QString CommonStrings::PDF_X4; QString CommonStrings::PostScript1; @@ -458,8 +460,10 @@ void CommonStrings::languageChange() 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_X1a = "PDF/X-1a:2001"; + CommonStrings::PDF_X1a_2003 = "PDF/X-1a:2003"; + CommonStrings::PDF_X3 = "PDF/X-3:2002"; + CommonStrings::PDF_X3_2003 = "PDF/X-3:2003"; CommonStrings::PDF_X4 = "PDF/X-4"; CommonStrings::PostScript1 = "PostScript Level 1"; diff -Nurpd a/scribus/commonstrings.h b/scribus/commonstrings.h --- a/scribus/commonstrings.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/commonstrings.h 2025-03-30 15:05:49.690068820 +0200 @@ -261,7 +261,9 @@ public: static QString PDF_1_5; static QString PDF_1_6; static QString PDF_X1a; + static QString PDF_X1a_2003; static QString PDF_X3; + static QString PDF_X3_2003; static QString PDF_X4; static QString PostScript1; diff -Nurpd a/scribus/pdflib_core.cpp b/scribus/pdflib_core.cpp --- a/scribus/pdflib_core.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdflib_core.cpp 2025-03-30 15:05:49.694068766 +0200 @@ -618,8 +618,12 @@ bool PDFLibCore::PDF_IsPDFX() const { if (Options.Version == PDFVersion::PDF_X1a) return true; + if (Options.Version == PDFVersion::PDF_X1a_2003) + return true; if (Options.Version == PDFVersion::PDF_X3) return true; + if (Options.Version == PDFVersion::PDF_X3_2003) + return true; if (Options.Version == PDFVersion::PDF_X4) return true; return false; @@ -629,8 +633,12 @@ bool PDFLibCore::PDF_IsPDFX(const PDFVer { if (ver == PDFVersion::PDF_X1a) return true; + if (ver == PDFVersion::PDF_X1a_2003) + return true; if (ver == PDFVersion::PDF_X3) return true; + if (ver == PDFVersion::PDF_X3_2003) + return true; if (ver == PDFVersion::PDF_X4) return true; return false; @@ -1143,8 +1151,15 @@ void PDFLibCore::PDF_Begin_MetadataAndEn PutDoc("/GTS_PDFXVersion (PDF/X-1:2001)\n"); PutDoc("/GTS_PDFXConformance (PDF/X-1a:2001)\n"); } + if (Options.Version == PDFVersion::PDF_X1a_2003) + { + PutDoc("/GTS_PDFXVersion (PDF/X-1:2003)\n"); + PutDoc("/GTS_PDFXConformance (PDF/X-1a:2003)\n"); + } if (Options.Version == PDFVersion::PDF_X3) PutDoc("/GTS_PDFXVersion (PDF/X-3:2002)\n"); + if (Options.Version == PDFVersion::PDF_X3_2003) + PutDoc("/GTS_PDFXVersion (PDF/X-3:2003)\n"); if (Options.Version == PDFVersion::PDF_X4) PutDoc("/GTS_PDFXVersion (PDF/X-4)\n"); PutDoc("/Trapped /False\n>>"); @@ -2456,7 +2471,7 @@ void PDFLibCore::PDF_Begin_Colors() Transpar[HTName] = writeGState("/HT " + Pdf::toPdf(halftones) + " 0 R\n"); ResCount++; } - if ((doc.HasCMS) && (Options.UseProfiles) && (Options.Version != PDFVersion::PDF_X1a)) + if ((doc.HasCMS) && (Options.UseProfiles) && ((Options.Version != PDFVersion::PDF_X1a) || (Options.Version != PDFVersion::PDF_X1a_2003))) { PdfId iccProfileObject = writer.newObject(); writer.startObj(iccProfileObject); @@ -4451,7 +4466,7 @@ bool PDFLibCore::PDF_ProcessItem(QByteAr #ifdef HAVE_OSG if (ite->isOSGFrame()) { - if (Options.Version != PDFVersion::PDF_X3) + if (Options.Version != PDFVersion::PDF_X3 && Options.Version != PDFVersion::PDF_X3_2003) { if (!PDF_3DAnnotation(ite, PNr)) return false; @@ -11895,8 +11910,15 @@ void PDFLibCore::generateXMP(const QStri descPDFXID.setAttributeNS(pdfxidNS, "pdfx:GTS_PDFXConformance", "PDF/X-1a:2001"); descPDFXID.setAttribute("pdfx:GTS_PDFXVersion", "PDF/X-1:2001"); } + if (Options.Version == PDFVersion::PDF_X1a_2003) + { + descPDFXID.setAttributeNS(pdfxidNS, "pdfx:GTS_PDFXConformance", "PDF/X-1a:2003"); + descPDFXID.setAttribute("pdfx:GTS_PDFXVersion", "PDF/X-1:2003"); + } else if (Options.Version == PDFVersion::PDF_X3) descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-3"); + else if (Options.Version == PDFVersion::PDF_X3_2003) + descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-3:2003"); else if (Options.Version == PDFVersion::PDF_X4) descPDFXID.setAttributeNS(pdfxidNS, "pdfxid:GTS_PDFXVersion", "PDF/X-4"); } diff -Nurpd a/scribus/pdfoptionsio.cpp b/scribus/pdfoptionsio.cpp --- a/scribus/pdfoptionsio.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfoptionsio.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -114,9 +114,15 @@ void PDFOptionsIO::buildSettings() case PDFVersion::PDF_X1a: pdfVersString = "X1a"; break; + case PDFVersion::PDF_X1a_2003: + pdfVersString = "X1a:2003"; + break; case PDFVersion::PDF_X3: pdfVersString = "X3"; break; + case PDFVersion::PDF_X3_2003: + pdfVersString = "X3:2003"; + break; case PDFVersion::PDF_X4: pdfVersString = "X4"; break; @@ -450,11 +456,21 @@ bool PDFOptionsIO::readPDFVersion() m_opts->Version = PDFVersion::PDF_X1a; return true; } + if (pdfVersString == "X1a:2003") + { + m_opts->Version = PDFVersion::PDF_X1a_2003; + return true; + } if (pdfVersString == "X3") { m_opts->Version = PDFVersion::PDF_X3; return true; } + if (pdfVersString == "X3:2003") + { + m_opts->Version = PDFVersion::PDF_X3_2003; + return true; + } if (pdfVersString == "X4") { m_opts->Version = PDFVersion::PDF_X4; diff -Nurpd a/scribus/pdfversion.h b/scribus/pdfversion.h --- a/scribus/pdfversion.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfversion.h 2025-03-30 15:05:49.698068713 +0200 @@ -18,10 +18,12 @@ public: PDF_14 = 14, PDF_15 = 15, PDF_16 = 16, - PDF_X1a = 11, - PDF_X3 = 12, - PDF_X4 = 10, - PDFVersion_Min = 10, + PDF_X1a = 8, + PDF_X1a_2003 = 9, + PDF_X3 = 10, + PDF_X3_2003 = 11, + PDF_X4 = 12, + PDFVersion_Min = 8, PDFVersion_Max = 16, }; diff -Nurpd a/scribus/pdfwriter.cpp b/scribus/pdfwriter.cpp --- a/scribus/pdfwriter.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/pdfwriter.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -707,6 +707,8 @@ namespace Pdf case PDFVersion::PDF_13: write("%PDF-1.3\n"); break; + case PDFVersion::PDF_X1a_2003: + case PDFVersion::PDF_X3_2003: case PDFVersion::PDF_14: write("%PDF-1.4\n"); break; diff -Nurpd a/scribus/plugins/scriptplugin/objpdffile.cpp b/scribus/plugins/scriptplugin/objpdffile.cpp --- a/scribus/plugins/scriptplugin/objpdffile.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/plugins/scriptplugin/objpdffile.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -1424,7 +1424,9 @@ static PyObject *PDFfile_save(PDFfile *s // Apply font embedding mode pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyLong_AsLong(self->fontEmbedding); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || + pdfOptions.Version == PDFVersion::PDF_X3_2003 || pdfOptions.Version == PDFVersion::PDF_X4) { pdfOptions.FontEmbedding = PDFOptions::EmbedFonts; @@ -1586,7 +1588,9 @@ static PyObject *PDFfile_save(PDFfile *s pdfOptions.ImageProf = PyUnicode_asQString(self->imagepr); pdfOptions.PrintProf = PyUnicode_asQString(self->printprofc); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || + pdfOptions.Version == PDFVersion::PDF_X3_2003 || pdfOptions.Version == PDFVersion::PDF_X4) { pdfOptions.Info = PyUnicode_asQString(self->info); diff -Nurpd a/scribus/plugins/scriptplugin_py2x/objpdffile.cpp b/scribus/plugins/scriptplugin_py2x/objpdffile.cpp --- a/scribus/plugins/scriptplugin_py2x/objpdffile.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/plugins/scriptplugin_py2x/objpdffile.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -1407,7 +1407,9 @@ static PyObject *PDFfile_save(PDFfile *s // Apply font embedding mode pdfOptions.FontEmbedding = (PDFOptions::PDFFontEmbedding) PyLong_AsLong(self->fontEmbedding); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || + pdfOptions.Version == PDFVersion::PDF_X3_2003 || pdfOptions.Version == PDFVersion::PDF_X4) { pdfOptions.FontEmbedding = PDFOptions::EmbedFonts; @@ -1569,7 +1571,9 @@ static PyObject *PDFfile_save(PDFfile *s pdfOptions.ImageProf = PyString_AsString(self->imagepr); pdfOptions.PrintProf = PyString_AsString(self->printprofc); if (pdfOptions.Version == PDFVersion::PDF_X1a || + pdfOptions.Version == PDFVersion::PDF_X1a_2003 || pdfOptions.Version == PDFVersion::PDF_X3 || + pdfOptions.Version == PDFVersion::PDF_X3_2003 || pdfOptions.Version == PDFVersion::PDF_X4) { pdfOptions.Info = PyString_AsString(self->info); diff -Nurpd a/scribus/prefsmanager.cpp b/scribus/prefsmanager.cpp --- a/scribus/prefsmanager.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/prefsmanager.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -2837,9 +2837,11 @@ void PrefsManager::initDefaultCheckerPre checkerSettings.minResolution = 144.0; checkerSettings.checkDeviceColorsAndOutputIntent = true; cp.insert(CommonStrings::PDF_X3 , checkerSettings); + cp.insert(CommonStrings::PDF_X3_2003 , checkerSettings); checkerSettings.checkNotCMYKOrSpot = true; checkerSettings.checkDeviceColorsAndOutputIntent = false; cp.insert(CommonStrings::PDF_X1a , checkerSettings); + cp.insert(CommonStrings::PDF_X1a_2003 , checkerSettings); checkerSettings.checkNotCMYKOrSpot = false; checkerSettings.checkDeviceColorsAndOutputIntent = true; checkerSettings.checkTransparency = false; diff -Nurpd a/scribus/ui/checkDocument.cpp b/scribus/ui/checkDocument.cpp --- a/scribus/ui/checkDocument.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/checkDocument.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -172,8 +172,12 @@ QString CheckDocument::bestCheckerProfil bestProfile = CommonStrings::PDF_1_6; else if (pdfVersion == PDFVersion::PDF_X1a) bestProfile = CommonStrings::PDF_X1a; + else if (pdfVersion == PDFVersion::PDF_X1a_2003) + bestProfile = CommonStrings::PDF_X1a_2003; else if (pdfVersion == PDFVersion::PDF_X3) bestProfile = CommonStrings::PDF_X3; + else if (pdfVersion == PDFVersion::PDF_X3_2003) + bestProfile = CommonStrings::PDF_X3_2003; else if (pdfVersion == PDFVersion::PDF_X4) bestProfile = CommonStrings::PDF_X4; } diff -Nurpd a/scribus/ui/outputpreview_pdf.cpp b/scribus/ui/outputpreview_pdf.cpp --- a/scribus/ui/outputpreview_pdf.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/outputpreview_pdf.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -536,7 +536,9 @@ bool OutputPreview_PDF::createPreviewFil m_pdfOptions.Thumbnails = false; //Disable thumbnails too QString profileDescription; - if ((m_pdfOptions.Version == PDFVersion::PDF_X3) || (m_pdfOptions.Version == PDFVersion::PDF_X1a) || (m_pdfOptions.Version == PDFVersion::PDF_X4)) + if ((m_pdfOptions.Version == PDFVersion::PDF_X1a) || (m_pdfOptions.Version == PDFVersion::PDF_X1a_2003) || + (m_pdfOptions.Version == PDFVersion::PDF_X3) || (m_pdfOptions.Version == PDFVersion::PDF_X3_2003) || + (m_pdfOptions.Version == PDFVersion::PDF_X4)) { if (m_pdfOptions.Info.isEmpty()) { @@ -1044,13 +1046,13 @@ void OutputPreview_PDF::setUiOptionsToPD } // PDF/X-1, no profile embedding - if (pdfOptions.Version == PDFVersion::PDF_X1a) + if (pdfOptions.Version == PDFVersion::PDF_X1a || pdfOptions.Version == PDFVersion::PDF_X1a_2003) { pdfOptions.UseProfiles = false; pdfOptions.UseProfiles2 = false; } // PDF/X-3 or PDF/X-4, enforcing color profiles on images - if (pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X4) + if (pdfOptions.Version == PDFVersion::PDF_X3 || pdfOptions.Version == PDFVersion::PDF_X3_2003 || pdfOptions.Version == PDFVersion::PDF_X4) pdfOptions.UseProfiles2 = true; pdfOptions.MirrorH = m_optionsUi->mirrorH->isChecked(); diff -Nurpd a/scribus/ui/pdfexportdialog.cpp b/scribus/ui/pdfexportdialog.cpp --- a/scribus/ui/pdfexportdialog.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfexportdialog.cpp 2025-03-30 15:07:01.425110350 +0200 @@ -124,7 +124,7 @@ PDFExportDialog::PDFExportDialog( QWidge cancelButton = new QPushButton( CommonStrings::tr_Cancel, this ); Layout7->addWidget( cancelButton ); PDFExportLayout->addLayout( Layout7 ); - if ((m_opts.Version == PDFVersion::PDF_X3) && (Options->InfoString->text().isEmpty())) + if ((m_opts.Version == PDFVersion::PDF_X3 || m_opts.Version == PDFVersion::PDF_X3_2003) && (Options->InfoString->text().isEmpty())) okButton->setEnabled(false); resize(sizeHint()); // setMaximumSize( sizeHint() ); @@ -373,7 +373,7 @@ void PDFExportDialog::updateDocOptions() { m_opts.UseProfiles = Options->EmbedProfs->isChecked(); m_opts.UseProfiles2 = Options->EmbedProfs2->isChecked(); - if (m_opts.Version != PDFVersion::PDF_X1a) + if ((m_opts.Version != PDFVersion::PDF_X1a) || (m_opts.Version != PDFVersion::PDF_X1a_2003)) { m_opts.Intent = Options->IntendS->currentIndex(); m_opts.Intent2 = Options->IntendI->currentIndex(); @@ -382,7 +382,9 @@ void PDFExportDialog::updateDocOptions() m_opts.ImageProf = Options->ImageP->currentText(); } m_opts.PrintProf = Options->PrintProfC->currentText(); - if ((m_opts.Version == PDFVersion::PDF_X3) || (m_opts.Version == PDFVersion::PDF_X1a) || (m_opts.Version == PDFVersion::PDF_X4)) + if ((m_opts.Version == PDFVersion::PDF_X1a) || (m_opts.Version == PDFVersion::PDF_X1a_2003) || + (m_opts.Version == PDFVersion::PDF_X3) || (m_opts.Version == PDFVersion::PDF_X3_2003) || + (m_opts.Version == PDFVersion::PDF_X4)) { m_opts.Info = Options->InfoString->text(); m_opts.Encrypt = false; diff -Nurpd a/scribus/ui/pdfversioncombo.cpp b/scribus/ui/pdfversioncombo.cpp --- a/scribus/ui/pdfversioncombo.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversioncombo.cpp 2025-03-30 15:05:49.698068713 +0200 @@ -40,8 +40,12 @@ PDFVersion PdfVersionCombo::version() co return PDFVersion::PDF_16; if (curIndex == PdfVersionModel::ItemPDFX_1a) return PDFVersion::PDF_X1a; + if (curIndex == PdfVersionModel::ItemPDFX_1a_2003) + return PDFVersion::PDF_X1a_2003; if (curIndex == PdfVersionModel::ItemPDFX_3) return PDFVersion::PDF_X3; + if (curIndex == PdfVersionModel::ItemPDFX_3_2003) + return PDFVersion::PDF_X3_2003; if (curIndex == PdfVersionModel::ItemPDFX_4) return PDFVersion::PDF_X4; return PDFVersion::PDF_14; @@ -61,8 +65,12 @@ bool PdfVersionCombo::versionIs(const PD return (curIndex == PdfVersionModel::ItemPDF_16); if (version == PDFVersion::PDF_X1a) return (curIndex == PdfVersionModel::ItemPDFX_1a); + if (version == PDFVersion::PDF_X1a_2003) + return (curIndex == PdfVersionModel::ItemPDFX_1a_2003); if (version == PDFVersion::PDF_X3) return (curIndex == PdfVersionModel::ItemPDFX_3); + if (version == PDFVersion::PDF_X3_2003) + return (curIndex == PdfVersionModel::ItemPDFX_3_2003); if (version == PDFVersion::PDF_X4) return (curIndex == PdfVersionModel::ItemPDFX_4); return false; @@ -73,6 +81,8 @@ bool PdfVersionCombo::versionIsPDFX() co int curIndex = currentIndex(); if (curIndex == PdfVersionModel::ItemPDFX_1a) return true; + if (curIndex == PdfVersionModel::ItemPDFX_1a_2003) + return true; if (curIndex == PdfVersionModel::ItemPDFX_3) return true; if (curIndex == PdfVersionModel::ItemPDFX_4) @@ -87,11 +97,21 @@ void PdfVersionCombo::setVersion(const P setCurrentIndex(PdfVersionModel::ItemPDF_13); return; } + if ((version == PDFVersion::PDF_X1a_2003) && !m_isPdfXEnabled) + { + setCurrentIndex(PdfVersionModel::ItemPDF_14); + return; + } if ((version == PDFVersion::PDF_X3) && !m_isPdfXEnabled) { setCurrentIndex(PdfVersionModel::ItemPDF_13); return; } + if ((version == PDFVersion::PDF_X3_2003) && !m_isPdfXEnabled) + { + setCurrentIndex(PdfVersionModel::ItemPDF_14); + return; + } if ((version == PDFVersion::PDF_X4) && !m_isPdfXEnabled) { setCurrentIndex(PdfVersionModel::ItemPDF_15); @@ -108,8 +128,12 @@ void PdfVersionCombo::setVersion(const P setCurrentIndex(PdfVersionModel::ItemPDF_16); else if (version == PDFVersion::PDF_X1a) setCurrentIndex(PdfVersionModel::ItemPDFX_1a); + else if (version == PDFVersion::PDF_X1a_2003) + setCurrentIndex(PdfVersionModel::ItemPDFX_1a_2003); else if (version == PDFVersion::PDF_X3) setCurrentIndex(PdfVersionModel::ItemPDFX_3); + else if (version == PDFVersion::PDF_X3_2003) + setCurrentIndex(PdfVersionModel::ItemPDFX_3_2003); else if (version == PDFVersion::PDF_X4) setCurrentIndex(PdfVersionModel::ItemPDFX_4); } @@ -125,8 +149,12 @@ void PdfVersionCombo::setPDFXEnabled(boo { if ((oldVersion == PDFVersion::PDF_X1a) && !enabled) setCurrentIndex((int) PdfVersionModel::ItemPDF_13); + if ((oldVersion == PDFVersion::PDF_X1a_2003) && !enabled) + setCurrentIndex((int) PdfVersionModel::ItemPDF_14); if ((oldVersion == PDFVersion::PDF_X3) && !enabled) setCurrentIndex((int) PdfVersionModel::ItemPDF_13); + if ((oldVersion == PDFVersion::PDF_X3_2003) && !enabled) + setCurrentIndex((int) PdfVersionModel::ItemPDF_14); if ((oldVersion == PDFVersion::PDF_X4) && !enabled) setCurrentIndex((int) PdfVersionModel::ItemPDF_15); } diff -Nurpd a/scribus/ui/pdfversionmodel.cpp b/scribus/ui/pdfversionmodel.cpp --- a/scribus/ui/pdfversionmodel.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversionmodel.cpp 2025-03-30 15:05:49.702068660 +0200 @@ -11,7 +11,7 @@ for which a new license (GPL+exception) PdfVersionModel::PdfVersionModel(QObject *parent) : QAbstractItemModel(parent) { - m_enabledVec << true << true << true << true << false << false << false; + m_enabledVec << true << true << true << true << false << false << false << false << false; } int PdfVersionModel::columnCount(const QModelIndex &/*parent*/) const @@ -41,8 +41,12 @@ QVariant PdfVersionModel::data(const QMo return tr("PDF 1.6 (Acrobat 7)"); if (row == ItemPDFX_1a) return tr("PDF/X-1a:2001"); + if (row == ItemPDFX_1a_2003) + return tr("PDF/X-1a:2003"); if (row == ItemPDFX_3) return tr("PDF/X-3:2002"); + if (row == ItemPDFX_3_2003) + return tr("PDF/X-3:2003"); if (row == ItemPDFX_4) return tr("PDF/X-4"); return QVariant(); @@ -110,8 +114,10 @@ int PdfVersionModel::rowCount(const QMod void PdfVersionModel::setPdfXEnabled(bool enabled) { //beginResetModel(); - m_enabledVec[ItemPDFX_1a] = enabled; - m_enabledVec[ItemPDFX_3] = enabled; - m_enabledVec[ItemPDFX_4] = enabled; + m_enabledVec[ItemPDFX_1a] = enabled; + m_enabledVec[ItemPDFX_1a_2003] = enabled; + m_enabledVec[ItemPDFX_3] = enabled; + m_enabledVec[ItemPDFX_3_2003] = enabled; + m_enabledVec[ItemPDFX_4] = enabled; //endResetModel(); } diff -Nurpd a/scribus/ui/pdfversionmodel.h b/scribus/ui/pdfversionmodel.h --- a/scribus/ui/pdfversionmodel.h 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/pdfversionmodel.h 2025-03-30 15:05:49.702068660 +0200 @@ -29,8 +29,10 @@ public: ItemPDF_15 = 2, ItemPDF_16 = 3, ItemPDFX_1a = 4, - ItemPDFX_3 = 5, - ItemPDFX_4 = 6 + ItemPDFX_1a_2003 = 5, + ItemPDFX_3 = 6, + ItemPDFX_3_2003 = 7, + ItemPDFX_4 = 8 }; //! Reimplement QAbstractItemModel columnCount() diff -Nurpd a/scribus/ui/prefs_pdfexport.cpp b/scribus/ui/prefs_pdfexport.cpp --- a/scribus/ui/prefs_pdfexport.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/prefs_pdfexport.cpp 2025-03-30 15:05:49.702068660 +0200 @@ -540,10 +540,14 @@ void Prefs_PDFExport::restoreDefaults(st enablePDFXWidgets(false); if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty())) enablePDFX(3); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) + if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a_2003) && (!PDFXProfiles.isEmpty())) enablePDFX(4); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) enablePDFX(5); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3_2003) && (!PDFXProfiles.isEmpty())) + enablePDFX(6); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + enablePDFX(7); else enablePDFXWidgets(false); @@ -798,7 +802,7 @@ void Prefs_PDFExport::enableProfiles(int { enableLPI(i); bool setter = false; - if (i == 1 && (!pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a))) + if (i == 1 && (!pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a) && !pdfVersionComboBox->versionIs(PDFVersion::PDF_X1a_2003))) setter = true; enableSolidsImagesWidgets(setter); } @@ -1025,7 +1029,7 @@ void Prefs_PDFExport::enablePDFX(int) outputIntentionComboBox->setCurrentIndex(1); outputIntentionComboBox->setEnabled(false); enableProfiles(1); - if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images + if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X3_2003|| pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images { useImageProfileCheckBox->setChecked(true); useImageProfileCheckBox->setEnabled(false); diff -Nurpd a/scribus/ui/tabpdfoptions.cpp b/scribus/ui/tabpdfoptions.cpp --- a/scribus/ui/tabpdfoptions.cpp 2025-03-29 15:01:00.000000000 +0100 +++ b/scribus/ui/tabpdfoptions.cpp 2025-03-30 15:05:49.702068660 +0200 @@ -368,7 +368,9 @@ void TabPDFOptions::restoreDefaults(cons m_docFonts = DocFonts.keys(); if (Opts.Version == PDFVersion::PDF_X1a || + Opts.Version == PDFVersion::PDF_X1a_2003 || Opts.Version == PDFVersion::PDF_X3 || + Opts.Version == PDFVersion::PDF_X3_2003 || Opts.Version == PDFVersion::PDF_X4 ) { if (Opts.FontEmbedding != PDFOptions::EmbedFonts && @@ -593,10 +595,14 @@ void TabPDFOptions::restoreDefaults(cons X3Group->setEnabled(false); if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a) && (!PDFXProfiles.isEmpty())) EnablePDFX(3); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) + if (cmsUse && (Opts.Version == PDFVersion::PDF_X1a_2003) && (!PDFXProfiles.isEmpty())) EnablePDFX(4); - else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3) && (!PDFXProfiles.isEmpty())) EnablePDFX(5); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X3_2003) && (!PDFXProfiles.isEmpty())) + EnablePDFX(6); + else if (cmsUse && (Opts.Version == PDFVersion::PDF_X4) && (!PDFXProfiles.isEmpty())) + EnablePDFX(7); else X3Group->setEnabled(false); @@ -851,14 +857,14 @@ void TabPDFOptions::EnablePDFX(int /*a*/ OutCombo->setCurrentIndex(1); OutCombo->setEnabled(false); EnablePr(1); - if (pdfVer == PDFVersion::PDF_X1a) // X1, no profile embedding + if (pdfVer == PDFVersion::PDF_X1a || pdfVer == PDFVersion::PDF_X1a_2003) // X1, no profile embedding { EmbedProfs->setChecked(false); EmbedProfs->setEnabled(false); EmbedProfs2->setChecked(false); EmbedProfs2->setEnabled(false); } - if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images + if (pdfVer == PDFVersion::PDF_X3 || pdfVer == PDFVersion::PDF_X3_2003 || pdfVer == PDFVersion::PDF_X4) // X3 or X4, enforcing color profiles on images { EmbedProfs->setEnabled(true); EmbedProfs2->setChecked(true); @@ -938,7 +944,7 @@ void TabPDFOptions::EnablePr(int a) EnableLPI(a); bool setter = false; if (a == 1) - setter = !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a); + setter = !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a) && !PDFVersionCombo->versionIs(PDFVersion::PDF_X1a_2003); solidsProfileGroup->setEnabled(setter); imageProfileGroup->setEnabled(setter); |
|
after the first version of the patch, i wanted to comment if would not have been useful to have a sub-flag for pdf/x-1a on top of the ones for its two revisions, in order to keep some of the conditions a bit slimmer and reason about then i saw that there are only two possible revisions for x-1a and i decide that it's probably overkill. now, we have a second standard where we support "revisions". and if the trend goes on, i think that it might worth to consider to have a flag for the families (like pdf/x-1a and pdf/x-3 and add sub-flags that are more feature oriented). i'm still not 100% sure it's the way to go, but it might be worth considering. |
|
I'm not sure that would be an improvement really, as you'd need to navigate two combo boxes instead of one. Having all the standards in a single combo box, gives an easy overview what standard are supported. And it seems X-4 and newer don't have "substandards"... yet... |
|
well, no, the user would not see the revisions, but different standards. i was thinking about the conditions in the code, where most things for 2001 are are also valid for 2003. But, as I wrote, not 100% sure that it's a good idea. |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-02-17 17:44 | ImYoric | New Issue | |
2025-02-17 19:43 | jghali | Severity | minor => feature |
2025-02-19 19:14 | ale | Note Added: 0052072 | |
2025-03-27 08:59 | pygmee | Note Added: 0052348 | |
2025-03-27 12:51 | flagsoft | Note Added: 0052349 | |
2025-03-27 13:03 | ImYoric | Note Added: 0052350 | |
2025-03-27 14:07 | ale | Note Added: 0052351 | |
2025-03-27 16:17 | jghali | Note Added: 0052352 | |
2025-03-27 20:58 | ale | Note Added: 0052355 | |
2025-03-29 17:39 | pmjdebruijn | Note Added: 0052367 | |
2025-03-29 17:39 | pmjdebruijn | File Added: pdfx1a2003.patch | |
2025-03-29 20:56 | ale | Note Added: 0052368 | |
2025-03-30 13:13 | pmjdebruijn | Note Added: 0052370 | |
2025-03-30 13:13 | pmjdebruijn | File Added: pdfx2003.patch | |
2025-03-30 16:13 | ale | Note Added: 0052374 | |
2025-03-30 16:59 | pmjdebruijn | Note Added: 0052377 | |
2025-03-30 18:50 | ale | Note Added: 0052378 |