From bcedf5b233ad5148e9f6254fb1134710ad1b7b2a Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 17 Jun 2002 11:31:20 +0000 Subject: [PATCH] Implement -t (--stop) option. --- pdf2swf/SWFOutputDev.cc | 5 +++++ pdf2swf/SWFOutputDev.h | 1 + pdf2swf/pdf2swf.cc | 7 +++++++ pdf2swf/swfoutput.cc | 9 +++++++++ pdf2swf/swfoutput.h | 1 + 5 files changed, 23 insertions(+) diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 17e3788..46bfb06 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -1729,6 +1729,11 @@ int pdfswf_numpages() return doc->getNumPages(); } +void pdfswf_insertstop() +{ + insertstoptag = 1; +} + int closed=0; void pdfswf_close() { diff --git a/pdf2swf/SWFOutputDev.h b/pdf2swf/SWFOutputDev.h index e1fa38d..6db523f 100644 --- a/pdf2swf/SWFOutputDev.h +++ b/pdf2swf/SWFOutputDev.h @@ -18,6 +18,7 @@ void pdfswf_linksopennewwindow(); void pdfswf_jpegquality(int); void pdfswf_performconversion(); void pdfswf_storeallcharacters(); +void pdfswf_insertstop(); int pdfswf_numpages(); void pdfswf_convertpage(int page) ; diff --git a/pdf2swf/pdf2swf.cc b/pdf2swf/pdf2swf.cc index 1122126..782e138 100644 --- a/pdf2swf/pdf2swf.cc +++ b/pdf2swf/pdf2swf.cc @@ -115,6 +115,11 @@ int args_callback_option(char*name,char*val) { pdfswf_linksopennewwindow(); return 0; } + else if (!strcmp(name, "t")) + { + pdfswf_insertstop(); + return 0; + } else if (!strcmp(name, "f")) { pdfswf_storeallcharacters(); @@ -231,6 +236,7 @@ struct options_t options[] = {"L","preloader"}, {"b","defaultviewer"}, {"l","defaultpreloader"}, + {"t","stop"}, {0,0} }; @@ -272,6 +278,7 @@ void args_callback_usage(char*name) #endif printf("-f --fonts Store full fonts in SWF. (Don't reduce to used characters)\n"); printf("-V --version Print program version\n"); + printf("-t --stop Insert a \"Stop\" Tag in every frame (don't turn pages automatically)\n"); #ifndef SYSTEM_BACKTICKS printf("The following might not work because your system call doesn't support command substitution:\n"); #endif diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 2161d9e..330c890 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -36,6 +36,7 @@ int drawonlyshapes=0; int jpegquality=85; int storeallcharacters=0; int enablezlib=0; +int insertstoptag=0; static int flag_protected = 0; typedef unsigned char u8; @@ -969,6 +970,14 @@ static void endpage(struct swfoutput*obj) endtext(); while(clippos) swfoutput_endclip(obj); + + if(insertstoptag) { + ActionTAG*atag=0; + atag = action_Stop(atag); + atag = action_End(atag); + tag = swf_InsertTag(tag,ST_DOACTION); + swf_ActionSet(tag,atag); + } tag = swf_InsertTag(tag,ST_SHOWFRAME); } diff --git a/pdf2swf/swfoutput.h b/pdf2swf/swfoutput.h index 1c66788..896de37 100644 --- a/pdf2swf/swfoutput.h +++ b/pdf2swf/swfoutput.h @@ -21,6 +21,7 @@ extern int ignoredraworder; //default:0 extern int drawonlyshapes; //default:0 extern int jpegquality; //default:100; extern int storeallcharacters; // default:0 +extern int insertstoptag; //default:0 typedef long int twip; -- 1.7.10.4