vcl/source/gdi/pdfwriter_impl.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 3d3988e6c472fa181c898fa6e90da2bb903647fd Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Tue Dec 17 23:34:29 2024 +0900 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Dec 18 10:18:37 2024 +0100 pdf: /Info shouldn't be written in PDF 2.0 unless really needed We shouldn't write the /Info unless we really need to for /ModDate or /CreationDate, which are needed if /PieceInfo is present, which we don't support. Change-Id: I14770a20e4efcd5f77bb7b31af3e87682ce040b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178675 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6896e112daf9..54d079b6e957 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5933,7 +5933,10 @@ sal_Int32 PDFWriterImpl::emitEncrypt() bool PDFWriterImpl::emitTrailer() { // emit doc info - sal_Int32 nDocInfoObject = emitInfoDict( ); + sal_Int32 nDocInfoObject = 0; + // Deprecated in PDF 2.0, but still allowed if /PieceInfo is written (which we don't support) + if (m_aContext.Version < PDFWriter::PDFVersion::PDF_2_0) + nDocInfoObject = emitInfoDict(); sal_Int32 nSecObject = 0;