git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ae58b8
)
new parameters -X,-Y
author
kramm
<kramm>
Mon, 20 Oct 2008 13:59:21 +0000
(13:59 +0000)
committer
kramm
<kramm>
Mon, 20 Oct 2008 13:59:21 +0000
(13:59 +0000)
src/pdf2swf.c
patch
|
blob
|
history
diff --git
a/src/pdf2swf.c
b/src/pdf2swf.c
index
a011db6
..
8c4d8a5
100644
(file)
--- a/
src/pdf2swf.c
+++ b/
src/pdf2swf.c
@@
-50,6
+50,8
@@
static gfxsource_t*driver = 0;
static gfxdevice_t*out = 0;
static gfxsource_t*driver = 0;
static gfxdevice_t*out = 0;
+static int maxwidth=0, maxheight=0;
+
static char * outputname = 0;
static int loglevel = 3;
static char * pagerange = 0;
static char * outputname = 0;
static int loglevel = 3;
static char * pagerange = 0;
@@
-181,6
+183,16
@@
int args_callback_option(char*name,char*val) {
ynup = 3;
return 0;
}
ynup = 3;
return 0;
}
+ else if (!strcmp(name, "X"))
+ {
+ maxwidth = atoi(value);
+ return 1;
+ }
+ else if (!strcmp(name, "Y"))
+ {
+ maxheight = atoi(value);
+ return 1;
+ }
else if (!strcmp(name, "q"))
{
loglevel --;
else if (!strcmp(name, "q"))
{
loglevel --;
@@
-468,6
+480,8
@@
static struct options_t options[] = {
{"G", "flatten"},
{"I", "info"},
{"Q", "maxtime"},
{"G", "flatten"},
{"I", "info"},
{"Q", "maxtime"},
+{"X", "width"},
+{"Y", "height"},
{0,0}
};
{0,0}
};
@@
-572,15
+586,24
@@
void show_info(gfxsource_t*driver, char*filename)
}
}
-static gfxdevice_t swf,wrap;
+static gfxdevice_t swf,wrap,rescale;
gfxdevice_t*create_output_device()
{
gfxdevice_swf_init(&swf);
gfxdevice_t*create_output_device()
{
gfxdevice_swf_init(&swf);
- gfxdevice_removeclippings_init(&wrap, &swf);
- out = &wrap;
- if(!flatten) {
- out = &swf;
+
+ /* set up filter chain */
+
+ out = &swf;
+ if(flatten) {
+ gfxdevice_removeclippings_init(&wrap, &swf);
+ out = &wrap;
}
}
+
+ if(maxwidth || maxheight) {
+ gfxdevice_rescale_init(&rescale, out, maxwidth, maxheight);
+ out = &rescale;
+ }
+
/* pass global parameters to output device */
parameter_t*p = device_config;
while(p) {
/* pass global parameters to output device */
parameter_t*p = device_config;
while(p) {