gi-poppler-0.18.20: Poppler bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Poppler.Objects.Page

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype Page Source #

Memory-managed wrapper type.

Constructors

Page (ManagedPtr Page) 
Instances
GObject Page Source # 
Instance details

Defined in GI.Poppler.Objects.Page

Methods

gobjectType :: IO GType #

HasParentTypes Page Source # 
Instance details

Defined in GI.Poppler.Objects.Page

type ParentTypes Page Source # 
Instance details

Defined in GI.Poppler.Objects.Page

type ParentTypes Page = Object ': ([] :: [Type])

class (GObject o, IsDescendantOf Page o) => IsPage o Source #

Type class for types which can be safely cast to Page, for instance with toPage.

Instances
(GObject o, IsDescendantOf Page o) => IsPage o Source # 
Instance details

Defined in GI.Poppler.Objects.Page

toPage :: (MonadIO m, IsPage o) => o -> m Page Source #

Cast to Page, for types for which this is known to be safe. For general casts, use castTo.

noPage :: Maybe Page Source #

A convenience alias for Nothing :: Maybe Page.

Methods

addAnnot

pageAddAnnot Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) 
=> a

page: a Page

-> b

annot: a Annot to add

-> m () 

Adds annotation annot to page.

Since: 0.16

findText

pageFindText Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> Text

text: the text to search for (UTF-8 encoded)

-> m [Rectangle]

Returns: a List of Rectangle,

Finds text in page with the default options (FindFlagsDefault) and returns a List of rectangles for each occurrence of the text on the page. The coordinates are in PDF points.

findTextWithOptions

pageFindTextWithOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> Text

text: the text to search for (UTF-8 encoded)

-> [FindFlags]

options: find options

-> m [Rectangle]

Returns: a List of Rectangle,

Finds text in page with the given FindFlags options and returns a List of rectangles for each occurrence of the text on the page. The coordinates are in PDF points.

Since: 0.22

freeAnnotMapping

pageFreeAnnotMapping Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [AnnotMapping]

list: A list of AnnotMapping<!-- -->s

-> m () 

Frees a list of AnnotMapping<!-- -->s allocated by pageGetAnnotMapping. It also unreferences the Annot<!-- -->s that each mapping contains, so if you want to keep them around, you need to reference them with objectRef.

freeFormFieldMapping

pageFreeFormFieldMapping Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [FormFieldMapping]

list: A list of FormFieldMapping<!-- -->s

-> m () 

Frees a list of FormFieldMapping<!-- -->s allocated by pageGetFormFieldMapping.

freeImageMapping

pageFreeImageMapping Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [ImageMapping]

list: A list of ImageMapping<!-- -->s

-> m () 

Frees a list of ImageMapping<!-- -->s allocated by pageGetImageMapping.

freeLinkMapping

pageFreeLinkMapping Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [LinkMapping]

list: A list of LinkMapping<!-- -->s

-> m () 

Frees a list of LinkMapping<!-- -->s allocated by pageGetLinkMapping. It also frees the Action<!-- -->s that each mapping contains, so if you want to keep them around, you need to copy them with actionCopy.

freeTextAttributes

pageFreeTextAttributes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [TextAttributes]

list: A list of TextAttributes<!-- -->s

-> m () 

Frees a list of TextAttributes<!-- -->s allocated by pageGetTextAttributes.

Since: 0.18

getAnnotMapping

pageGetAnnotMapping Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m [AnnotMapping]

Returns: A List of AnnotMapping

Returns a list of AnnotMapping items that map from a location on page to a Annot. This list must be freed with pageFreeAnnotMapping when done.

getCropBox

pageGetCropBox Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m Rectangle 

Retrurns the crop box of page

getDuration

pageGetDuration Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m Double

Returns: duration in seconds of page or -1.

Returns the duration of page

getFormFieldMapping

pageGetFormFieldMapping Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m [FormFieldMapping]

Returns: A List of FormFieldMapping

Returns a list of FormFieldMapping items that map from a location on page to a form field. This list must be freed with pageFreeFormFieldMapping when done.

getImage

pageGetImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> Int32

imageId: The image identifier

-> m Surface

Returns: A cairo surface for the image

Returns a cairo surface for the image of the page

getImageMapping

pageGetImageMapping Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m [ImageMapping]

Returns: A List of ImageMapping

Returns a list of ImageMapping items that map from a location on page to an image of the page. This list must be freed with pageFreeImageMapping when done.

getIndex

pageGetIndex Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m Int32

Returns: index value of page

Returns the index of page

getLabel

pageGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m Text

Returns: a new allocated string containing the label of page, or Nothing if page doesn't have a label

Returns the label of page. Note that page labels and page indices might not coincide.

Since: 0.16

getLinkMapping

pageGetLinkMapping Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m [LinkMapping]

Returns: A List of LinkMapping

Returns a list of LinkMapping items that map from a location on page to a Action. This list must be freed with pageFreeLinkMapping when done.

getSelectedRegion

pageGetSelectedRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> Double

scale: scale specified as pixels per point

-> SelectionStyle

style: a SelectionStyle

-> Rectangle

selection: start and end point of selection as a rectangle

-> m Region

Returns: a cairo_region_t

Returns a region containing the area that would be rendered by pageRenderSelection. The returned region must be freed with cairo_region_destroy()

Since: 0.16

getSelectedText

pageGetSelectedText Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> SelectionStyle

style: a SelectionStyle

-> Rectangle

selection: the Rectangle including the text

-> m Text

Returns: a pointer to the contents of the selection as a string

Retrieves the contents of the specified selection as text.

Since: 0.16

getSelectionRegion

pageGetSelectionRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> Double

scale: scale specified as pixels per point

-> SelectionStyle

style: a SelectionStyle

-> Rectangle

selection: start and end point of selection as a rectangle

-> m [Rectangle]

Returns: a List of Rectangle

Deprecated: (Since version 0.16)Use pageGetSelectedRegion instead.

Returns a region containing the area that would be rendered by pageRenderSelection as a List of Rectangle. The returned list must be freed with pageSelectionRegionFree.

getSize

pageGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m (Double, Double) 

Gets the size of page at the current scale and rotation.

getText

pageGetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m Text

Returns: a pointer to the text of the page as a string

Retrieves the text of page.

Since: 0.16

getTextAttributes

pageGetTextAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m [TextAttributes]

Returns: A List of TextAttributes

Obtains the attributes of the text as a List of TextAttributes. This list must be freed with pageFreeTextAttributes when done.

Each list element is a TextAttributes struct where start_index and end_index indicates the range of text (as returned by pageGetText) to which text attributes apply.

See also pageGetTextAttributesForArea

Since: 0.18

getTextAttributesForArea

pageGetTextAttributesForArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> Rectangle

area: a Rectangle

-> m [TextAttributes]

Returns: A List of TextAttributes

Obtains the attributes of the text in area as a List of TextAttributes. This list must be freed with pageFreeTextAttributes when done.

Each list element is a TextAttributes struct where start_index and end_index indicates the range of text (as returned by pageGetTextForArea) to which text attributes apply.

Since: 0.26

getTextForArea

pageGetTextForArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> Rectangle

area: a Rectangle

-> m Text

Returns: a pointer to the text as a string

Retrieves the text of page contained in area.

Since: 0.26

getTextLayout

pageGetTextLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m (Bool, [Rectangle])

Returns: True if the page contains text, False otherwise

Obtains the layout of the text as a list of Rectangle This array must be freed with free when done.

The position in the array represents an offset in the text returned by pageGetText

See also pageGetTextLayoutForArea.

Since: 0.16

getTextLayoutForArea

pageGetTextLayoutForArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> Rectangle

area: a Rectangle

-> m (Bool, [Rectangle])

Returns: True if the page contains text, False otherwise

Obtains the layout of the text contained in area as a list of Rectangle This array must be freed with free when done.

The position in the array represents an offset in the text returned by pageGetTextForArea

Since: 0.26

getThumbnail

pageGetThumbnail Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: the Page to get the thumbnail for

-> m Surface

Returns: the tumbnail as a cairo_surface_t or Nothing if the document doesn't have a thumbnail for this page.

Get the embedded thumbnail for the specified page. If the document doesn't have an embedded thumbnail for the page, this function returns Nothing.

getThumbnailSize

pageGetThumbnailSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: A Page

-> m (Bool, Int32, Int32)

Returns: True, if page has a thumbnail associated with it.

Returns True if page has a thumbnail associated with it. It also fills in width and height with the width and height of the thumbnail. The values of width and height are not changed if no appropriate thumbnail exists.

getTransition

pageGetTransition Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: a Page

-> m PageTransition

Returns: a PageTransition or Nothing.

Returns the transition effect of page

removeAnnot

pageRemoveAnnot Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) 
=> a

page: a Page

-> b

annot: a Annot to remove

-> m () 

Removes annotation annot from page

Since: 0.22

render

pageRender Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: the page to render from

-> Context

cairo: cairo context to render to

-> m () 

Render the page to the given cairo context. This function is for rendering a page that will be displayed. If you want to render a page that will be printed use pageRenderForPrinting instead

renderForPrinting

pageRenderForPrinting Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: the page to render from

-> Context

cairo: cairo context to render to

-> m () 

Render the page to the given cairo context for printing.

renderForPrintingWithOptions

pageRenderForPrintingWithOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: the page to render from

-> Context

cairo: cairo context to render to

-> [PrintFlags]

options: print options

-> m () 

Render the page to the given cairo context for printing with the specified options

Since: 0.16

renderSelection

pageRenderSelection Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a) 
=> a

page: the Page for which to render selection

-> Context

cairo: cairo context to render to

-> Rectangle

selection: start and end point of selection as a rectangle

-> Rectangle

oldSelection: previous selection

-> SelectionStyle

style: a SelectionStyle

-> Color

glyphColor: color to use for drawing glyphs

-> Color

backgroundColor: color to use for the selection background

-> m () 

Render the selection specified by selection for page to the given cairo context. The selection will be rendered, using glyphColor for the glyphs and backgroundColor for the selection background.

If non-NULL, oldSelection specifies the selection that is already rendered to cairo, in which case this function will (some day) only render the changed part of the selection.

renderToPs

pageRenderToPs Source #

Arguments

:: (HasCallStack, MonadIO m, IsPage a, IsPSFile b) 
=> a

page: a Page

-> b

psFile: the PopplerPSFile to render to

-> m () 

Render the page on a postscript file

selectionRegionFree

pageSelectionRegionFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Rectangle]

region: a List of Rectangle

-> m () 

Deprecated: (Since version 0.16)

Frees region

Properties

label

The label of the page or Nothing. See also pageGetLabel

getPageLabel :: (MonadIO m, IsPage o) => o -> m (Maybe Text) Source #

Get the value of the “label” property. When overloading is enabled, this is equivalent to

get page #label