summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-12-17 23:34:29 +0900
committerMiklos Vajna <vmiklos@collabora.com>2024-12-18 10:18:37 +0100
commit3d3988e6c472fa181c898fa6e90da2bb903647fd (patch)
treeb01cb0693e89bcc5663ec7bf481e2e3db148dc00 /vcl/source
parent61c48c0020b7de9142c5d251de918a0d88066e14 (diff)
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 <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx5
1 files changed, 4 insertions, 1 deletions
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;