libspectre  0.2.8
spectre-document.h
Go to the documentation of this file.
1 /* This file is part of Libspectre.
2  *
3  * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
4  * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
5  *
6  * Libspectre is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * Libspectre is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SPECTRE_DOCUMENT_H
22 #define SPECTRE_DOCUMENT_H
23 
24 #include <libspectre/spectre-macros.h>
27 
28 SPECTRE_BEGIN_DECLS
29 
32 
35 
42  const char *filename);
43 
48 
52 void spectre_document_free (SpectreDocument *document);
53 
58 unsigned int spectre_document_get_n_pages (SpectreDocument *document);
59 
65 
71 const char *spectre_document_get_title (SpectreDocument *document);
72 
78 const char *spectre_document_get_creator (SpectreDocument *document);
79 
85 const char *spectre_document_get_for (SpectreDocument *document);
86 
94 
99 const char *spectre_document_get_format (SpectreDocument *document);
100 
106 
113 
120  unsigned int page_index);
121 
128  const char *label);
129 
142  unsigned char **page_data,
143  int *row_length);
144 
157  unsigned char **page_data,
158  int *row_length);
159 
160 /* Convenient function for getting the page size of documents with no pages, tipically eps.
161  When used with multi-page documents the size of the first page will be returned.
162  @param document the document whose page will be returned
163  @width the page width will be returned here, or NULL
164  @height the page height will be returned here, or NULL
165 */
167  int *width,
168  int *height);
169 
175 void spectre_document_save (SpectreDocument *document,
176  const char *filename);
177 /* Save document as a pdf document. This function can fail
178  @param document the document that will be saved
179  @param filename the path where document will be saved as pdf
180  @see spectre_document_status
181 */
183  const char *filename);
184 SPECTRE_END_DECLS
185 
186 #endif /* SPECTRE_DOCUMENT_H */
void spectre_document_save(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:402
SpectreStatus spectre_document_status(SpectreDocument *document)
Definition: spectre-document.c:121
const char * spectre_document_get_format(SpectreDocument *document)
Definition: spectre-document.c:222
const char * spectre_document_get_title(SpectreDocument *document)
Definition: spectre-document.c:170
enum _SpectreStatus SpectreStatus
SpectreOrientation spectre_document_get_orientation(SpectreDocument *document)
Definition: spectre-document.c:142
SpectrePage * spectre_document_get_page_by_label(SpectreDocument *document, const char *label)
Definition: spectre-document.c:296
const char * spectre_document_get_for(SpectreDocument *document)
Definition: spectre-document.c:196
SpectreOrientation
Definition: spectre-page.h:30
void spectre_document_render_full(SpectreDocument *document, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition: spectre-document.c:330
void spectre_document_render(SpectreDocument *document, unsigned char **page_data, int *row_length)
Definition: spectre-document.c:358
SpectrePage * spectre_document_get_page(SpectreDocument *document, unsigned int page_index)
Definition: spectre-document.c:261
unsigned int spectre_document_get_language_level(SpectreDocument *document)
Definition: spectre-document.c:248
unsigned int spectre_document_get_n_pages(SpectreDocument *document)
Definition: spectre-document.c:129
void spectre_document_load(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:54
Definition: spectre-document.c:35
void spectre_document_save_to_pdf(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:444
SpectreDocument * spectre_document_new(void)
Definition: spectre-document.c:45
int spectre_document_is_eps(SpectreDocument *document)
Definition: spectre-document.c:235
void spectre_document_free(SpectreDocument *document)
Definition: spectre-document.c:107
Definition: spectre-page.c:30
const char * spectre_document_get_creator(SpectreDocument *document)
Definition: spectre-document.c:183
struct SpectreRenderContext SpectreRenderContext
Definition: spectre-render-context.h:29
void spectre_document_get_page_size(SpectreDocument *document, int *width, int *height)
Definition: spectre-document.c:372
const char * spectre_document_get_creation_date(SpectreDocument *document)
Definition: spectre-document.c:209