1
// This file was generated by the Gtk# code generator.
2
// Any changes made will be lost if regenerated.
7
using System.Collections;
8
using System.Runtime.InteropServices;
10
#region Autogenerated code
11
public partial class Document : GLib.Object {
14
protected Document(GLib.GType gtype) : base(gtype) {}
15
public Document(IntPtr raw) : base(raw) {}
17
[DllImport("poppler-glib")]
18
static extern unsafe IntPtr poppler_document_new_from_data(IntPtr data, int length, IntPtr password, out IntPtr error);
20
public unsafe Document (string data, string password) : base (IntPtr.Zero)
22
if (GetType () != typeof (Document)) {
23
throw new InvalidOperationException ("Can't override this constructor.");
25
IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password);
26
IntPtr error = IntPtr.Zero;
27
Raw = poppler_document_new_from_data(GLib.Marshaller.StringToPtrGStrdup(data), System.Text.Encoding.UTF8.GetByteCount (data), native_password, out error);
28
GLib.Marshaller.Free (native_password);
29
if (error != IntPtr.Zero) throw new GLib.GException (error);
32
[DllImport("poppler-glib")]
33
static extern unsafe IntPtr poppler_document_new_from_file(IntPtr uri, IntPtr password, out IntPtr error);
35
public static unsafe Document NewFromFile(string uri, string password)
37
IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
38
IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password);
39
IntPtr error = IntPtr.Zero;
40
Document result = new Document (poppler_document_new_from_file(native_uri, native_password, out error));
41
GLib.Marshaller.Free (native_uri);
42
GLib.Marshaller.Free (native_password);
43
if (error != IntPtr.Zero) throw new GLib.GException (error);
47
[DllImport("poppler-glib")]
48
static extern unsafe bool poppler_document_save(IntPtr raw, IntPtr uri, out IntPtr error);
50
public unsafe bool Save(string uri) {
51
IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
52
IntPtr error = IntPtr.Zero;
53
bool raw_ret = poppler_document_save(Handle, native_uri, out error);
55
GLib.Marshaller.Free (native_uri);
56
if (error != IntPtr.Zero) throw new GLib.GException (error);
60
[DllImport("poppler-glib")]
61
static extern unsafe bool poppler_document_save_a_copy(IntPtr raw, IntPtr uri, out IntPtr error);
63
public unsafe bool SaveACopy(string uri) {
64
IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
65
IntPtr error = IntPtr.Zero;
66
bool raw_ret = poppler_document_save_a_copy(Handle, native_uri, out error);
68
GLib.Marshaller.Free (native_uri);
69
if (error != IntPtr.Zero) throw new GLib.GException (error);
73
[DllImport("poppler-glib")]
74
static extern IntPtr poppler_document_get_page_by_label(IntPtr raw, IntPtr label);
76
public Poppler.Page GetPageByLabel(string label) {
77
IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label);
78
IntPtr raw_ret = poppler_document_get_page_by_label(Handle, native_label);
79
Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page;
80
GLib.Marshaller.Free (native_label);
84
[DllImport("poppler-glib")]
85
static extern IntPtr poppler_document_get_form_field(IntPtr raw, int id);
87
public Poppler.FormField GetFormField(int id) {
88
IntPtr raw_ret = poppler_document_get_form_field(Handle, id);
89
Poppler.FormField ret = GLib.Object.GetObject(raw_ret) as Poppler.FormField;
93
[DllImport("poppler-glib")]
94
static extern IntPtr poppler_document_get_page(IntPtr raw, int index);
96
public Poppler.Page GetPage(int index) {
97
IntPtr raw_ret = poppler_document_get_page(Handle, index);
98
Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page;
102
[DllImport("poppler-glib")]
103
static extern int poppler_document_get_n_pages(IntPtr raw);
107
int raw_ret = poppler_document_get_n_pages(Handle);
113
[DllImport("poppler-glib")]
114
static extern bool poppler_document_has_attachments(IntPtr raw);
116
public bool HasAttachments {
118
bool raw_ret = poppler_document_has_attachments(Handle);
124
[DllImport("poppler-glib")]
125
static extern IntPtr poppler_document_find_dest(IntPtr raw, IntPtr link_name);
127
public Poppler.Dest FindDest(string link_name) {
128
IntPtr native_link_name = GLib.Marshaller.StringToPtrGStrdup (link_name);
129
IntPtr raw_ret = poppler_document_find_dest(Handle, native_link_name);
130
Poppler.Dest ret = Poppler.Dest.New (raw_ret);
131
GLib.Marshaller.Free (native_link_name);
135
[DllImport("poppler-glib")]
136
static extern IntPtr poppler_document_get_attachments(IntPtr raw);
138
public GLib.List Attachments {
140
IntPtr raw_ret = poppler_document_get_attachments(Handle);
141
GLib.List ret = new GLib.List(raw_ret);
146
[DllImport("poppler-glib")]
147
static extern IntPtr poppler_document_get_type();
149
public static new GLib.GType GType {
151
IntPtr raw_ret = poppler_document_get_type();
152
GLib.GType ret = new GLib.GType(raw_ret);