![]() |
![]() |
![]() |
Poppler Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <poppler.h> PopplerStructureElement; enum PopplerStructureElementKind; PopplerStructureElementIter; enum PopplerStructureGetTextFlags; enum PopplerStructurePlacement; enum PopplerStructureWritingMode; enum PopplerStructureBorderStyle; enum PopplerStructureTextAlign; enum PopplerStructureBlockAlign; enum PopplerStructureInlineAlign; enum PopplerStructureTextDecoration; enum PopplerStructureRubyAlign; enum PopplerStructureRubyPosition; enum PopplerStructureGlyphOrientation; enum PopplerStructureListNumbering; enum PopplerStructureTableScope; enum PopplerStructureFormRole; enum PopplerStructureFormState; PopplerTextSpan; PopplerStructureElementIter * poppler_structure_element_iter_new (PopplerDocument *poppler_document
); gboolean poppler_structure_element_iter_next (PopplerStructureElementIter *iter
); PopplerStructureElementIter * poppler_structure_element_iter_copy (PopplerStructureElementIter *iter
); void poppler_structure_element_iter_free (PopplerStructureElementIter *iter
); PopplerStructureElementIter * poppler_structure_element_iter_get_child (PopplerStructureElementIter *parent
); PopplerStructureElement * poppler_structure_element_iter_get_element (PopplerStructureElementIter *iter
); PopplerStructureElementKind poppler_structure_element_get_kind (PopplerStructureElement *poppler_structure_element
); gint poppler_structure_element_get_page (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_is_content (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_is_inline (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_is_block (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_is_grouping (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_id (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_title (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_abbreviation (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_language (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_text (PopplerStructureElement *poppler_structure_element
,PopplerStructureGetTextFlags flags
); gchar * poppler_structure_element_get_alt_text (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_actual_text (PopplerStructureElement *poppler_structure_element
); PopplerTextSpan ** poppler_structure_element_get_text_spans (PopplerStructureElement *poppler_structure_element
,guint *n_text_spans
); PopplerStructurePlacement poppler_structure_element_get_placement (PopplerStructureElement *poppler_structure_element
); PopplerStructureWritingMode poppler_structure_element_get_writing_mode (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_get_background_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
); gboolean poppler_structure_element_get_border_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *colors
); void poppler_structure_element_get_border_style (PopplerStructureElement *poppler_structure_element
,PopplerStructureBorderStyle *border_styles
); gboolean poppler_structure_element_get_border_thickness (PopplerStructureElement *poppler_structure_element
,gdouble *border_thicknesses
); void poppler_structure_element_get_padding (PopplerStructureElement *poppler_structure_element
,gdouble *paddings
); gboolean poppler_structure_element_get_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
); gdouble poppler_structure_element_get_space_before (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_space_after (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_start_indent (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_end_indent (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_text_indent (PopplerStructureElement *poppler_structure_element
); PopplerStructureTextAlign poppler_structure_element_get_text_align (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_get_bounding_box (PopplerStructureElement *poppler_structure_element
,PopplerRectangle *bounding_box
); gdouble poppler_structure_element_get_width (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_height (PopplerStructureElement *poppler_structure_element
); PopplerStructureBlockAlign poppler_structure_element_get_block_align (PopplerStructureElement *poppler_structure_element
); PopplerStructureInlineAlign poppler_structure_element_get_inline_align (PopplerStructureElement *poppler_structure_element
); void poppler_structure_element_get_table_border_style (PopplerStructureElement *poppler_structure_element
,PopplerStructureBorderStyle *border_styles
); void poppler_structure_element_get_table_padding (PopplerStructureElement *poppler_structure_element
,gdouble *paddings
); gdouble poppler_structure_element_get_baseline_shift (PopplerStructureElement *poppler_structure_element
); gdouble poppler_structure_element_get_line_height (PopplerStructureElement *poppler_structure_element
); gboolean poppler_structure_element_get_text_decoration_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
); gdouble poppler_structure_element_get_text_decoration_thickness (PopplerStructureElement *poppler_structure_element
); PopplerStructureTextDecoration poppler_structure_element_get_text_decoration_type (PopplerStructureElement *poppler_structure_element
); PopplerStructureRubyAlign poppler_structure_element_get_ruby_align (PopplerStructureElement *poppler_structure_element
); PopplerStructureRubyPosition poppler_structure_element_get_ruby_position (PopplerStructureElement *poppler_structure_element
); PopplerStructureGlyphOrientation poppler_structure_element_get_glyph_orientation (PopplerStructureElement *poppler_structure_element
); guint poppler_structure_element_get_column_count (PopplerStructureElement *poppler_structure_element
); gdouble * poppler_structure_element_get_column_gaps (PopplerStructureElement *poppler_structure_element
,guint *n_values
); gdouble * poppler_structure_element_get_column_widths (PopplerStructureElement *poppler_structure_element
,guint *n_values
); PopplerStructureListNumbering poppler_structure_element_get_list_numbering (PopplerStructureElement *poppler_structure_element
); PopplerStructureFormRole poppler_structure_element_get_form_role (PopplerStructureElement *poppler_structure_element
); PopplerStructureFormState poppler_structure_element_get_form_state (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_form_description (PopplerStructureElement *poppler_structure_element
); guint poppler_structure_element_get_table_row_span (PopplerStructureElement *poppler_structure_element
); guint poppler_structure_element_get_table_column_span (PopplerStructureElement *poppler_structure_element
); gchar ** poppler_structure_element_get_table_headers (PopplerStructureElement *poppler_structure_element
); PopplerStructureTableScope poppler_structure_element_get_table_scope (PopplerStructureElement *poppler_structure_element
); gchar * poppler_structure_element_get_table_summary (PopplerStructureElement *poppler_structure_element
); PopplerTextSpan * poppler_text_span_copy (PopplerTextSpan *poppler_text_span
); void poppler_text_span_free (PopplerTextSpan *poppler_text_span
); gboolean poppler_text_span_is_fixed_width_font (PopplerTextSpan *poppler_text_span
); gboolean poppler_text_span_is_serif_font (PopplerTextSpan *poppler_text_span
); gboolean poppler_text_span_is_bold_font (PopplerTextSpan *poppler_text_span
); void poppler_text_span_get_color (PopplerTextSpan *poppler_text_span
,PopplerColor *color
); const gchar * poppler_text_span_get_text (PopplerTextSpan *poppler_text_span
); const gchar * poppler_text_span_get_font_name (PopplerTextSpan *poppler_text_span
);
Instances of PopplerStructureElement are used to describe the structure
of a PopplerDocument. To access the elements in the structure of the
document, use poppler_structure_element_iter_new()
to obtain an iterator
for the top-level PopplerStructure, and then use the
PopplerStructureElementIter methods to traverse the structure tree.
typedef enum { POPPLER_STRUCTURE_ELEMENT_CONTENT, POPPLER_STRUCTURE_ELEMENT_OBJECT_REFERENCE, POPPLER_STRUCTURE_ELEMENT_DOCUMENT, POPPLER_STRUCTURE_ELEMENT_PART, POPPLER_STRUCTURE_ELEMENT_ARTICLE, POPPLER_STRUCTURE_ELEMENT_SECTION, POPPLER_STRUCTURE_ELEMENT_DIV, POPPLER_STRUCTURE_ELEMENT_SPAN, POPPLER_STRUCTURE_ELEMENT_QUOTE, POPPLER_STRUCTURE_ELEMENT_NOTE, POPPLER_STRUCTURE_ELEMENT_REFERENCE, POPPLER_STRUCTURE_ELEMENT_BIBENTRY, POPPLER_STRUCTURE_ELEMENT_CODE, POPPLER_STRUCTURE_ELEMENT_LINK, POPPLER_STRUCTURE_ELEMENT_ANNOT, POPPLER_STRUCTURE_ELEMENT_BLOCKQUOTE, POPPLER_STRUCTURE_ELEMENT_CAPTION, POPPLER_STRUCTURE_ELEMENT_NONSTRUCT, POPPLER_STRUCTURE_ELEMENT_TOC, POPPLER_STRUCTURE_ELEMENT_TOC_ITEM, POPPLER_STRUCTURE_ELEMENT_INDEX, POPPLER_STRUCTURE_ELEMENT_PRIVATE, POPPLER_STRUCTURE_ELEMENT_PARAGRAPH, POPPLER_STRUCTURE_ELEMENT_HEADING, POPPLER_STRUCTURE_ELEMENT_HEADING_1, POPPLER_STRUCTURE_ELEMENT_HEADING_2, POPPLER_STRUCTURE_ELEMENT_HEADING_3, POPPLER_STRUCTURE_ELEMENT_HEADING_4, POPPLER_STRUCTURE_ELEMENT_HEADING_5, POPPLER_STRUCTURE_ELEMENT_HEADING_6, POPPLER_STRUCTURE_ELEMENT_LIST, POPPLER_STRUCTURE_ELEMENT_LIST_ITEM, POPPLER_STRUCTURE_ELEMENT_LIST_LABEL, POPPLER_STRUCTURE_ELEMENT_LIST_BODY, POPPLER_STRUCTURE_ELEMENT_TABLE, POPPLER_STRUCTURE_ELEMENT_TABLE_ROW, POPPLER_STRUCTURE_ELEMENT_TABLE_HEADING, POPPLER_STRUCTURE_ELEMENT_TABLE_DATA, POPPLER_STRUCTURE_ELEMENT_TABLE_HEADER, POPPLER_STRUCTURE_ELEMENT_TABLE_FOOTER, POPPLER_STRUCTURE_ELEMENT_TABLE_BODY, POPPLER_STRUCTURE_ELEMENT_RUBY, POPPLER_STRUCTURE_ELEMENT_RUBY_BASE_TEXT, POPPLER_STRUCTURE_ELEMENT_RUBY_ANNOT_TEXT, POPPLER_STRUCTURE_ELEMENT_RUBY_PUNCTUATION, POPPLER_STRUCTURE_ELEMENT_WARICHU, POPPLER_STRUCTURE_ELEMENT_WARICHU_TEXT, POPPLER_STRUCTURE_ELEMENT_WARICHU_PUNCTUATION, POPPLER_STRUCTURE_ELEMENT_FIGURE, POPPLER_STRUCTURE_ELEMENT_FORMULA, POPPLER_STRUCTURE_ELEMENT_FORM, } PopplerStructureElementKind;
typedef struct _PopplerStructureElementIter PopplerStructureElementIter;
typedef enum { POPPLER_STRUCTURE_GET_TEXT_NONE = 0, POPPLER_STRUCTURE_GET_TEXT_RECURSIVE = (1 << 0), } PopplerStructureGetTextFlags;
typedef enum { POPPLER_STRUCTURE_PLACEMENT_BLOCK, POPPLER_STRUCTURE_PLACEMENT_INLINE, POPPLER_STRUCTURE_PLACEMENT_BEFORE, POPPLER_STRUCTURE_PLACEMENT_START, POPPLER_STRUCTURE_PLACEMENT_END, } PopplerStructurePlacement;
typedef enum { POPPLER_STRUCTURE_WRITING_MODE_LR_TB, POPPLER_STRUCTURE_WRITING_MODE_RL_TB, POPPLER_STRUCTURE_WRITING_MODE_TB_RL, } PopplerStructureWritingMode;
typedef enum { POPPLER_STRUCTURE_BORDER_STYLE_NONE, POPPLER_STRUCTURE_BORDER_STYLE_HIDDEN, POPPLER_STRUCTURE_BORDER_STYLE_DOTTED, POPPLER_STRUCTURE_BORDER_STYLE_DASHED, POPPLER_STRUCTURE_BORDER_STYLE_SOLID, POPPLER_STRUCTURE_BORDER_STYLE_DOUBLE, POPPLER_STRUCTURE_BORDER_STYLE_GROOVE, POPPLER_STRUCTURE_BORDER_STYLE_INSET, POPPLER_STRUCTURE_BORDER_STYLE_OUTSET, } PopplerStructureBorderStyle;
typedef enum { POPPLER_STRUCTURE_TEXT_ALIGN_START, POPPLER_STRUCTURE_TEXT_ALIGN_CENTER, POPPLER_STRUCTURE_TEXT_ALIGN_END, POPPLER_STRUCTURE_TEXT_ALIGN_JUSTIFY, } PopplerStructureTextAlign;
typedef enum { POPPLER_STRUCTURE_BLOCK_ALIGN_BEFORE, POPPLER_STRUCTURE_BLOCK_ALIGN_MIDDLE, POPPLER_STRUCTURE_BLOCK_ALIGN_AFTER, POPPLER_STRUCTURE_BLOCK_ALIGN_JUSTIFY, } PopplerStructureBlockAlign;
typedef enum { POPPLER_STRUCTURE_INLINE_ALIGN_START, POPPLER_STRUCTURE_INLINE_ALIGN_CENTER, POPPLER_STRUCTURE_INLINE_ALIGN_END, } PopplerStructureInlineAlign;
typedef enum { POPPLER_STRUCTURE_TEXT_DECORATION_NONE, POPPLER_STRUCTURE_TEXT_DECORATION_UNDERLINE, POPPLER_STRUCTURE_TEXT_DECORATION_OVERLINE, POPPLER_STRUCTURE_TEXT_DECORATION_LINETHROUGH, } PopplerStructureTextDecoration;
typedef enum { POPPLER_STRUCTURE_RUBY_ALIGN_START, POPPLER_STRUCTURE_RUBY_ALIGN_CENTER, POPPLER_STRUCTURE_RUBY_ALIGN_END, POPPLER_STRUCTURE_RUBY_ALIGN_JUSTIFY, POPPLER_STRUCTURE_RUBY_ALIGN_DISTRIBUTE, } PopplerStructureRubyAlign;
typedef enum { POPPLER_STRUCTURE_RUBY_POSITION_BEFORE, POPPLER_STRUCTURE_RUBY_POSITION_AFTER, POPPLER_STRUCTURE_RUBY_POSITION_WARICHU, POPPLER_STRUCTURE_RUBY_POSITION_INLINE, } PopplerStructureRubyPosition;
typedef enum { POPPLER_STRUCTURE_GLYPH_ORIENTATION_AUTO, POPPLER_STRUCTURE_GLYPH_ORIENTATION_0 = POPPLER_STRUCTURE_GLYPH_ORIENTATION_AUTO, POPPLER_STRUCTURE_GLYPH_ORIENTATION_90, POPPLER_STRUCTURE_GLYPH_ORIENTATION_180, POPPLER_STRUCTURE_GLYPH_ORIENTATION_270, } PopplerStructureGlyphOrientation;
typedef enum { POPPLER_STRUCTURE_LIST_NUMBERING_NONE, POPPLER_STRUCTURE_LIST_NUMBERING_DISC, POPPLER_STRUCTURE_LIST_NUMBERING_CIRCLE, POPPLER_STRUCTURE_LIST_NUMBERING_SQUARE, POPPLER_STRUCTURE_LIST_NUMBERING_DECIMAL, POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ROMAN, POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ROMAN, POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ALPHA, POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ALPHA, } PopplerStructureListNumbering;
typedef enum { POPPLER_STRUCTURE_TABLE_SCOPE_ROW, POPPLER_STRUCTURE_TABLE_SCOPE_COLUMN, POPPLER_STRUCTURE_TABLE_SCOPE_BOTH, } PopplerStructureTableScope;
typedef enum { POPPLER_STRUCTURE_FORM_ROLE_UNDEFINED, POPPLER_STRUCTURE_FORM_ROLE_RADIO_BUTTON, POPPLER_STRUCTURE_FORM_ROLE_PUSH_BUTTON, POPPLER_STRUCTURE_FORM_ROLE_TEXT_VALUE, POPPLER_STRUCTURE_FORM_ROLE_CHECKBOX, } PopplerStructureFormRole;
typedef enum { POPPLER_STRUCTURE_FORM_STATE_ON, POPPLER_STRUCTURE_FORM_STATE_OFF, POPPLER_STRUCTURE_FORM_STATE_NEUTRAL, } PopplerStructureFormState;
PopplerStructureElementIter * poppler_structure_element_iter_new
(PopplerDocument *poppler_document
);
Returns the root PopplerStructureElementIter for document
, or NULL
. The
returned value must be freed with poppler_structure_element_iter_free()
.
Documents may have an associated structure tree &mdashmostly, Tagged-PDF compliant documents— which can be used to obtain information about the document structure and its contents. Each node in the tree contains a PopplerStructureElement.
Here is a simple example that walks the whole tree:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
static void walk_structure (PopplerStructureElementIter *iter) { do { /* Get the element and do something with it */ PopplerStructureElementIter *child = poppler_structure_element_iter_get_child (iter); if (child) walk_structure (child); poppler_structure_element_iter_free (child); } while (poppler_structure_element_iter_next (iter)); } ... { iter = poppler_structure_element_iter_new (document); walk_structure (iter); poppler_structure_element_iter_free (iter); } |
|
a PopplerDocument. |
Returns : |
a new PopplerStructureElementIter, or NULL if document
doesn't have structure tree. [transfer full]
|
Since 0.26
gboolean poppler_structure_element_iter_next (PopplerStructureElementIter *iter
);
Sets iter
to point to the next structure element at the current level
of the tree, if valid. See poppler_structure_element_iter_new()
for more
information.
|
a PopplerStructureElementIter |
Returns : |
TRUE , if iter was set to the next structure element |
Since 0.26
PopplerStructureElementIter * poppler_structure_element_iter_copy
(PopplerStructureElementIter *iter
);
Creates a new PopplerStructureElementIter as a copy of iter
. The
returned value must be freed with poppler_structure_element_iter_free()
.
|
a PopplerStructureElementIter |
Returns : |
a new PopplerStructureElementIter. [transfer full] |
Since 0.26
void poppler_structure_element_iter_free (PopplerStructureElementIter *iter
);
Frees iter
.
|
a PopplerStructureElementIter |
Since 0.26
PopplerStructureElementIter * poppler_structure_element_iter_get_child
(PopplerStructureElementIter *parent
);
Returns a new iterator to the children elements of the
PopplerStructureElement associated with iter
. The returned value must
be freed with poppler_structure_element_iter_free()
.
|
a PopplerStructureElementIter |
Returns : |
a new PopplerStructureElementIter |
Since 0.26
PopplerStructureElement * poppler_structure_element_iter_get_element
(PopplerStructureElementIter *iter
);
Returns the PopplerStructureElementIter associated with iter
.
|
a PopplerStructureElementIter |
Returns : |
a new PopplerStructureElementIter. [transfer full] |
Since 0.26
PopplerStructureElementKind poppler_structure_element_get_kind
(PopplerStructureElement *poppler_structure_element
);
|
A PopplerStructureElement |
Returns : |
A PopplerStructureElementKind value. |
Since 0.26
gint poppler_structure_element_get_page (PopplerStructureElement *poppler_structure_element
);
Obtains the page number in which the element is contained.
|
A PopplerStructureElement |
Returns : |
Number of the page that contains the element, of
-1 if not defined. |
Since 0.26
gboolean poppler_structure_element_is_content
(PopplerStructureElement *poppler_structure_element
);
Checks whether an element is actual document content.
|
A PopplerStructureElement |
Returns : |
TRUE if the element is content, or FALSE otherwise. |
Since 0.26
gboolean poppler_structure_element_is_inline (PopplerStructureElement *poppler_structure_element
);
Checks whether an element is an inline element.
|
A PopplerStructureElement |
Returns : |
TRUE if the element is an inline element, or FALSE otherwise. |
Since 0.26
gboolean poppler_structure_element_is_block (PopplerStructureElement *poppler_structure_element
);
Checks whether an element is a block element.
|
A PopplerStructureElement |
Returns : |
TRUE if the element is a block element, or FALSE otherwise. |
Since 0.26
gboolean poppler_structure_element_is_grouping
(PopplerStructureElement *poppler_structure_element
);
Checks whether an element is a grouping element.
|
A PopplerStructureElement |
Returns : |
TRUE if the element is a grouping element, FALSE
otherwise. |
Since 0.26
gchar * poppler_structure_element_get_id (PopplerStructureElement *poppler_structure_element
);
Obtains the identifier of an element.
|
A PopplerStructureElement |
Returns : |
The identifier of the element (if
defined), or NULL . [transfer full]
|
Since 0.26
gchar * poppler_structure_element_get_title (PopplerStructureElement *poppler_structure_element
);
Obtains the title of an element.
|
A PopplerStructureElement |
Returns : |
The title of the element, or NULL . [transfer full]
|
Since 0.26
gchar * poppler_structure_element_get_abbreviation
(PopplerStructureElement *poppler_structure_element
);
gchar * poppler_structure_element_get_language
(PopplerStructureElement *poppler_structure_element
);
Obtains the language and country code for the content in an element,
in two-letter ISO format, e.g. en_ES
, or NULL
if not
defined.
|
A PopplerStructureElement |
Returns : |
language and country code, or NULL . [transfer full]
|
Since 0.26
gchar * poppler_structure_element_get_text (PopplerStructureElement *poppler_structure_element
,PopplerStructureGetTextFlags flags
);
Obtains the text enclosed by an element, or the text enclosed by the elements in the subtree (including the element itself).
|
A PopplerStructureElement |
|
A PopplerStructureGetTextFlags value, or
POPPLER_STRUCTURE_GET_TEXT_NONE to disable all the flags. |
Returns : |
A string. [transfer full] |
Since 0.26
gchar * poppler_structure_element_get_alt_text
(PopplerStructureElement *poppler_structure_element
);
Obtains the “alternate” text representation of the element (and its child elements). This is mostly used for non-text elements like images and figures, to specify a textual description of the element.
Note that for elements containing proper text, the function
poppler_structure_element_get_text()
must be used instead.
|
A PopplerStructureElement |
Returns : |
The alternate text representation for the
element, or NULL if not defined. [transfer full]
|
Since 0.26
gchar * poppler_structure_element_get_actual_text
(PopplerStructureElement *poppler_structure_element
);
Obtains the actual text enclosed by the element (and its child elements). The actual text is mostly used for non-text elements like images and figures which <em>do</em> have the graphical appearance of text, like a logo. For those the actual text is the equivalent text to those graphical elements which look like text when rendered.
Note that for elements containing proper text, the function
poppler_structure_element_get_text()
must be used instead.
|
A PopplerStructureElement |
Returns : |
The actual text for the element, or NULL
if not defined. [transfer full]
|
Since 0.26
PopplerTextSpan ** poppler_structure_element_get_text_spans (PopplerStructureElement *poppler_structure_element
,guint *n_text_spans
);
Obtains the text enclosed by an element, as an array of PopplerTextSpan structures. Each item in the list is a piece of text which share the same attributes, plus its attributes. The following example shows how to obtain and free the text spans of an element:
1 2 3 4 5 6 7 |
guint i, n_spans; PopplerTextSpan **text_spans = poppler_structure_element_get_text_spans (element, &n_spans); /* Use the text spans */ for (i = 0; i < n_spans; i++) poppler_text_span_free (text_spans[i]); g_free (text_spans); |
|
A PopplerStructureElement |
|
A pointer to the location where the number of elements in the returned array will be stored. [out] |
Returns : |
An array of PopplerTextSpan elments. [transfer full][array length=n_text_spans][element-type PopplerTextSpan] |
Since 0.26
PopplerStructurePlacement poppler_structure_element_get_placement
(PopplerStructureElement *poppler_structure_element
);
Obtains the placement type of the structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructurePlacement value. |
Since 0.26
PopplerStructureWritingMode poppler_structure_element_get_writing_mode
(PopplerStructureElement *poppler_structure_element
);
Obtains the writing mode (writing direction) of the content associated with a structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureWritingMode value. |
Since 0.26
gboolean poppler_structure_element_get_background_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
);
Obtains the background color of the element. If this attribute is not specified, the element shall be treated as if it were transparent.
|
A PopplerStructureElement |
|
A PopplerColor. [out] |
Returns : |
TRUE if a color is defined for the element,
FALSE otherwise. |
Since 0.26
gboolean poppler_structure_element_get_border_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *colors
);
Obtains the color of border around the element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right). If this attribute is not specified, the border color for this element shall be the current text fill color in effect at the start of its associated content.
|
A PopplerStructureElement |
|
An array of four PopplerColor. [out][array fixed-size=4][element-type PopplerColor] |
Returns : |
TRUE if a color is defined for the element,
FALSE otherwise. |
Since 0.26
void poppler_structure_element_get_border_style (PopplerStructureElement *poppler_structure_element
,PopplerStructureBorderStyle *border_styles
);
Obtains the border style of a structure element. The result values are in before-after-start-end ordering. For example, using Western left-to-right writing, that is top-bottom-left-right.
|
A PopplerStructureElement |
|
An array of four PopplerStructureBorderStyle elements. [out][array fixed-size=4][element-type PopplerStructureBorderStyle] |
Since 0.26
gboolean poppler_structure_element_get_border_thickness (PopplerStructureElement *poppler_structure_element
,gdouble *border_thicknesses
);
Obtains the thickness of the border of an element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right). A value of 0 indicates that the border shall not be drawn.
|
A PopplerStructureElement |
|
Array with the four values of border thicknesses. [out][array fixed-size=4][element-type gdouble] |
Returns : |
TRUE if the border thickness attribute is defined for
the element, FALSE otherwise. |
Since 0.26
void poppler_structure_element_get_padding (PopplerStructureElement *poppler_structure_element
,gdouble *paddings
);
Obtains the padding of an element (space around it). The result values are in before-after-start-end ordering. For example using Western left-to-right writing, that is top-bottom-left-right.
|
A PopplerStructureElement |
|
Padding for the four sides of the element. [out][array fixed-size=4][element-type gdouble] |
Since 0.26
gboolean poppler_structure_element_get_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
);
Obtains the color of the content contained in the element. If this attribute is not specified, the color for this element shall be the current text fill color in effect at the start of its associated content.
|
A PopplerStructureElement |
|
A PopplerColor. [out] |
Returns : |
TRUE if a color is defined for the element,
FALSE otherwise. |
Since 0.26
gdouble poppler_structure_element_get_space_before
(PopplerStructureElement *poppler_structure_element
);
Obtains the amount of empty space before the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A positive value. |
Since 0.26
gdouble poppler_structure_element_get_space_after
(PopplerStructureElement *poppler_structure_element
);
Obtains the amount of empty space after the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A positive value. |
Since 0.26
gdouble poppler_structure_element_get_start_indent
(PopplerStructureElement *poppler_structure_element
);
Obtains the amount of indentation at the beginning of the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A numeric value. |
Since 0.26
gdouble poppler_structure_element_get_end_indent
(PopplerStructureElement *poppler_structure_element
);
Obtains the amount of indentation at the end of the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A numeric value. |
Since 0.26
gdouble poppler_structure_element_get_text_indent
(PopplerStructureElement *poppler_structure_element
);
Obtains the amount of indentation of the text contained in the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A numeric value. |
Since 0.26
PopplerStructureTextAlign poppler_structure_element_get_text_align
(PopplerStructureElement *poppler_structure_element
);
Obtains the text alignment mode of the text contained into a block-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureTextAlign value. |
Since 0.26
gboolean poppler_structure_element_get_bounding_box (PopplerStructureElement *poppler_structure_element
,PopplerRectangle *bounding_box
);
Obtains the size of the bounding box of a block-level structure element.
|
A PopplerStructureElement |
|
A PopplerRectangle. [out] |
Returns : |
TRUE if a bounding box is defined for the element,
FALSE otherwise. |
Since 0.26
gdouble poppler_structure_element_get_width (PopplerStructureElement *poppler_structure_element
);
Obtains the width of the block-level structure element. Note that for elements which do not specify a width, it has to be calculated, and in this case -1 is returned.
|
A PopplerStructureElement |
Returns : |
A positive value if a width is defined, or -1 if the width is to be calculated automatically. |
Since 0.26
gdouble poppler_structure_element_get_height
(PopplerStructureElement *poppler_structure_element
);
Obtains the height of the block-level structure element. Note that for elements which do not specify a height, it has to be calculated, and in this case -1 is returned.
|
A PopplerStructureElement |
Returns : |
A positive value if a width is defined, or -1 if the height is to be calculated automatically. |
Since 0.26
PopplerStructureBlockAlign poppler_structure_element_get_block_align
(PopplerStructureElement *poppler_structure_element
);
Obtains the block-alignment mode of the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureBlockAlign value. |
Since 0.26
PopplerStructureInlineAlign poppler_structure_element_get_inline_align
(PopplerStructureElement *poppler_structure_element
);
Obtains the inline-alignment mode of the block-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureInlineAlign value. |
Since 0.26
void poppler_structure_element_get_table_border_style (PopplerStructureElement *poppler_structure_element
,PopplerStructureBorderStyle *border_styles
);
Obtains the table cell border style of a block-level structure element. The result values are in before-after-start-end ordering. For example, using Western left-to-right writing, that is top-bottom-left-right.
|
A PopplerStructureElement |
|
An array of four PopplerStructureBorderStyle elements. [out][array fixed-size=4][element-type PopplerStructureBorderStyle] |
Since 0.26
void poppler_structure_element_get_table_padding (PopplerStructureElement *poppler_structure_element
,gdouble *paddings
);
Obtains the padding between the table cell’s content rectangle and the surrounding border of a block-level structure element. The result values are in before-after-start-end ordering (for the typical Western left-to-right writing, that is top-bottom-left-right).
|
A PopplerStructureElement |
|
Padding for the four sides of the element. [out][array fixed-size=4][element-type gdouble] |
Since 0.26
gdouble poppler_structure_element_get_baseline_shift
(PopplerStructureElement *poppler_structure_element
);
Obtains how much the text contained in the inline-level structure element should be shifted, measuring from the baseline of the glyphs.
|
A PopplerStructureElement |
Returns : |
A numeric value. |
Since 0.26
gdouble poppler_structure_element_get_line_height
(PopplerStructureElement *poppler_structure_element
);
Obtains the line height for the text contained in the inline-level structure element. Note that for elements which do not specify a line height, it has to be calculated, and in this case -1 is returned.
|
A PopplerStructureElement |
Returns : |
A positive value if a line height is defined, or -1 if the height is to be calculated automatically. |
Since 0.26
gboolean poppler_structure_element_get_text_decoration_color (PopplerStructureElement *poppler_structure_element
,PopplerColor *color
);
Obtains the color of the text decoration for the text contained in the inline-level structure element. If this attribute is not specified, the color for this element shall be the current fill color in effect at the start of its associated content.
|
A PopplerStructureElement |
|
A PopplerColor. [out] |
Returns : |
TRUE if a color is defined for the element,
FALSE otherwise. |
Since 0.26
gdouble poppler_structure_element_get_text_decoration_thickness
(PopplerStructureElement *poppler_structure_element
);
Obtains the thickness of the text decoration for the text contained in the inline-level structure element. If this attribute is not specified, it shall be derived from the current stroke thickness in effect at the start of the element’s associated content.
|
A PopplerStructureElement |
Returns : |
Thickness of the text decoration, or NaN if not defined. |
Since 0.26
PopplerStructureTextDecoration poppler_structure_element_get_text_decoration_type
(PopplerStructureElement *poppler_structure_element
);
Obtains the text decoration type of the text contained in the inline-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureTextDecoration value. |
Since 0.26
PopplerStructureRubyAlign poppler_structure_element_get_ruby_align
(PopplerStructureElement *poppler_structure_element
);
Obtains the alignment for the ruby text contained in a inline-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureRubyAlign value. |
Since 0.26
PopplerStructureRubyPosition poppler_structure_element_get_ruby_position
(PopplerStructureElement *poppler_structure_element
);
Obtains the position for the ruby text contained in a inline-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureRubyPosition value. |
Since 0.26
PopplerStructureGlyphOrientation poppler_structure_element_get_glyph_orientation
(PopplerStructureElement *poppler_structure_element
);
Obtains the glyph orientation for the text contained in a inline-level structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureGlyphOrientation value. |
Since 0.26
guint poppler_structure_element_get_column_count
(PopplerStructureElement *poppler_structure_element
);
Obtains the number of columns used to lay out the content contained in the grouping element.
|
A PopplerStructureElement |
Returns : |
Number of columns. |
Since 0.26
gdouble * poppler_structure_element_get_column_gaps (PopplerStructureElement *poppler_structure_element
,guint *n_values
);
Obtains the size of the gaps in between adjacent columns. Returns an array of elements: the first one is the size of the gap in between columns 1 and 2, second is the size between columns 2 and 3, and so on.
For elements which use a single column, NULL
is returned and n_values
is set to zero.
If the attribute is undefined, NULL
is returned and n_values
is set
to a non-zero value.
The array with the results is allocated by the function. When it is
not needed anymore, be sure to call g_free()
on it.
|
A PopplerStructureElement |
|
Size of the returned array. [out] |
Returns : |
Array containing the values for the column gaps, or NULL if the
array is empty or the attribute is not defined. [transfer full][array length=n_values][element-type gdouble]
|
Since 0.26
gdouble * poppler_structure_element_get_column_widths (PopplerStructureElement *poppler_structure_element
,guint *n_values
);
Obtains an array with the widths of the columns.
The array with the results is allocated by the function. When it is
not needed anymore, be sure to call g_free()
on it.
|
A PopplerStructureElement |
|
Size of the returned array. [out] |
Returns : |
Array containing widths of the columns, or NULL if the attribute
is not defined. [transfer full][array length=n_values][element-type gdouble]
|
Since 0.26
PopplerStructureListNumbering poppler_structure_element_get_list_numbering
(PopplerStructureElement *poppler_structure_element
);
Obtains the list numbering style for list items.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureListNumbering value. |
Since 0.26
PopplerStructureFormRole poppler_structure_element_get_form_role
(PopplerStructureElement *poppler_structure_element
);
Obtains the role of a form structure element that is part of a form, or is a form field. This hints how the control for the element is intended to be rendered.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureFormRole value. |
Since 0.26
PopplerStructureFormState poppler_structure_element_get_form_state
(PopplerStructureElement *poppler_structure_element
);
For a structure element that is a form field, obtains in which state the associated control is expected to be rendered.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureFormState value. |
Since 0.26
gchar * poppler_structure_element_get_form_description
(PopplerStructureElement *poppler_structure_element
);
Obtains the textual description of the form element. Note that the description is for informative purposes, and it is not intended to be rendered. For example, assistive technologies may use the description field to provide an alternate way of presenting an element to the user.
The returned string is allocated by the function. When it is
not needed anymore, be sure to call g_free()
on it.
|
A PopplerStructureElement |
Returns : |
A string, or NULL if the attribute
is not defined. [transfer full]
|
Since 0.26
guint poppler_structure_element_get_table_row_span
(PopplerStructureElement *poppler_structure_element
);
Obtains the number of rows the table element spans to.
|
A PopplerStructureElement |
Returns : |
A positive, non-zero value. |
Since 0.26
guint poppler_structure_element_get_table_column_span
(PopplerStructureElement *poppler_structure_element
);
Obtains the number of columns the table element spans to.
|
A PopplerStructureElement |
Returns : |
A positive, non-zero value. |
Since 0.26
gchar ** poppler_structure_element_get_table_headers
(PopplerStructureElement *poppler_structure_element
);
Obtains an array with the names of the table column headers. This is only useful for table header row elements.
The array with the results is allocated by the function. The number
of items in the returned array can be obtained with g_strv_length()
.
The returned value must be freed using g_strfreev()
.
|
A PopplerStructureElement |
Returns : |
Zero-terminated array of strings with the table header names,
or NULL if the attribute is not defined. [transfer full][array zero-terminated=1][element-type gchar*]
|
Since 0.26
PopplerStructureTableScope poppler_structure_element_get_table_scope
(PopplerStructureElement *poppler_structure_element
);
Obtains the scope of a table structure element.
|
A PopplerStructureElement |
Returns : |
A PopplerStructureScope value. |
Since 0.26
gchar * poppler_structure_element_get_table_summary
(PopplerStructureElement *poppler_structure_element
);
Obtains the textual summary of the contents of the table element. Note that the summary is meant for informative purposes, and it is not intended to be rendered. For example, assistive technologies may use the description field to provide an alternate way of presenting an element to the user, or a document indexer may want to scan it for additional keywords.
The returned string is allocated by the function. When it is
not needed anymore, be sure to call g_free()
on it.
|
A PopplerStructureElement |
Returns : |
A string, or NULL if the attribute
is not defined. [transfer full]
|
Since 0.26
PopplerTextSpan * poppler_text_span_copy (PopplerTextSpan *poppler_text_span
);
Makes a copy of a text span.
|
a PopplerTextSpan |
Returns : |
A new PopplerTextSpan. [transfer full] |
Since 0.26
void poppler_text_span_free (PopplerTextSpan *poppler_text_span
);
Frees a text span.
|
A PopplerTextSpan |
Since 0.26
gboolean poppler_text_span_is_fixed_width_font
(PopplerTextSpan *poppler_text_span
);
Check wether a text span is meant to be rendered using a fixed-width font.
|
a PopplerTextSpan |
Returns : |
Whether the span uses a fixed-width font. |
Since 0.26
gboolean poppler_text_span_is_serif_font (PopplerTextSpan *poppler_text_span
);
Check whether a text span is meant to be rendered using a serif font.
|
a PopplerTextSpan |
Returns : |
Whether the span uses a serif font. |
Since 0.26
gboolean poppler_text_span_is_bold_font (PopplerTextSpan *poppler_text_span
);
Check whether a text span is meant to be rendered using a bold font.
|
a PopplerTextSpan |
Returns : |
Whether the span uses bold font. |
Since 0.26
void poppler_text_span_get_color (PopplerTextSpan *poppler_text_span
,PopplerColor *color
);
Obtains the color in which the text is to be rendered.
|
a PopplerTextSpan |
|
a return location for a PopplerColor. [out] |
Since 0.26
const gchar * poppler_text_span_get_text (PopplerTextSpan *poppler_text_span
);
Obtains the text contained in the span.
|
a PopplerTextSpan |
Returns : |
A string. [transfer none] |
Since 0.26
const gchar * poppler_text_span_get_font_name (PopplerTextSpan *poppler_text_span
);
Obtains the name of the font in which the span is to be rendered.
|
a PopplerTextSpan |
Returns : |
A string containing the font name, or
NULL if a font is not defined. [transfer none]
|
Since 0.26