From 5364b7b663b2be30d802474618dea3db14a2182a Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 12 Dec 2024 23:56:29 +0900 Subject: tdf#160196 Embedded files are not allowed in PDF/A-1 and PDF/A-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This disables embedded/attached files in the UI as well as in the export filter for PDF/A-1 and 2. PDF/A-3 is almost identical to PDF/A-2 with the difference that it allows embedded/attached files. Change-Id: If8c3af6ab08ad320cf15618ead9c69fbd490d4f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178413 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178769 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- vcl/source/gdi/pdfwriter_impl.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vcl/source') diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 387edb5e2594..6816fca77bd5 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3510,6 +3510,9 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer ) void PDFWriterImpl::addDocumentAttachedFile(OUString const& rFileName, OUString const& rMimeType, OUString const& rDescription, std::unique_ptr rStream) { + if (m_nPDFA_Version == 1 || m_nPDFA_Version == 2) + return; + sal_Int32 nObjectID = addEmbeddedFile(std::move(rStream), rMimeType); auto& rAttachedFile = m_aDocumentAttachedFiles.emplace_back(); rAttachedFile.maFilename = rFileName; -- cgit