summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--filter/source/pdf/pdfexport.cxx3
-rw-r--r--include/vcl/pdfwriter.hxx2
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1
4 files changed, 13 insertions, 1 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 0df62a459ef3..ed1e0b5ad95c 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -575,6 +575,9 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
mbEncrypt = false; // no encryption
xEnc.clear();
break;
+ case 16:
+ aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_6;
+ break;
}
// copy in context the values default in the constructor or set by the FilterData sequence of properties
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 3c9afafc8180..8e494d796292 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -103,7 +103,7 @@ public:
enum class Orientation { Portrait, Inherit };
// in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
- enum class PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
+ enum class PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_1_6, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
// for the meaning of DestAreaType please look at PDF Reference Manual
// version 1.4 section 8.2.1, page 475
enum class DestAreaType { XYZ, FitRectangle };
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index edcd95af9281..cbd42a738c31 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -1412,6 +1412,8 @@ void PdfExportTest::testTdf113143()
// ReduceImageResolution is on by default and that hides the bug we
// want to test.
{ "ReduceImageResolution", uno::Any(false) },
+ // Set a custom PDF version.
+ { "SelectPdfVersion", uno::makeAny(static_cast<sal_Int32>(16)) },
}));
aMediaDescriptor["FilterData"] <<= aFilterData;
exportAndParse(aURL, aMediaDescriptor);
@@ -1456,6 +1458,12 @@ void PdfExportTest::testTdf113143()
// This failed, both were 319, now nSmaller is 169.
CPPUNIT_ASSERT_LESS(nLarger, nSmaller);
+
+ // The following check used to fail in the past, header was "%PDF-1.5":
+ maMemory.Seek(0);
+ OString aExpectedHeader("%PDF-1.6");
+ OString aHeader(read_uInt8s_ToOString(maMemory, aExpectedHeader.getLength()));
+ CPPUNIT_ASSERT_EQUAL(aExpectedHeader, aHeader);
}
void PdfExportTest::testForcePoint71()
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index cb58e6ce8842..38e1ab075363 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1796,6 +1796,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
case PDFWriter::PDFVersion::PDF_1_4: aBuffer.append( "1.4" );break;
default:
case PDFWriter::PDFVersion::PDF_1_5: aBuffer.append( "1.5" );break;
+ case PDFWriter::PDFVersion::PDF_1_6: aBuffer.append( "1.6" );break;
}
// append something binary as comment (suggested in PDF Reference)
aBuffer.append( "\n%\303\244\303\274\303\266\303\237\n" );