Top |
Description
GXPSFile represents a XPS file. A GXPSFile is a set of one or more
documents, you can get the amount of documents contained in the set
with gxps_file_get_n_documents()
. Documents can be retrieved by their
index in the set with gxps_file_get_document()
.
Functions
gxps_file_new ()
GXPSFile * gxps_file_new (GFile *filename
,GError **error
);
Creates a new GXPSFile for the given GFile.
gxps_file_get_n_documents ()
guint
gxps_file_get_n_documents (GXPSFile *xps
);
Gets the number of documents in xps
.
gxps_file_get_document ()
GXPSDocument * gxps_file_get_document (GXPSFile *xps
,guint n_doc
,GError **error
);
Creates a new GXPSDocument representing the document at
index n_doc
in xps
file.
Parameters
xps |
a GXPSFile |
|
n_doc |
the index of the document to get |
|
error |
GError for error reporting, or |
Returns
a new GXPSDocument or NULL
on error.
Free the returned object with g_object_unref()
.
[transfer full]
gxps_file_get_document_for_link_target ()
gint gxps_file_get_document_for_link_target (GXPSFile *xps
,GXPSLinkTarget *target
);
Gets the index of the document in xps
pointed by target
.
If the GXPSLinkTarget does not reference a document, or
referenced document is not found in xps
file -1 will be
returned. In this case you can look for the page pointed by
the link target by calling gxps_document_get_page_for_anchor()
with the anchor of the GXPSLinkTarget for every document in
xps
.
gxps_file_get_core_properties ()
GXPSCoreProperties * gxps_file_get_core_properties (GXPSFile *xps
,GError **error
);
Create a GXPSCoreProperties object containing the metadata
of xpsm
, or NULL
in case of error or if the GXPSFile
doesn't contain core properties.
Returns
a new GXPSCoreProperties or NULL
.
Free the returned object with g_object_unref()
.
[transfer full]
Types and Values
struct GXPSFile
struct GXPSFile;
The GXPSFile struct contains only private fields and should not be directly accessed.
GXPS_FILE_ERROR
#define GXPS_FILE_ERROR (gxps_file_error_quark ())
Error domain for GXPSFile. Errors in this domain will be from the GXPSFileError enumeration. See GError for more information on error domains.