summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6dffb86b6c19..851663a9e101 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5156,6 +5156,13 @@ bool PDFWriterImpl::emitCatalog()
aWriter.startObject(rAttachedFile.mnObjectId);
aWriter.startDict();
aWriter.write("/Type", "/Filespec");
+
+ // Add associated files relationship (since PDF 2.0)
+ if (m_aContext.Version >= PDFWriter::PDFVersion::PDF_2_0 || m_nPDFA_Version == 3)
+ {
+ aWriter.write("/AFRelationship", "/Source");
+ }
+
aWriter.writeKeyAndUnicodeEncrypt("/F", rAttachedFile.maFilename, rAttachedFile.mnObjectId);
if (PDFWriter::PDFVersion::PDF_1_7 <= m_aContext.Version)
{
@@ -5195,6 +5202,16 @@ bool PDFWriterImpl::emitCatalog()
if (!m_aDocumentAttachedFiles.empty())
{
+ // Write the associated files catalog entry (since PDF 2.0)
+ if (m_aContext.Version >= PDFWriter::PDFVersion::PDF_2_0 || m_nPDFA_Version == 3)
+ {
+ aLine.append("/AF");
+ aLine.append("[");
+ for (auto & rAttachedFile : m_aDocumentAttachedFiles)
+ aWriter.writeReference(rAttachedFile.mnObjectId);
+ aLine.append("]");
+ }
+
aWriter.startDictWithKey("/Names");
aWriter.startDictWithKey("/EmbeddedFiles");
aLine.append("/Names [");