Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.Poppler.Objects.Document
Contents
- Exported types
- Methods
- findDest
- getAttachments
- getAuthor
- getCreationDate
- getCreator
- getFormField
- getId
- getKeywords
- getMetadata
- getModificationDate
- getNAttachments
- getNPages
- getPage
- getPageByLabel
- getPageLayout
- getPageMode
- getPdfVersion
- getPdfVersionString
- getPermissions
- getProducer
- getSubject
- getTitle
- hasAttachments
- isLinearized
- newFromData
- newFromFile
- newFromGfile
- newFromStream
- save
- saveACopy
- setAuthor
- setCreationDate
- setCreator
- setKeywords
- setModificationDate
- setProducer
- setSubject
- setTitle
- Properties
Description
- newtype Document = Document (ManagedPtr Document)
- class GObject o => IsDocument o
- toDocument :: (MonadIO m, IsDocument o) => o -> m Document
- noDocument :: Maybe Document
- documentFindDest :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m Dest
- documentGetAttachments :: (HasCallStack, MonadIO m, IsDocument a) => a -> m [Attachment]
- documentGetAuthor :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetCreationDate :: (HasCallStack, MonadIO m, IsDocument a) => a -> m CLong
- documentGetCreator :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetFormField :: (HasCallStack, MonadIO m, IsDocument a) => a -> Int32 -> m FormField
- documentGetId :: (HasCallStack, MonadIO m, IsDocument a) => a -> m (Bool, Text, Text)
- documentGetKeywords :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetMetadata :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetModificationDate :: (HasCallStack, MonadIO m, IsDocument a) => a -> m CLong
- documentGetNAttachments :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Word32
- documentGetNPages :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Int32
- documentGetPage :: (HasCallStack, MonadIO m, IsDocument a) => a -> Int32 -> m Page
- documentGetPageByLabel :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m Page
- documentGetPageLayout :: (HasCallStack, MonadIO m, IsDocument a) => a -> m PageLayout
- documentGetPageMode :: (HasCallStack, MonadIO m, IsDocument a) => a -> m PageMode
- documentGetPdfVersion :: (HasCallStack, MonadIO m, IsDocument a) => a -> m (Word32, Word32)
- documentGetPdfVersionString :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetPermissions :: (HasCallStack, MonadIO m, IsDocument a) => a -> m [Permissions]
- documentGetProducer :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetSubject :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentGetTitle :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Text
- documentHasAttachments :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Bool
- documentIsLinearized :: (HasCallStack, MonadIO m, IsDocument a) => a -> m Bool
- documentNewFromData :: (HasCallStack, MonadIO m) => Text -> Int32 -> Maybe Text -> m Document
- documentNewFromFile :: (HasCallStack, MonadIO m) => Text -> Maybe Text -> m Document
- documentNewFromGfile :: (HasCallStack, MonadIO m, IsFile a, IsCancellable b) => a -> Maybe Text -> Maybe b -> m Document
- documentNewFromStream :: (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) => a -> Int64 -> Maybe Text -> Maybe b -> m Document
- documentSave :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSaveACopy :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetAuthor :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetCreationDate :: (HasCallStack, MonadIO m, IsDocument a) => a -> CLong -> m ()
- documentSetCreator :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetKeywords :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetModificationDate :: (HasCallStack, MonadIO m, IsDocument a) => a -> CLong -> m ()
- documentSetProducer :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetSubject :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- documentSetTitle :: (HasCallStack, MonadIO m, IsDocument a) => a -> Text -> m ()
- constructDocumentAuthor :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- constructDocumentCreationDate :: IsDocument o => Int32 -> IO (GValueConstruct o)
- getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32
- setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
- constructDocumentCreator :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentCreator :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32
- getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32
- constructDocumentKeywords :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool
- getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- constructDocumentModDate :: IsDocument o => Int32 -> IO (GValueConstruct o)
- getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32
- setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m ()
- getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m PageLayout
- getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m PageMode
- getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Permissions]
- constructDocumentProducer :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentProducer :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- constructDocumentSubject :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentSubject :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- constructDocumentTitle :: IsDocument o => Text -> IO (GValueConstruct o)
- getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe Text)
- setDocumentTitle :: (MonadIO m, IsDocument o) => o -> Text -> m ()
- getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [ViewerPreferences]
Exported types
Constructors
Document (ManagedPtr Document) |
class GObject o => IsDocument o Source #
Instances
(GObject a, UnknownAncestorError Constraint Document a) => IsDocument a Source # | |
IsDocument Document Source # | |
toDocument :: (MonadIO m, IsDocument o) => o -> m Document Source #
Methods
findDest
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m Dest | Returns: The |
Finds named destination linkName
in document
getAttachments
documentGetAttachments Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m [Attachment] | Returns: a list of available attachments. |
Returns a List
containing Attachment
<!-- -->s. These attachments
are unowned, and must be unreffed, and the list must be freed with
g_list_free()
.
getAuthor
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the author
of |
Returns the author of the document
Since: 0.16
getCreationDate
documentGetCreationDate Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m CLong | Returns: the date the document was created, or -1 |
Returns the date the document was created as seconds since the Epoch
Since: 0.16
getCreator
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the creator
of |
Returns the creator of the document. If the document was converted from another format, the creator is the name of the product that created the original document from which it was converted.
Since: 0.16
getFormField
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Int32 |
|
-> m FormField |
Returns the FormField
for the given id
. It must be freed with
objectUnref
getId
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m (Bool, Text, Text) | Returns: |
Returns the PDF file identifier represented as two byte string arrays of size 32.
permanentId
is the permanent identifier that is built based on the file
contents at the time it was originally created, so that this identifer
never changes. updateId
is the update identifier that is built based on
the file contents at the time it was last updated.
Note that returned strings are not null-terminated, they have a fixed size of 32 bytes.
Since: 0.16
getKeywords
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing keywords associated
to |
Returns the keywords associated to the document
Since: 0.16
getMetadata
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the XML
metadata, or |
Returns the XML metadata string of the document
Since: 0.16
getModificationDate
documentGetModificationDate Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m CLong | Returns: the date the document was most recently modified, or -1 |
Returns the date the document was most recently modified as seconds since the Epoch
Since: 0.16
getNAttachments
documentGetNAttachments Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Word32 | Returns: Number of attachments |
Returns the number of attachments in a loaded document.
See also documentGetAttachments
Since: 0.18
getNPages
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Int32 | Returns: Number of pages |
Returns the number of pages in a loaded document.
getPage
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Int32 |
|
-> m Page | Returns: The |
Returns the Page
indexed at index
. This object is owned by the
caller.
getPageByLabel
documentGetPageByLabel Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m Page | Returns: The |
Returns the Page
reference by label
. This object is owned by the
caller. label
is a human-readable string representation of the page number,
and can be document specific. Typically, it is a value such as "iii" or "3".
By default, "1" refers to the first page.
getPageLayout
documentGetPageLayout Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m PageLayout | Returns: a |
Returns the page layout that should be used when the document is opened
Since: 0.16
getPageMode
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m PageMode | Returns: a |
Returns a PageMode
representing how the document should
be initially displayed when opened.
Since: 0.16
getPdfVersion
documentGetPdfVersion Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m (Word32, Word32) |
No description available in the introspection data.
Since: 0.16
getPdfVersionString
documentGetPdfVersionString Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the PDF version
of |
Returns the PDF version of document
as a string (e.g. PDF-1.6)
Since: 0.16
getPermissions
documentGetPermissions Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m [Permissions] | Returns: a set of falgs from |
Returns the flags specifying which operations are permitted when the document is opened.
Since: 0.16
getProducer
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the producer
of |
Returns the producer of the document. If the document was converted from another format, the producer is the name of the product that converted it to PDF
Since: 0.16
getSubject
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the subject
of |
Returns the subject of the document
Since: 0.16
getTitle
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Text | Returns: a new allocated string containing the title
of |
Returns the document's title
Since: 0.16
hasAttachments
documentHasAttachments Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
of document
has any attachments.
isLinearized
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> m Bool |
Returns whether document
is linearized or not. Linearization of PDF
enables efficient incremental access of the PDF file in a network environment.
Since: 0.16
newFromData
newFromFile
newFromGfile
Arguments
:: (HasCallStack, MonadIO m, IsFile a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> Maybe b |
|
-> m Document |
Creates a new Document
reading the PDF contents from file
.
Possible errors include those in the POPPLER_ERROR
and G_FILE_ERROR
domains.
Since: 0.22
newFromStream
documentNewFromStream Source #
Arguments
:: (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) | |
=> a |
|
-> Int64 |
|
-> Maybe Text |
|
-> Maybe b |
|
-> m Document |
Creates a new Document
reading the PDF contents from stream
.
Note that the given InputStream
must be seekable or IOErrorEnumNotSupported
will be returned.
Possible errors include those in the POPPLER_ERROR
and G_FILE_ERROR
domains.
Since: 0.22
save
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Saves document
. Any change made in the document such as
form fields filled, annotations added or modified
will be saved.
If error
is set, False
will be returned. Possible errors
include those in the G_FILE_ERROR
domain.
saveACopy
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Saves a copy of the original document
.
Any change made in the document such as
form fields filled by the user will not be saved.
If error
is set, False
will be returned. Possible errors
include those in the G_FILE_ERROR
domain.
setAuthor
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's author. If author
is Nothing
, Author
entry is removed from the document's Info dictionary.
Since: 0.46
setCreationDate
documentSetCreationDate Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> CLong |
|
-> m () |
Sets the document's creation date. If creationDate
is -1, CreationDate
entry is removed from the document's Info dictionary.
Since: 0.46
setCreator
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's creator. If creator
is Nothing
, Creator
entry is removed from the document's Info dictionary.
Since: 0.46
setKeywords
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's keywords. If keywords
is Nothing
,
Keywords entry is removed from the document's Info dictionary.
Since: 0.46
setModificationDate
documentSetModificationDate Source #
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> CLong |
|
-> m () |
Sets the document's modification date. If modificationDate
is -1, ModDate
entry is removed from the document's Info dictionary.
Since: 0.46
setProducer
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's producer. If producer
is Nothing
,
Producer entry is removed from the document's Info dictionary.
Since: 0.46
setSubject
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's subject. If subject
is Nothing
, Subject
entry is removed from the document's Info dictionary.
Since: 0.46
setTitle
Arguments
:: (HasCallStack, MonadIO m, IsDocument a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the document's title. If title
is Nothing
, Title entry
is removed from the document's Info dictionary.
Since: 0.46
Properties
author
constructDocumentAuthor :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
creationDate
constructDocumentCreationDate :: IsDocument o => Int32 -> IO (GValueConstruct o) Source #
getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32 Source #
setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m () Source #
creator
constructDocumentCreator :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentCreator :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
format
getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
formatMajor
getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32 Source #
formatMinor
getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32 Source #
keywords
constructDocumentKeywords :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
linearized
getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool Source #
metadata
getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
modDate
constructDocumentModDate :: IsDocument o => Int32 -> IO (GValueConstruct o) Source #
getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32 Source #
setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m () Source #
pageLayout
getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m PageLayout Source #
pageMode
getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m PageMode Source #
permissions
getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Permissions] Source #
producer
constructDocumentProducer :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentProducer :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
subject
constructDocumentSubject :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentSubject :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
title
constructDocumentTitle :: IsDocument o => Text -> IO (GValueConstruct o) Source #
getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #
setDocumentTitle :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #
viewerPreferences
getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [ViewerPreferences] Source #