} fontlist_t;
class SWFOutputDev: public OutputDev {
- int outputstarted;
public:
gfxdevice_t* output;
pbminfo = 0;
type3active = 0;
statepos = 0;
- outputstarted = 0;
xref = 0;
substitutepos = 0;
type3Warning = 0;
result = 0;
outer_clip_box = 0;
output = (gfxdevice_t*)malloc(sizeof(gfxdevice_t));
- memset(output, 0, sizeof(output));
+ gfxdevice_swf_init(output);
+ /* configure device */
+ parameter_t*p = device_config;
+ while(p) {
+ output->setparameter(output, p->name, p->value);
+ p = p->next;
+ }
};
void SWFOutputDev::setMove(int x,int y)
line2 = gfxtool_dash_line(line, dash, dashphase);
line = line2;
+ free(dash);
msg("<trace> After dashing:");
}
gfxline_free(line);
}
-/* pass through functions for swf_output */
-int SWFOutputDev::save(char*filename)
-{
- finish();
- return result->save(result, filename);
-}
void SWFOutputDev::pagefeed()
{
if(outer_clip_box) {
swfoutput_pagefeed(output);
}
-void* SWFOutputDev::getSWF()
-{
- finish();
- return result->get(result, "swf");
-}
void SWFOutputDev::finish()
{
if(outer_clip_box) {
- output->endclip(output);
+ if(output) {
+ output->endclip(output);
+ }
outer_clip_box = 0;
}
if(output) {
}
}
+int SWFOutputDev::save(char*filename)
+{
+ finish();
+ return result->save(result, filename);
+}
+void* SWFOutputDev::getSWF()
+{
+ finish();
+ return result->get(result, "swf");
+}
+
SWFOutputDev::~SWFOutputDev()
{
finish();
- outputstarted = 0;
if(this->result) {
this->result->destroy(this->result);
free(l);
l = next;
}
+ this->fontlist = 0;
};
GBool SWFOutputDev::upsideDown()
{
- msg("<debug> upsidedown? yes");
return gTrue;
};
GBool SWFOutputDev::useDrawChar()
/*if(user_clipy2 < y2)*/ y2 = user_clipy2;
}
- if(!outputstarted) {
- msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2);
-
- gfxdevice_swf_init(output);
-
- /* configure device */
- parameter_t*p = device_config;
- while(p) {
- output->setparameter(output, p->name, p->value);
- p = p->next;
- }
-
- outputstarted = 1;
- }
-
+ msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2);
+
if(outer_clip_box) {
output->endclip(output);
outer_clip_box = 0;
char * fontname = getFontName(gfxFont);
fileName = searchFont(fontname);
if(!fileName) showFontError(gfxFont,0);
+ free(fontname);
}
if(!fileName) {
char * fontname = getFontName(gfxFont);