![]() |
![]() |
![]() |
GXPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <libgxps/gxps.h> struct GXPSFile; #define GXPS_FILE_ERROR enum GXPSFileError; GXPSFile * gxps_file_new (GFile *filename
,GError **error
); guint gxps_file_get_n_documents (GXPSFile *xps
); GXPSDocument * gxps_file_get_document (GXPSFile *xps
,guint n_doc
,GError **error
); gint gxps_file_get_document_for_link_target (GXPSFile *xps
,GXPSLinkTarget *target
);
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()
.
struct GXPSFile;
The GXPSFile struct contains only private fields and should not be directly accessed.
#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.
typedef enum { GXPS_FILE_ERROR_INVALID } GXPSFileError;
Error codes returned by GXPSFile functions.
GXPSFile * gxps_file_new (GFile *filename
,GError **error
);
Creates a new GXPSFile for the given GFile.
|
a GFile |
|
GError for error reporting, or NULL to ignore |
Returns : |
a GXPSFile or NULL on error. |
guint gxps_file_get_n_documents (GXPSFile *xps
);
Gets the number of documents in xps
.
|
a GXPSFile |
Returns : |
the number of documents. |
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.
|
a GXPSFile |
|
the index of the document to get |
|
GError for error reporting, or NULL to ignore |
Returns : |
a new GXPSDocument or NULL on error.
Free the returned object with g_object_unref() . [transfer full]
|
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
.
|
a GXPSFile |
|
a GXPSLinkTarget |
Returns : |
the index of the document pointed by the given GXPSLinkTarget or -1. |