summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2019-01-31 17:18:36 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-02-06 16:46:09 +0100
commit9547c0edef9a48937e4d9651a840c49481a4fbd9 (patch)
treea97332849087ccfd61c13d02342783cdedae83f3
parentbd66a0201fb6d1a127139287cc8b5bd27e3a92c3 (diff)
Export background images provided by master page as artifacts
Such that screenreaders don't announce them. To make this happen, pass them as NonStructElement to PDF writer. Change-Id: I94d52ee0207cd6362edabfb9b891faa7fe341543
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx36
1 files changed, 6 insertions, 30 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 71a6125e2ff1..60f45740b66a 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2217,38 +2217,14 @@ namespace drawinglayer
{
// structured tag primitive
const vcl::PDFWriter::StructElement& rTagElement(rStructureTagCandidate.getStructureElement());
- bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement);
+ const bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement);
+ const bool bIsBackground(rStructureTagCandidate.isBackground());
- //Z For now, just do not create StructureTag(s) for hidden/background
- // (Graphic)Objects - see '/Artifact' comments below
- if(bTagUsed && rStructureTagCandidate.isBackground())
+ if(mpPDFExtOutDevData && bTagUsed)
{
- bTagUsed = false;
- }
-
- if(mpPDFExtOutDevData && bTagUsed)
- {
- // write start tag
- mpPDFExtOutDevData->BeginStructureElement(rTagElement);
-
- // if(rStructureTagCandidate.isBackground())
- // {
- // //Z need to somehow apply '/Artifact' information...
- // // - Already experimented with adding two BeginStructureElement adding
- // // a 'vcl::PDFWriter::Artifact' -> not really what e.g. PAC3 expects.
- // // - May also be adding someting using 'SetStructureAttribute' and
- // // extending vcl::PDFWriter::StructAttribute...
- // // - Simple solution for now (see above): Just do not create
- // // StructureTag(s) for hidden/background (Graphic)Objects. That
- // // works, shows all content in PDF renderers, but hides in
- // // TaggedStructure. But: also not visible in PAC3's 'LogicalStructure'
- // // View where there is a tab for 'Artifacts' - I *guess* a correctly
- // // tagged '/Artifact' should appear there.
- // // Unfortunately found no real example - there is https://www.w3.org/TR/WCAG20-TECHS/PDF4.html
- // // which claims to have an example in
- // // https://www.w3.org/WAI/WCAG20/Techniques/working-examples/PDF4/decorative-image.docx
- // // but that file has no '/Artifact' entries at all...
- // }
+ // Write start tag. For background elements use NonStructElement instead of real element type (e.g. Figure)
+ // to guarantee it gets exported as artifact (tagged PDF)
+ mpPDFExtOutDevData->BeginStructureElement(bIsBackground ? vcl::PDFWriter::NonStructElement : rTagElement);
}
// process children normally