| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Poppler.Objects.Page
Contents
- Exported types
- Methods
- addAnnot
- findText
- findTextWithOptions
- freeAnnotMapping
- freeFormFieldMapping
- freeImageMapping
- freeLinkMapping
- freeTextAttributes
- getAnnotMapping
- getBoundingBox
- getCropBox
- getDuration
- getFormFieldMapping
- getImage
- getImageMapping
- getIndex
- getLabel
- getLinkMapping
- getSelectedRegion
- getSelectedText
- getSelectionRegion
- getSize
- getText
- getTextAttributes
- getTextAttributesForArea
- getTextForArea
- getTextLayout
- getTextLayoutForArea
- getThumbnail
- getThumbnailSize
- getTransition
- removeAnnot
- render
- renderForPrinting
- renderForPrintingWithOptions
- renderSelection
- renderToPs
- selectionRegionFree
- Properties
Description
No description available in the introspection data.
Synopsis
- newtype Page = Page (ManagedPtr Page)
- class (GObject o, IsDescendantOf Page o) => IsPage o
- toPage :: (MonadIO m, IsPage o) => o -> m Page
- pageAddAnnot :: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) => a -> b -> m ()
- pageFindText :: (HasCallStack, MonadIO m, IsPage a) => a -> Text -> m [Rectangle]
- pageFindTextWithOptions :: (HasCallStack, MonadIO m, IsPage a) => a -> Text -> [FindFlags] -> m [Rectangle]
- pageFreeAnnotMapping :: (HasCallStack, MonadIO m) => [AnnotMapping] -> m ()
- pageFreeFormFieldMapping :: (HasCallStack, MonadIO m) => [FormFieldMapping] -> m ()
- pageFreeImageMapping :: (HasCallStack, MonadIO m) => [ImageMapping] -> m ()
- pageFreeLinkMapping :: (HasCallStack, MonadIO m) => [LinkMapping] -> m ()
- pageFreeTextAttributes :: (HasCallStack, MonadIO m) => [TextAttributes] -> m ()
- pageGetAnnotMapping :: (HasCallStack, MonadIO m, IsPage a) => a -> m [AnnotMapping]
- pageGetBoundingBox :: (HasCallStack, MonadIO m, IsPage a) => a -> Rectangle -> m Bool
- pageGetCropBox :: (HasCallStack, MonadIO m, IsPage a) => a -> m Rectangle
- pageGetDuration :: (HasCallStack, MonadIO m, IsPage a) => a -> m Double
- pageGetFormFieldMapping :: (HasCallStack, MonadIO m, IsPage a) => a -> m [FormFieldMapping]
- pageGetImage :: (HasCallStack, MonadIO m, IsPage a) => a -> Int32 -> m Surface
- pageGetImageMapping :: (HasCallStack, MonadIO m, IsPage a) => a -> m [ImageMapping]
- pageGetIndex :: (HasCallStack, MonadIO m, IsPage a) => a -> m Int32
- pageGetLabel :: (HasCallStack, MonadIO m, IsPage a) => a -> m Text
- pageGetLinkMapping :: (HasCallStack, MonadIO m, IsPage a) => a -> m [LinkMapping]
- pageGetSelectedRegion :: (HasCallStack, MonadIO m, IsPage a) => a -> Double -> SelectionStyle -> Rectangle -> m Region
- pageGetSelectedText :: (HasCallStack, MonadIO m, IsPage a) => a -> SelectionStyle -> Rectangle -> m Text
- pageGetSelectionRegion :: (HasCallStack, MonadIO m, IsPage a) => a -> Double -> SelectionStyle -> Rectangle -> m [Rectangle]
- pageGetSize :: (HasCallStack, MonadIO m, IsPage a) => a -> m (Double, Double)
- pageGetText :: (HasCallStack, MonadIO m, IsPage a) => a -> m Text
- pageGetTextAttributes :: (HasCallStack, MonadIO m, IsPage a) => a -> m [TextAttributes]
- pageGetTextAttributesForArea :: (HasCallStack, MonadIO m, IsPage a) => a -> Rectangle -> m [TextAttributes]
- pageGetTextForArea :: (HasCallStack, MonadIO m, IsPage a) => a -> Rectangle -> m Text
- pageGetTextLayout :: (HasCallStack, MonadIO m, IsPage a) => a -> m (Bool, [Rectangle])
- pageGetTextLayoutForArea :: (HasCallStack, MonadIO m, IsPage a) => a -> Rectangle -> m (Bool, [Rectangle])
- pageGetThumbnail :: (HasCallStack, MonadIO m, IsPage a) => a -> m Surface
- pageGetThumbnailSize :: (HasCallStack, MonadIO m, IsPage a) => a -> m (Bool, Int32, Int32)
- pageGetTransition :: (HasCallStack, MonadIO m, IsPage a) => a -> m PageTransition
- pageRemoveAnnot :: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) => a -> b -> m ()
- pageRender :: (HasCallStack, MonadIO m, IsPage a) => a -> Context -> m ()
- pageRenderForPrinting :: (HasCallStack, MonadIO m, IsPage a) => a -> Context -> m ()
- pageRenderForPrintingWithOptions :: (HasCallStack, MonadIO m, IsPage a) => a -> Context -> [PrintFlags] -> m ()
- pageRenderSelection :: (HasCallStack, MonadIO m, IsPage a) => a -> Context -> Rectangle -> Rectangle -> SelectionStyle -> Color -> Color -> m ()
- pageRenderToPs :: (HasCallStack, MonadIO m, IsPage a, IsPSFile b) => a -> b -> m ()
- pageSelectionRegionFree :: (HasCallStack, MonadIO m) => [Rectangle] -> m ()
- getPageLabel :: (MonadIO m, IsPage o) => o -> m (Maybe Text)
Exported types
Memory-managed wrapper type.
Instances
| Eq Page Source # | |
| GObject Page Source # | |
Defined in GI.Poppler.Objects.Page | |
| ManagedPtrNewtype Page Source # | |
Defined in GI.Poppler.Objects.Page Methods toManagedPtr :: Page -> ManagedPtr Page | |
| TypedObject Page Source # | |
Defined in GI.Poppler.Objects.Page | |
| HasParentTypes Page Source # | |
Defined in GI.Poppler.Objects.Page | |
| IsGValue (Maybe Page) Source # | Convert |
Defined in GI.Poppler.Objects.Page Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Page -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Page) | |
| type ParentTypes Page Source # | |
Defined in GI.Poppler.Objects.Page type ParentTypes Page = '[Object] | |
class (GObject o, IsDescendantOf Page o) => IsPage o Source #
Instances
| (GObject o, IsDescendantOf Page o) => IsPage o Source # | |
Defined in GI.Poppler.Objects.Page | |
Methods
Click to display all available methods, including inherited ones
Methods
addAnnot, bindProperty, bindPropertyFull, findText, findTextWithOptions, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, removeAnnot, render, renderForPrinting, renderForPrintingWithOptions, renderSelection, renderToPs, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAnnotMapping, getBoundingBox, getCropBox, getData, getDuration, getFormFieldMapping, getImage, getImageMapping, getIndex, getLabel, getLinkMapping, getProperty, getQdata, getSelectedRegion, getSelectedText, getSelectionRegion, getSize, getText, getTextAttributes, getTextAttributesForArea, getTextForArea, getTextLayout, getTextLayoutForArea, getThumbnail, getThumbnailSize, getTransition.
Setters
addAnnot
Arguments
| :: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) | |
| => a |
|
| -> b |
|
| -> m () |
Adds annotation annot to page.
Since: 0.16
findText
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Text |
|
| -> m [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 |
|
| -> Text |
|
| -> [FindFlags] |
|
| -> m [Rectangle] | Returns: a newly allocated list
of newly allocated |
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.
When FindFlagsMultiline is passed in options, matches may span more than
one line. In this case, the returned list will contain one Rectangle
for each part of a match. The function rectangleFindGetMatchContinued
will return True for all rectangles belonging to the same match, except for
the last one. If a hyphen was ignored at the end of the part of the match,
rectangleFindGetIgnoredHyphen will return True for that
rectangle.
Note that currently matches spanning more than two lines are not found. (This limitation may be lifted in a future version.)
Note also that currently finding multi-line matches backwards is not
implemented; if you pass FindFlagsBackwards and FindFlagsMultiline
together, FindFlagsMultiline will be ignored.
Since: 0.22
freeAnnotMapping
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [AnnotMapping] |
|
| -> m () |
Frees a list of AnnotMappings allocated by
pageGetAnnotMapping. It also unreferences the Annots
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] |
|
| -> m () |
Frees a list of FormFieldMappings allocated by
pageGetFormFieldMapping.
freeImageMapping
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [ImageMapping] |
|
| -> m () |
Frees a list of ImageMappings allocated by
pageGetImageMapping.
freeLinkMapping
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [LinkMapping] |
|
| -> m () |
Frees a list of LinkMappings allocated by
pageGetLinkMapping. It also frees the Actions
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] |
|
| -> m () |
Frees a list of TextAttributess allocated by
pageGetTextAttributes.
Since: 0.18
getAnnotMapping
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m [AnnotMapping] | Returns: A |
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.
getBoundingBox
pageGetBoundingBox :: (HasCallStack, MonadIO m, IsPage a) => a -> Rectangle -> m Bool Source #
No description available in the introspection data.
getCropBox
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Rectangle |
Retrurns the crop box of page
getDuration
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Double | Returns: duration in seconds of |
Returns the duration of page
getFormFieldMapping
pageGetFormFieldMapping Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m [FormFieldMapping] | Returns: A |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Int32 |
|
| -> m Surface | Returns: A cairo surface for the image |
Returns a cairo surface for the image of the page
getImageMapping
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m [ImageMapping] | Returns: A |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Int32 | Returns: index value of |
Returns the index of page
getLabel
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Text | Returns: a new allocated string containing the label of |
Returns the label of page. Note that page labels
and page indices might not coincide.
Since: 0.16
getLinkMapping
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m [LinkMapping] | Returns: A |
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 |
|
| -> Double |
|
| -> SelectionStyle |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> SelectionStyle |
|
| -> Rectangle |
|
| -> m Text | Returns: a pointer to the contents of the |
Retrieves the contents of the specified selection as text.
Since: 0.16
getSelectionRegion
pageGetSelectionRegion Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Double |
|
| -> SelectionStyle |
|
| -> Rectangle |
|
| -> m [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
Gets the size of page at the current scale and rotation.
getText
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Text | Returns: a pointer to the text of the |
Retrieves the text of page.
Since: 0.16
getTextAttributes
pageGetTextAttributes Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m [TextAttributes] | Returns: A |
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 |
|
| -> Rectangle |
|
| -> m [TextAttributes] | Returns: A |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => 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
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 |
|
| -> Rectangle |
|
| -> m (Bool, [Rectangle]) |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m Surface | Returns: the tumbnail as a cairo_surface_t or |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m (Bool, Int32, Int32) | Returns: |
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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> m PageTransition | Returns: a |
Returns the transition effect of page
removeAnnot
Arguments
| :: (HasCallStack, MonadIO m, IsPage a, IsAnnot b) | |
| => a |
|
| -> b |
|
| -> m () |
Removes annotation annot from page
Since: 0.22
render
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Context |
|
| -> 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. Please see the documentation
for that function for the differences between rendering to the screen and
rendering to a printer.
renderForPrinting
pageRenderForPrinting Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Context |
|
| -> m () |
Render the page to the given cairo context for printing with
POPPLER_PRINT_ALL flags selected. If you want a different set of flags,
use pageRenderForPrintingWithOptions.
The difference between pageRender and this function is that some
things get rendered differently between screens and printers:
<itemizedlist>
<listitem>
PDF annotations get rendered according to their AnnotFlag value.
For example, POPPLER_ANNOT_FLAG_PRINT refers to whether an annotation
is printed or not, whereas POPPLER_ANNOT_FLAG_NO_VIEW refers to whether
an annotation is invisible when displaying to the screen.
</listitem>
<listitem>
PDF supports "hairlines" of width 0.0, which often get rendered as
having a width of 1 device pixel. When displaying on a screen, Cairo
may render such lines wide so that they are hard to see, and Poppler
makes use of PDF's Stroke Adjust graphics parameter to make the lines
easier to see. However, when printing, Poppler is able to directly use a
printer's pixel size instead.
</listitem>
<listitem>
Some advanced features in PDF may require an image to be rasterized
before sending off to a printer. This may produce raster images which
exceed Cairo's limits. The "printing" functions will detect this condition
and try to down-scale the intermediate surfaces as appropriate.
</listitem>
</itemizedlist>
renderForPrintingWithOptions
pageRenderForPrintingWithOptions Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Context |
|
| -> [PrintFlags] |
|
| -> m () |
Render the page to the given cairo context for printing with the specified options
See the documentation for pageRenderForPrinting for the
differences between rendering to the screen and rendering to a printer.
Since: 0.16
renderSelection
Arguments
| :: (HasCallStack, MonadIO m, IsPage a) | |
| => a |
|
| -> Context |
|
| -> Rectangle |
|
| -> Rectangle |
|
| -> SelectionStyle |
|
| -> Color |
|
| -> Color |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsPage a, IsPSFile b) | |
| => a |
|
| -> b |
|
| -> m () |
Render the page on a postscript file
selectionRegionFree
pageSelectionRegionFree Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [Rectangle] | |
| -> m () |
Deprecated: (Since version 0.16)Use only to free deprecated regions created bypageGetSelectionRegion. Regions created bypageGetSelectedRegion should be freed withcairo_region_destroy() instead.
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