removed % handling
[swftools.git] / pdf2swf / SWFOutputDev.h
1 /* pdfswf.h
2    Header file for pdfswf.cc.
3
4    Part of the swftools package.
5
6    Copyright (c) 2001 Matthias Kramm <kramm@quiss.org> 
7  
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
21
22 #ifndef __pdf_h__
23 #define __pdf_h__
24
25 #include "../lib/gfxdevice.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 void pdfswf_addfont(char*filename);
32 void pdfswf_addfontdir(char*dir);
33 void pdfswf_addlanguagedir(char*dir);
34
35 void pdfswf_setparameter(char*name, char*value);
36
37 typedef struct _pdf_doc
38 {
39     char*info;
40     char*title;
41     int num_pages;
42     void*internal;
43 } pdf_doc_t;
44
45 pdf_doc_t*  pdf_init(char*filename, char*userPassword);
46 void pdf_destroy(pdf_doc_t*doc);
47
48 typedef struct _dev_output
49 {
50     int num_pages;
51     void*internal;
52 } dev_output_t;
53
54 dev_output_t* dev_output_init(gfxdevice_t*dev);
55 void dev_output_startframe(dev_output_t*, int width, int height);
56 void dev_output_endframe(dev_output_t*);
57 void dev_output_setparameter(dev_output_t*, char*name, char*value);
58 void dev_output_finish(dev_output_t*);
59 void dev_output_preparepage(dev_output_t*, int pdfpage, int outputpage);
60 void dev_output_destroy(dev_output_t*);
61
62 typedef struct _pdf_page
63 {
64     pdf_doc_t*parent;
65     int nr;
66     void*internal;
67 } pdf_page_t;
68
69 pdf_page_t* pdf_getpage(pdf_doc_t*doc, int page);
70 void pdf_page_render(pdf_page_t*page, dev_output_t*output);
71 void pdf_page_rendersection(pdf_page_t*page, dev_output_t*output, int x, int y, int x1, int y1, int x2, int y2);
72 void pdf_page_destroy(pdf_page_t*page);
73
74 typedef struct _pdf_page_info
75 {
76     int xMin, yMin, xMax, yMax;
77     int number_of_images;
78     int number_of_links;
79     int number_of_fonts;
80 } pdf_page_info_t;
81
82 pdf_page_info_t* pdf_page_getinfo(pdf_page_t*page);
83 void pdf_page_info_destroy(pdf_page_info_t*info);
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #endif //__pdf_h__