libspectre  0.2.9
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 
30 SPECTRE_BEGIN_DECLS
31 
33 typedef struct SpectreDocument SpectreDocument;
34 
36 SPECTRE_PUBLIC
38 
44 SPECTRE_PUBLIC
46  const char *filename);
47 
51 SPECTRE_PUBLIC
53 
57 SPECTRE_PUBLIC
58 void spectre_document_free (SpectreDocument *document);
59 
64 SPECTRE_PUBLIC
65 unsigned int spectre_document_get_n_pages (SpectreDocument *document);
66 
71 SPECTRE_PUBLIC
73 
79 SPECTRE_PUBLIC
80 const char *spectre_document_get_title (SpectreDocument *document);
81 
87 SPECTRE_PUBLIC
88 const char *spectre_document_get_creator (SpectreDocument *document);
89 
95 SPECTRE_PUBLIC
96 const char *spectre_document_get_for (SpectreDocument *document);
97 
104 SPECTRE_PUBLIC
106 
111 SPECTRE_PUBLIC
112 const char *spectre_document_get_format (SpectreDocument *document);
113 
118 SPECTRE_PUBLIC
120 
126 SPECTRE_PUBLIC
128 
134 SPECTRE_PUBLIC
136  unsigned int page_index);
137 
143 SPECTRE_PUBLIC
145  const char *label);
146 
157 SPECTRE_PUBLIC
160  unsigned char **page_data,
161  int *row_length);
162 
174 SPECTRE_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 */
185 SPECTRE_PUBLIC
187  int *width,
188  int *height);
189 
195 SPECTRE_PUBLIC
196 void spectre_document_save (SpectreDocument *document,
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 */
203 SPECTRE_PUBLIC
205  const char *filename);
206 SPECTRE_END_DECLS
207 
208 #endif /* SPECTRE_DOCUMENT_H */
spectre_document_load
SPECTRE_PUBLIC void spectre_document_load(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:113
spectre_document_get_n_pages
SPECTRE_PUBLIC unsigned int spectre_document_get_n_pages(SpectreDocument *document)
Definition: spectre-document.c:155
SpectreRenderContext
struct SpectreRenderContext SpectreRenderContext
Definition: spectre-render-context.h:29
spectre_document_is_eps
SPECTRE_PUBLIC int spectre_document_is_eps(SpectreDocument *document)
Definition: spectre-document.c:261
SpectrePage
Definition: spectre-page.c:31
spectre_document_get_creation_date
SPECTRE_PUBLIC const char * spectre_document_get_creation_date(SpectreDocument *document)
Definition: spectre-document.c:235
spectre_document_get_orientation
SPECTRE_PUBLIC SpectreOrientation spectre_document_get_orientation(SpectreDocument *document)
Definition: spectre-document.c:168
spectre_document_new
SPECTRE_PUBLIC SpectreDocument * spectre_document_new(void)
Definition: spectre-document.c:45
spectre_document_get_language_level
SPECTRE_PUBLIC unsigned int spectre_document_get_language_level(SpectreDocument *document)
Definition: spectre-document.c:274
spectre_document_render
SPECTRE_PUBLIC void spectre_document_render(SpectreDocument *document, unsigned char **page_data, int *row_length)
Definition: spectre-document.c:384
SpectreDocument
Definition: spectre-document.c:36
spectre_document_save
SPECTRE_PUBLIC void spectre_document_save(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:428
SpectreStatus
enum _SpectreStatus SpectreStatus
spectre_document_get_page
SPECTRE_PUBLIC SpectrePage * spectre_document_get_page(SpectreDocument *document, unsigned int page_index)
Definition: spectre-document.c:287
SpectreOrientation
SpectreOrientation
Definition: spectre-page.h:30
spectre_document_get_title
SPECTRE_PUBLIC const char * spectre_document_get_title(SpectreDocument *document)
Definition: spectre-document.c:196
spectre_document_get_page_by_label
SPECTRE_PUBLIC SpectrePage * spectre_document_get_page_by_label(SpectreDocument *document, const char *label)
Definition: spectre-document.c:322
spectre_document_get_format
SPECTRE_PUBLIC const char * spectre_document_get_format(SpectreDocument *document)
Definition: spectre-document.c:248
spectre_document_status
SPECTRE_PUBLIC SpectreStatus spectre_document_status(SpectreDocument *document)
Definition: spectre-document.c:147
spectre_document_get_page_size
SPECTRE_PUBLIC void spectre_document_get_page_size(SpectreDocument *document, int *width, int *height)
Definition: spectre-document.c:398
spectre_document_get_creator
SPECTRE_PUBLIC const char * spectre_document_get_creator(SpectreDocument *document)
Definition: spectre-document.c:209
spectre-status.h
spectre_document_render_full
SPECTRE_PUBLIC void spectre_document_render_full(SpectreDocument *document, SpectreRenderContext *rc, unsigned char **page_data, int *row_length)
Definition: spectre-document.c:356
spectre_document_get_for
SPECTRE_PUBLIC const char * spectre_document_get_for(SpectreDocument *document)
Definition: spectre-document.c:222
spectre_document_free
SPECTRE_PUBLIC void spectre_document_free(SpectreDocument *document)
Definition: spectre-document.c:133
spectre-page.h
spectre_document_save_to_pdf
SPECTRE_PUBLIC void spectre_document_save_to_pdf(SpectreDocument *document, const char *filename)
Definition: spectre-document.c:470