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:
5dda963
)
made output filename optional
author
kramm
<kramm>
Sat, 5 Apr 2003 19:19:34 +0000
(19:19 +0000)
committer
kramm
<kramm>
Sat, 5 Apr 2003 19:19:34 +0000
(19:19 +0000)
pdf2swf/pdf2swf.1
patch
|
blob
|
history
pdf2swf/pdf2swf.cc
patch
|
blob
|
history
diff --git
a/pdf2swf/pdf2swf.1
b/pdf2swf/pdf2swf.1
index
1103cf4
..
7704ee1
100644
(file)
--- a/
pdf2swf/pdf2swf.1
+++ b/
pdf2swf/pdf2swf.1
@@
-3,7
+3,7
@@
pdf2swf - convert PDF files into SWF
.SH Synopsis
.B pdf2swf
pdf2swf - convert PDF files into SWF
.SH Synopsis
.B pdf2swf
-[\fIoptions\fR] \fIfile.pdf\fR -o \fIfile.swf\fR
+[\fIoptions\fR] \fIfile.pdf\fR [-o \fIfile.swf\fR]
.SH DESCRIPTION
This tools converts Acrobat PDF files into Flash SWF Animation
files.
.SH DESCRIPTION
This tools converts Acrobat PDF files into Flash SWF Animation
files.
diff --git
a/pdf2swf/pdf2swf.cc
b/pdf2swf/pdf2swf.cc
index
2cd110a
..
4cec4f5
100644
(file)
--- a/
pdf2swf/pdf2swf.cc
+++ b/
pdf2swf/pdf2swf.cc
@@
-270,7
+270,7
@@
int args_callback_command(char*name, char*val) {
void args_callback_usage(char*name)
{
void args_callback_usage(char*name)
{
- printf("Usage: %s [-si] [-j quality] [-p range] [-P password] input.pdf -o output.swf\n", name);
+ printf("Usage: %s [-si] [-j quality] [-p range] [-P password] input.pdf [-o output.swf]\n", name);
printf("\n");
printf("-p --pages=range Convert only pages in range\n");
printf("-P --password=password Use password for deciphering the pdf\n");
printf("\n");
printf("-p --pages=range Convert only pages in range\n");
printf("-P --password=password Use password for deciphering the pdf\n");
@@
-351,6
+351,25
@@
void addfontdir(FILE*database, char* dirname, int*numfonts, char*searchpath)
}
#endif
}
#endif
+char* stripfilename(char*filename, char*newext)
+{
+ char*last1 = strrchr(filename, '/');
+ char*last2 = strrchr(filename, '\\');
+ char*pos = filename;
+ char*name;
+ char*dot;
+ if(last1>pos) pos = last1 + 1;
+ if(last2>pos) pos = last2 + 1;
+ name = (char*)malloc(strlen(pos)+5);
+ strcpy(name, pos);
+ dot = strrchr(name, '.');
+ if(dot) {
+ *dot = 0;
+ }
+ strcat(name, newext);
+ return name;
+}
+
int main(int argn, char *argv[])
{
int ret;
int main(int argn, char *argv[])
{
int ret;
@@
-369,6
+388,14
@@
int main(int argn, char *argv[])
initLog(0,-1,0,0,-1,loglevel);
if(!outputname)
{
initLog(0,-1,0,0,-1,loglevel);
if(!outputname)
{
+ if(filename) {
+ outputname = stripfilename(filename, ".swf");
+ logf("<notice> Output filename not giving. Writing to %s", outputname);
+ }
+ }
+
+ if(!outputname)
+ {
fprintf(stderr, "Please use -o to specify an output file\n");
exit(1);
}
fprintf(stderr, "Please use -o to specify an output file\n");
exit(1);
}