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.Document

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype Document Source #

Memory-managed wrapper type.

Constructors

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

Defined in GI.Poppler.Objects.Document

Methods

gobjectType :: IO GType #

HasParentTypes Document Source # 
Instance details

Defined in GI.Poppler.Objects.Document

type ParentTypes Document Source # 
Instance details

Defined in GI.Poppler.Objects.Document

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

class (GObject o, IsDescendantOf Document o) => IsDocument o Source #

Type class for types which can be safely cast to Document, for instance with toDocument.

Instances
(GObject o, IsDescendantOf Document o) => IsDocument o Source # 
Instance details

Defined in GI.Poppler.Objects.Document

toDocument :: (MonadIO m, IsDocument o) => o -> m Document Source #

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

noDocument :: Maybe Document Source #

A convenience alias for Nothing :: Maybe Document.

Methods

findDest

documentFindDest Source #

Arguments

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

document: A Document

-> Text

linkName: a named destination

-> m Dest

Returns: a new Dest destination, or Nothing if linkName is not a destination.

Creates a Dest for the named destination linkName in document.

Note that named destinations are bytestrings, not string. That means that unless linkName was returned by a poppler function (e.g. is Dest.named_dest), it needs to be converted to string using namedDestFromBytestring before being passed to this function.

The returned value must be freed with destFree.

getAttachments

documentGetAttachments Source #

Arguments

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

document: A Document

-> 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

documentGetAuthor Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the author of document, or Nothing

Returns the author of the document

Since: 0.16

getCreationDate

documentGetCreationDate Source #

Arguments

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

document: A Document

-> 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

documentGetCreator Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the creator of document, or Nothing

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

documentGetFormField Source #

Arguments

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

document: a Document

-> Int32

id: an id of a FormField

-> m FormField

Returns: a new FormField or Nothing if not found

Returns the FormField for the given id. It must be freed with objectUnref

getId

documentGetId Source #

Arguments

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

document: A Document

-> m (Bool, Text, Text)

Returns: True if the document contains an id, False otherwise

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

documentGetKeywords Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing keywords associated to document, or Nothing

Returns the keywords associated to the document

Since: 0.16

getMetadata

documentGetMetadata Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the XML metadata, or Nothing

Returns the XML metadata string of the document

Since: 0.16

getModificationDate

documentGetModificationDate Source #

Arguments

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

document: A Document

-> 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

document: A Document

-> m Word32

Returns: Number of attachments

Returns the number of attachments in a loaded document. See also documentGetAttachments

Since: 0.18

getNPages

documentGetNPages Source #

Arguments

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

document: A Document

-> m Int32

Returns: Number of pages

Returns the number of pages in a loaded document.

getPage

documentGetPage Source #

Arguments

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

document: A Document

-> Int32

index: a page index

-> m Page

Returns: The Page at index

Returns the Page indexed at index. This object is owned by the caller.

getPageByLabel

documentGetPageByLabel Source #

Arguments

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

document: A Document

-> Text

label: a page label

-> m Page

Returns: The Page referenced by label

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

document: A Document

-> m PageLayout

Returns: a PageLayout that should be used when the document is opened

Returns the page layout that should be used when the document is opened

Since: 0.16

getPageMode

documentGetPageMode Source #

Arguments

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

document: A Document

-> m PageMode

Returns: a PageMode that should be used when document is opened

Returns a PageMode representing how the document should be initially displayed when opened.

Since: 0.16

getPdfConformance

documentGetPdfConformance Source #

Arguments

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

document: A Document

-> m PDFConformance

Returns: the document's subtype conformance level

Returns the conformance level of the document as PDFConformance.

Since: 0.70

getPdfPart

documentGetPdfPart Source #

Arguments

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

document: A Document

-> m PDFPart

Returns: the document's subtype part

Returns the part of the conforming standard that the document adheres to as a PDFSubtype.

Since: 0.70

getPdfSubtype

documentGetPdfSubtype Source #

Arguments

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

document: A Document

-> m PDFSubtype

Returns: the document's subtype

Returns the subtype of document as a PDFSubtype.

Since: 0.70

getPdfSubtypeString

documentGetPdfSubtypeString Source #

Arguments

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

document: A Document

-> m (Maybe Text)

Returns: a newly allocated string containing the PDF subtype version of document, or Nothing

Returns the PDF subtype version of document as a string.

Since: 0.70

getPdfVersion

documentGetPdfVersion Source #

Arguments

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

document: A Document

-> m (Word32, Word32) 

No description available in the introspection data.

Since: 0.16

getPdfVersionString

documentGetPdfVersionString Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the PDF version of document, or Nothing

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

document: A Document

-> m [Permissions]

Returns: a set of flags from Permissions enumeration

Returns the flags specifying which operations are permitted when the document is opened.

Since: 0.16

getPrintScaling

documentGetPrintScaling Source #

Arguments

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

document: A Document

-> m PrintScaling

Returns: a PrintScaling that should be used when document is printed

Returns the print scaling value suggested by author of the document.

Since: 0.73

getProducer

documentGetProducer Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the producer of document, or Nothing

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

documentGetSubject Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the subject of document, or Nothing

Returns the subject of the document

Since: 0.16

getTitle

documentGetTitle Source #

Arguments

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

document: A Document

-> m Text

Returns: a new allocated string containing the title of document, or Nothing

Returns the document's title

Since: 0.16

hasAttachments

documentHasAttachments Source #

Arguments

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

document: A Document

-> m Bool

Returns: True, if document has attachments.

Returns True of document has any attachments.

isLinearized

documentIsLinearized Source #

Arguments

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

document: A Document

-> m Bool

Returns: True if document is linearized, False otherwise

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

documentNewFromData Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

data: the pdf data contained in a char array

-> Int32

length: the length of data

-> Maybe Text

password: password to unlock the file with, or Nothing

-> m Document

Returns: A newly created Document, or Nothing (Can throw GError)

Creates a new Document. If Nothing is returned, then error will be set. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

newFromFile

documentNewFromFile Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

uri: uri of the file to load

-> Maybe Text

password: password to unlock the file with, or Nothing

-> m Document

Returns: A newly created Document, or Nothing (Can throw GError)

Creates a new Document. If Nothing is returned, then error will be set. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

newFromGfile

documentNewFromGfile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a, IsCancellable b) 
=> a

file: a File to load

-> Maybe Text

password: password to unlock the file with, or Nothing

-> Maybe b

cancellable: a Cancellable, or Nothing

-> m Document

Returns: a new Document, or Nothing (Can throw GError)

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

stream: a InputStream to read from

-> Int64

length: the stream length, or -1 if not known

-> Maybe Text

password: password to unlock the file with, or Nothing

-> Maybe b

cancellable: a Cancellable, or Nothing

-> m Document

Returns: a new Document, or Nothing (Can throw GError)

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

documentSave Source #

Arguments

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

document: a Document

-> Text

uri: uri of file to save

-> m ()

(Can throw GError)

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

documentSaveACopy Source #

Arguments

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

document: a Document

-> Text

uri: uri of file to save

-> m ()

(Can throw GError)

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

documentSetAuthor Source #

Arguments

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

document: A Document

-> Text

author: A new author

-> 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

document: A Document

-> CLong

creationDate: A new creation date

-> 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

documentSetCreator Source #

Arguments

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

document: A Document

-> Text

creator: A new creator

-> m () 

Sets the document's creator. If creator is Nothing, Creator entry is removed from the document's Info dictionary.

Since: 0.46

setKeywords

documentSetKeywords Source #

Arguments

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

document: A Document

-> Text

keywords: New keywords

-> 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

document: A Document

-> CLong

modificationDate: A new modification date

-> 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

documentSetProducer Source #

Arguments

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

document: A Document

-> Text

producer: A new producer

-> m () 

Sets the document's producer. If producer is Nothing, Producer entry is removed from the document's Info dictionary.

Since: 0.46

setSubject

documentSetSubject Source #

Arguments

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

document: A Document

-> Text

subject: A new subject

-> m () 

Sets the document's subject. If subject is Nothing, Subject entry is removed from the document's Info dictionary.

Since: 0.46

setTitle

documentSetTitle Source #

Arguments

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

document: A Document

-> Text

title: A new title

-> 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

The author of the document

constructDocumentAuthor :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “author” property. This is rarely needed directly, but it is used by new.

getDocumentAuthor :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #author

setDocumentAuthor :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “author” property. When overloading is enabled, this is equivalent to

set document [ #author := value ]

creationDate

The date the document was created as seconds since the Epoch, or -1

constructDocumentCreationDate :: IsDocument o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “creation-date” property. This is rarely needed directly, but it is used by new.

getDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> m Int32 Source #

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

get document #creationDate

setDocumentCreationDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m () Source #

Set the value of the “creation-date” property. When overloading is enabled, this is equivalent to

set document [ #creationDate := value ]

creator

The creator of the document. See also documentGetCreator

constructDocumentCreator :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “creator” property. This is rarely needed directly, but it is used by new.

getDocumentCreator :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #creator

setDocumentCreator :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “creator” property. When overloading is enabled, this is equivalent to

set document [ #creator := value ]

format

The PDF version as string. See also documentGetPdfVersionString

getDocumentFormat :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #format

formatMajor

The PDF major version number. See also documentGetPdfVersion

getDocumentFormatMajor :: (MonadIO m, IsDocument o) => o -> m Word32 Source #

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

get document #formatMajor

formatMinor

The PDF minor version number. See also documentGetPdfVersion

getDocumentFormatMinor :: (MonadIO m, IsDocument o) => o -> m Word32 Source #

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

get document #formatMinor

keywords

The keywords associated to the document

constructDocumentKeywords :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “keywords” property. This is rarely needed directly, but it is used by new.

getDocumentKeywords :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #keywords

setDocumentKeywords :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “keywords” property. When overloading is enabled, this is equivalent to

set document [ #keywords := value ]

linearized

Whether document is linearized. See also documentIsLinearized

getDocumentLinearized :: (MonadIO m, IsDocument o) => o -> m Bool Source #

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

get document #linearized

metadata

Document metadata in XML format, or Nothing

getDocumentMetadata :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #metadata

modDate

The date the document was most recently modified as seconds since the Epoch, or -1

constructDocumentModDate :: IsDocument o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “mod-date” property. This is rarely needed directly, but it is used by new.

getDocumentModDate :: (MonadIO m, IsDocument o) => o -> m Int32 Source #

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

get document #modDate

setDocumentModDate :: (MonadIO m, IsDocument o) => o -> Int32 -> m () Source #

Set the value of the “mod-date” property. When overloading is enabled, this is equivalent to

set document [ #modDate := value ]

pageLayout

The page layout that should be used when the document is opened

getDocumentPageLayout :: (MonadIO m, IsDocument o) => o -> m PageLayout Source #

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

get document #pageLayout

pageMode

The mode that should be used when the document is opened

getDocumentPageMode :: (MonadIO m, IsDocument o) => o -> m PageMode Source #

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

get document #pageMode

permissions

Flags specifying which operations are permitted when the document is opened

getDocumentPermissions :: (MonadIO m, IsDocument o) => o -> m [Permissions] Source #

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

get document #permissions

printScaling

No description available in the introspection data.

Since: 0.73

getDocumentPrintScaling :: (MonadIO m, IsDocument o) => o -> m PrintScaling Source #

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

get document #printScaling

producer

The producer of the document. See also documentGetProducer

constructDocumentProducer :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “producer” property. This is rarely needed directly, but it is used by new.

getDocumentProducer :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #producer

setDocumentProducer :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “producer” property. When overloading is enabled, this is equivalent to

set document [ #producer := value ]

subject

The subject of the document

constructDocumentSubject :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “subject” property. This is rarely needed directly, but it is used by new.

getDocumentSubject :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #subject

setDocumentSubject :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “subject” property. When overloading is enabled, this is equivalent to

set document [ #subject := value ]

subtype

Document PDF subtype type

getDocumentSubtype :: (MonadIO m, IsDocument o) => o -> m PDFSubtype Source #

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

get document #subtype

subtypeConformance

Document PDF subtype conformance

getDocumentSubtypeConformance :: (MonadIO m, IsDocument o) => o -> m PDFConformance Source #

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

get document #subtypeConformance

subtypePart

Document PDF subtype part

getDocumentSubtypePart :: (MonadIO m, IsDocument o) => o -> m PDFPart Source #

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

get document #subtypePart

subtypeString

Document PDF subtype. See also documentGetPdfSubtypeString

getDocumentSubtypeString :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #subtypeString

title

The document's title or Nothing

constructDocumentTitle :: IsDocument o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “title” property. This is rarely needed directly, but it is used by new.

getDocumentTitle :: (MonadIO m, IsDocument o) => o -> m (Maybe Text) Source #

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

get document #title

setDocumentTitle :: (MonadIO m, IsDocument o) => o -> Text -> m () Source #

Set the value of the “title” property. When overloading is enabled, this is equivalent to

set document [ #title := value ]

viewerPreferences

No description available in the introspection data.

getDocumentViewerPreferences :: (MonadIO m, IsDocument o) => o -> m [ViewerPreferences] Source #

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

get document #viewerPreferences