libspectre 0.2.12
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#include <stdio.h>
29
30SPECTRE_BEGIN_DECLS
31
34
36SPECTRE_PUBLIC
38
44SPECTRE_PUBLIC
46 const char *filename);
47
51SPECTRE_PUBLIC
53
57SPECTRE_PUBLIC
59
64SPECTRE_PUBLIC
65unsigned int spectre_document_get_n_pages (SpectreDocument *document);
66
71SPECTRE_PUBLIC
73
79SPECTRE_PUBLIC
80const char *spectre_document_get_title (SpectreDocument *document);
81
87SPECTRE_PUBLIC
88const char *spectre_document_get_creator (SpectreDocument *document);
89
95SPECTRE_PUBLIC
96const char *spectre_document_get_for (SpectreDocument *document);
97
104SPECTRE_PUBLIC
106
111SPECTRE_PUBLIC
112const char *spectre_document_get_format (SpectreDocument *document);
113
118SPECTRE_PUBLIC
120
126SPECTRE_PUBLIC
128
134SPECTRE_PUBLIC
136 unsigned int page_index);
137
143SPECTRE_PUBLIC
145 const char *label);
146
157SPECTRE_PUBLIC
160 unsigned char **page_data,
161 int *row_length);
162
174SPECTRE_PUBLIC
176 unsigned char **page_data,
177 int *row_length);
178
179/* Convenient function for getting the page size of documents with no pages, tipically eps.
180 When used with multi-page documents the size of the first page will be returned.
181 @param document the document whose page will be returned
182 @width the page width will be returned here, or NULL
183 @height the page height will be returned here, or NULL
184*/
185SPECTRE_PUBLIC
187 int *width,
188 int *height);
189
195SPECTRE_PUBLIC
197 const char *filename);
198/* Save document as a pdf document. This function can fail
199 @param document the document that will be saved
200 @param filename the path where document will be saved as pdf
201 @see spectre_document_status
202*/
203SPECTRE_PUBLIC
205 const char *filename);
206SPECTRE_END_DECLS
207
208#endif /* SPECTRE_DOCUMENT_H */
SPECTRE_PUBLIC void spectre_document_render(SpectreDocument *document, unsigned char **page_data, int *row_length)
Definition spectre-document.c:388
SPECTRE_PUBLIC const char * spectre_document_get_creation_date(SpectreDocument *document)
Definition spectre-document.c:239
SPECTRE_PUBLIC const char * spectre_document_get_format(SpectreDocument *document)
Definition spectre-document.c:252
SPECTRE_PUBLIC const char * spectre_document_get_for(SpectreDocument *document)
Definition spectre-document.c:226
SPECTRE_PUBLIC SpectreStatus spectre_document_status(SpectreDocument *document)
Definition spectre-document.c:151
SPECTRE_PUBLIC void spectre_document_render_full(SpectreDocument *document, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition spectre-document.c:360
SPECTRE_PUBLIC const char * spectre_document_get_creator(SpectreDocument *document)
Definition spectre-document.c:213
SPECTRE_PUBLIC void spectre_document_get_page_size(SpectreDocument *document, int *width, int *height)
Definition spectre-document.c:402
SPECTRE_PUBLIC void spectre_document_save(SpectreDocument *document, const char *filename)
Definition spectre-document.c:432
SPECTRE_PUBLIC unsigned int spectre_document_get_language_level(SpectreDocument *document)
Definition spectre-document.c:278
SPECTRE_PUBLIC SpectreDocument * spectre_document_new(void)
Definition spectre-document.c:45
SPECTRE_PUBLIC void spectre_document_load(SpectreDocument *document, const char *filename)
Definition spectre-document.c:113
SPECTRE_PUBLIC unsigned int spectre_document_get_n_pages(SpectreDocument *document)
Definition spectre-document.c:159
SPECTRE_PUBLIC void spectre_document_save_to_pdf(SpectreDocument *document, const char *filename)
Definition spectre-document.c:474
SPECTRE_PUBLIC int spectre_document_is_eps(SpectreDocument *document)
Definition spectre-document.c:265
SPECTRE_PUBLIC const char * spectre_document_get_title(SpectreDocument *document)
Definition spectre-document.c:200
SPECTRE_PUBLIC SpectrePage * spectre_document_get_page(SpectreDocument *document, unsigned int page_index)
Definition spectre-document.c:291
SPECTRE_PUBLIC SpectreOrientation spectre_document_get_orientation(SpectreDocument *document)
Definition spectre-document.c:172
SPECTRE_PUBLIC void spectre_document_free(SpectreDocument *document)
Definition spectre-document.c:137
SPECTRE_PUBLIC SpectrePage * spectre_document_get_page_by_label(SpectreDocument *document, const char *label)
Definition spectre-document.c:326
SpectreOrientation
Definition spectre-page.h:30
struct SpectreRenderContext SpectreRenderContext
Definition spectre-render-context.h:29
enum _SpectreStatus SpectreStatus
Definition spectre-document.c:36
Definition spectre-page.c:31