X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.h;h=4ee8382c2b84cdfb92d59895c9bc75b5adfedfd4;hb=e99a58fe7c3a138ea19f19433a9d75ee1020ed6b;hp=c6a6f49145b74dc7fbc4432c1fb4c1360365642d;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.h b/pdf2swf/SWFOutputDev.h index c6a6f49..4ee8382 100644 --- a/pdf2swf/SWFOutputDev.h +++ b/pdf2swf/SWFOutputDev.h @@ -4,14 +4,84 @@ Part of the swftools package. Copyright (c) 2001 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - This file is distributed under the GPL, see file COPYING for details */ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __pdf_h__ #define __pdf_h__ -void pdfswf_init(char*filename, char*userPassword) ; -void pdfswf_setoutputfilename(char*filename); -int pdfswf_numpages(); -void pdfswf_convertpage(int page) ; -void pdfswf_close(); +#ifdef __cplusplus +extern "C" { +#endif + +void pdfswf_addfont(char*filename); +void pdfswf_addfontdir(char*dir); +void pdfswf_addlanguagedir(char*dir); + +void pdfswf_setparameter(char*name, char*value); + +typedef struct _pdf_doc +{ + char*info; + char*title; + int num_pages; + void*internal; +} pdf_doc_t; + +pdf_doc_t* pdf_init(char*filename, char*userPassword); +void pdf_destroy(pdf_doc_t*doc); + +typedef struct _swf_output +{ + int num_pages; + void*internal; +} swf_output_t; + +swf_output_t* swf_output_init(); +void swf_output_startframe(swf_output_t*, int width, int height); +void swf_output_endframe(swf_output_t*); +void swf_output_setparameter(swf_output_t*, char*name, char*value); +int swf_output_save(swf_output_t*, char*filename); +void* swf_output_get(swf_output_t*); +void swf_output_preparepage(swf_output_t*, int pdfpage, int outputpage); +void swf_output_destroy(swf_output_t*page); + +typedef struct _pdf_page +{ + pdf_doc_t*parent; + int nr; + void*internal; +} pdf_page_t; + +pdf_page_t* pdf_getpage(pdf_doc_t*doc, int page); +void pdf_page_render(pdf_page_t*page, swf_output_t*output); +void pdf_page_rendersection(pdf_page_t*page, swf_output_t*output, int x, int y, int x1, int y1, int x2, int y2); +void pdf_page_destroy(pdf_page_t*page); + +typedef struct _pdf_page_info +{ + int xMin, yMin, xMax, yMax; + int number_of_images; + int number_of_links; + int number_of_fonts; +} pdf_page_info_t; + +pdf_page_info_t* pdf_page_getinfo(pdf_page_t*page); +void pdf_page_info_destroy(pdf_page_info_t*info); + +#ifdef __cplusplus +} +#endif + #endif //__pdf_h__