wxMaxima
Loading...
Searching...
No Matches
Public Member Functions
wxPdfTag Class Reference

Description of a logical structure element ("tag") of a tagged PDF document. More...

#include <pdfstructure.h>

Public Member Functions

 wxPdfTag (const wxString &structureType=wxS("Span"))
 Constructor.
 
wxPdfTag & SetStructureType (const wxString &structureType)
 Set the structure type.
 
const wxString & GetStructureType () const
 Get the structure type.
 
wxPdfTag & SetAltText (const wxString &altText)
 Set the alternate description (/Alt)
 
const wxString & GetAltText () const
 Get the alternate description.
 
wxPdfTag & SetActualText (const wxString &actualText)
 Set the replacement text (/ActualText)
 
const wxString & GetActualText () const
 Get the replacement text.
 
wxPdfTag & SetExpansion (const wxString &expansion)
 Set the expanded form of an abbreviation (/E)
 
const wxString & GetExpansion () const
 Get the expanded form of an abbreviation.
 
wxPdfTag & SetLanguage (const wxString &language)
 Set the natural language of the element content (/Lang), e.g. "en-US".
 
const wxString & GetLanguage () const
 Get the natural language of the element content.
 
wxPdfTag & SetTitle (const wxString &title)
 Set the title of the element (/T)
 
const wxString & GetTitle () const
 Get the title of the element.
 
wxPdfTag & SetMathML (const wxString &mathML)
 Set a MathML representation of the element content.
 
const wxString & GetMathML () const
 Get the MathML representation of the element content.
 

Detailed Description

Description of a logical structure element ("tag") of a tagged PDF document.

A tagged PDF document contains, in addition to its visual content, a structure tree that tells assistive technology (screen readers, braille displays, reflowing viewers) and text extraction tools what the content means: which drawing commands form a paragraph, a heading, a figure or a mathematical formula, how they should be read aloud, and in which order.

An instance of this class describes one structure element. It is passed to wxPdfDocument::BeginTag(); every drawing command issued until the matching wxPdfDocument::EndTag() becomes the content of that element.

The structure type is one of the standard structure types of ISO 32000-1, section 14.8.4, for example

Optional properties:

All setters return a reference to the object, so that calls can be chained:

pdf.BeginTag(wxPdfTag(wxS("Formula"))
.SetAltText(wxS("x squared plus one"))
.SetMathML(wxS("<math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
"<msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mn>1</mn></math>")));
// ... draw the formula ...
pdf.EndTag();
Description of a logical structure element ("tag") of a tagged PDF document.
Definition: pdfstructure.h:80
wxPdfTag & SetMathML(const wxString &mathML)
Set a MathML representation of the element content.
Definition: pdfstructure.h:132
wxPdfTag & SetAltText(const wxString &altText)
Set the alternate description (/Alt)
Definition: pdfstructure.h:96
See also
wxPdfDocument::SetTagged(), wxPdfDocument::BeginTag(), wxPdfDocument::EndTag()

Constructor & Destructor Documentation

◆ wxPdfTag()

wxPdfTag::wxPdfTag ( const wxString &  structureType = wxS("Span"))
explicit

Constructor.

Parameters
structureTypethe structure type of the element, e.g. "P" or "Formula". An empty string is replaced by "Span".

Member Function Documentation

◆ SetMathML()

wxPdfTag & wxPdfTag::SetMathML ( const wxString &  mathML)
inline

Set a MathML representation of the element content.

The MathML markup (a complete <math> element, preferably with the MathML namespace declaration) is embedded as an associated file of the structure element. It is normally used with Formula elements.

Parameters
mathMLthe MathML markup. It is stored UTF-8 encoded.

The documentation for this class was generated from the following files: