diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-07-04 11:32:07 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-07-04 14:15:49 +0200 |
commit | dd4ce9b2fc7feaf288055b24b5bc4842c0d2b4de (patch) | |
tree | 035921cc9928ee72e725049de9aa398c97f97188 /filter/source/pdf/pdfexport.cxx | |
parent | ef1c755e31971d92429d70fbab58446ccb2bfcda (diff) |
tdf#152235 filter,vcl: PDF/UA export: tag watermark as Artifact
Change-Id: I64e57a832678be935b69a5cea328cc252a4bf29d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153951
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'filter/source/pdf/pdfexport.cxx')
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index eb43260d8a83..f9c5fb44af6b 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -1262,6 +1262,13 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi pDev->Pop(); rWriter.Push(); + // tdf#152235 tag around the reference to the XObject on the page + rWriter.BeginStructureElement(vcl::PDFWriter::NonStructElement, ::std::u16string_view()); + rWriter.SetStructureAttribute(vcl::PDFWriter::Type, vcl::PDFWriter::Pagination); + rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, vcl::PDFWriter::Watermark); + // HACK: this should produce *nothing* itself but is necessary to output + // the Artifact tag here, not inside the XObject + rWriter.DrawPolyLine({}); rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) ); rWriter.SetFont( aFont ); rWriter.SetTextColor(maWatermarkColor); @@ -1304,6 +1311,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi rWriter.BeginTransparencyGroup(); rWriter.DrawText( aTextPoint, msWatermark ); rWriter.EndTransparencyGroup( aTextRect, 50 ); + rWriter.EndStructureElement(); rWriter.Pop(); } @@ -1350,6 +1358,13 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP pDev->Pop(); rWriter.Push(); + // tdf#152235 tag around the reference to the XObject on the page + rWriter.BeginStructureElement(vcl::PDFWriter::NonStructElement, ::std::u16string_view()); + rWriter.SetStructureAttribute(vcl::PDFWriter::Type, vcl::PDFWriter::Pagination); + rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, vcl::PDFWriter::Watermark); + // HACK: this should produce *nothing* itself but is necessary to output + // the Artifact tag here, not inside the XObject + rWriter.DrawPolyLine({}); rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) ); rWriter.SetFont(aFont); rWriter.SetTextColor( Color(19,20,22) ); @@ -1385,6 +1400,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP aTextPoint.Move( nTextWidth*1.5, 0 ); } + rWriter.EndStructureElement(); rWriter.Pop(); } |