@echo off ECHO. ECHO _pdf2mz3 v1.8.8 - 2010, Apr 26 (added bookmark example) ECHO Written by Florian and Hans Nuecke, mz3-info@vservu.de ECHO Copyright VservU GmbH 2010 ECHO This file can be freely used and modified by anybody, as long as this and the above three lines of comment stay ECHO. ECHO Helper script to build a MegaZine3 book from a PDF file. ECHO We tested this command file but cannot assume any warranties; use at your own risk! ECHO. ECHO This command file does the following: ECHO - Ask you for the name of your MZ3 book, e.g. mybook1 (no spaces allowed in name!!) ECHO - creates a folder with that name if not existing ECHO - creates a subfolder /pages in that folder if not existing ECHO - waits if necessary until your confirmation the pdf file was copied ECHO - asks for the number of pages of that pdf file ECHO - asks for the pagewidth and pageheight of your book ECHO - converts every page of the pdf file into a low and high resolution swf page ECHO - creates a MZ3 File with that name, using the provided parameters ECHO - creates a index file that will start your book ECHO. ECHO This command file creates the following directories in the actual folder: ECHO One with the name you provide as book name plus some supporting folders as ECHO _search_index ECHO _custom_files (plus subfolder backing_files) and ECHO _changed_mz3_files (with subdirectories gui and plugins) ECHO If you don't want this to happen, please do not use this command file. :: Activate this, for modulo calculation in the loop SETLOCAL ENABLEDELAYEDEXPANSION :: If you want to display more details, SET echo_info==1 SET echo_info=0 :: set all parameters with those passed with the call (if provided) :: book_name must not contain any spaces! IF [%1]==[] GOTO no_book_name SET book_name=%1 SET param_cnt=0 SHIFT IF [%1]==[] GOTO no_pg_count SET pg_count=%1 SET param_cnt=1 SHIFT IF [%1]==[] GOTO no_pg_width SET width=%1 SET param_cnt=2 SHIFT IF [%1]==[] GOTO no_pg_height SET height=%1 SET param_cnt=3 SHIFT IF [%1]==[] GOTO no_pg_format SET pg_format=%1 SET param_cnt=4 SHIFT IF [%1]==[] GOTO no_scale SET scale=%1 SET param_cnt=5 SHIFT IF [%1]==[] GOTO no_jpg_l_q SET jpg_l_q=%1 SET param_cnt=6 SHIFT IF [%1]==[] GOTO no_jpg_h_q SET jpg_h_q=%1 SET param_cnt=7 SHIFT IF [%1]==[] GOTO no_res_px_l SET res_px_l=%1 SET param_cnt=8 SHIFT IF [%1]==[] GOTO no_res_px_h SET res_px_h=%1 SET param_cnt=9 SHIFT IF [%1]==[] GOTO no_book_type SET book_type=%1 SET param_cnt=10 SHIFT IF [%1]==[] GOTO no_zoomminscale SET zoomminscale=%1 SET param_cnt=11 SHIFT IF [%1]==[] GOTO no_zoommaxscale SET zoommaxscale=%1 SET param_cnt=12 SHIFT IF [%1]==[] GOTO no_zoomsnap SET zoomsnap=%1 SET param_cnt=13 SHIFT IF [%1]==[] GOTO no_zoomsteps SET zoomsteps=%1 SET param_cnt=14 SHIFT IF [%1]==[] GOTO no_zoominit SET zoominit=%1 SET param_cnt=15 SHIFT IF [%1]==[] GOTO no_maxloaded SET maxloaded=%1 SET param_cnt=16 SHIFT IF [%1]==[] GOTO no_pagethickness SET pagethickness=%1 SET param_cnt=17 SHIFT IF [%1]==[] GOTO no_maxthickness SET maxthickness=%1 SET param_cnt=18 SHIFT IF [%1]==[] GOTO no_thumbscale SET thumbscale=%1 SET param_cnt=19 SHIFT IF [%1]==[] GOTO no_logo_pos SET logo_pos=%1 SET param_cnt=20 SHIFT IF [%1]==[] GOTO no_settings SET settings=%1 SET param_cnt=21 SHIFT IF [%1]==[] GOTO no_plugin_list SET plugin_list=%1 SET param_cnt=22 SHIFT IF [%1]==[] GOTO no_qualitycontrol SET qualitycontrol=%1 SET param_cnt=23 SHIFT IF [%1]==[] GOTO no_centercovers SET centercovers=%1 SET param_cnt=24 SHIFT IF [%1]==[] GOTO no_cornerhint SET cornerhint=%1 SET param_cnt=25 SHIFT IF [%1]==[] GOTO no_pageoffset SET pageoffset=%1 SET param_cnt=26 SHIFT IF [%1]==[] GOTO no_dragrange SET dragrange=%1 SET param_cnt=27 SHIFT IF [%1]==[] GOTO no_searchmethod SET searchmethod=%1 SET param_cnt=28 SHIFT IF [%1]==[] GOTO no_shadows SET shadows=%1 SET param_cnt=29 SHIFT IF [%1]==[] GOTO no_searchclear SET searchclear=%1 SET param_cnt=30 SHIFT IF [%1]==[] GOTO no_startpage SET startpage=%1 SET param_cnt=31 SHIFT IF [%1]==[] GOTO no_version_name SET version_name=%1 SET param_cnt=32 SHIFT IF [%1]==[] GOTO no_make_pg SET make_pg=%1 SET param_cnt=33 SHIFT IF [%1]==[] GOTO no_parameter_list SET parameter_list=%1 SET param_cnt=34 SHIFT IF [%1]==[] GOTO no_thumbloadtext SET thumbloadtext=%1 SET param_cnt=35 SHIFT IF [%1]==[] GOTO no_custom_webaddress SET custom_webaddress=%1 SET param_cnt=36 SHIFT IF [%1]==[] GOTO no_bookmark_title SET bookmark_title=%1 SET param_cnt=37 SHIFT IF [%1]==[] GOTO no_make_what SET make_what=%1 SET param_cnt=38 SET full_auto=true GOTO :all_param :no_book_name SET book_name="demo" :no_pg_count SET pg_count=2 :no_width SET width=816 :no_height SET height=1056 :no_pg_format SET pg_format=US :no_scale SET scale=0 :no_jpg_l_q SET jpg_l_q=40 :no_jpg_h_q SET jpg_h_q=90 :no_res_px_l SET res_px_l=36 :no_res_px_h SET res_px_h=96 :no_book_type SET book_type=pdf :no_zoomminscale SET zoomminscale=0.5 :no_zoommaxscale SET zoommaxscale=4.0 :no_zoomsnap SET zoomsnap="0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0" :no_zoomsteps SET zoomsteps=2 :no_zoominit SET zoominit=0 :no_maxloaded SET maxloaded=24 IF NOT %book_type%==pdf SET maxloaded=24 :no_pagethickness SET pagethickness=0.7 :no_maxthickness SET maxthickness=30 :no_thumbscale SET thumbscale=0.25 :no_logo_pos SET logo_pos="pw-w,ph-h" :no_settings SET settings="true,false,false,false,false" :no_plugin_list SET plugin_list="search, print, backgroundsounds, help, pdflinks" :no_qualitycontrol SET qualitycontrol=true :no_centercovers SET centercovers=false :no_cornerhint SET cornerhint=false :no_pageoffset SET pageoffset=0 :no_dragrange SET dragrange=20 :no_searchmethod SET search_method=client :no_shadow SET shadow=0.3 :no_searchclear SET searchclear=true :no_startpage SET startpage=1 :no_version_name SET version_name="n" :no_make_pg SET make_pg=y :no_parameter_list SET parameter_list="" :no_thumbloadtext SET thumbloadtext=wait :no_custom_webaddress SET custom_webaddress=http://megazine.mightypirates.de :no_bookmark_title SET bookmark_title=%maxloaded% :no_make_what :: b = create both a standard book and a cersion to be copied on media SET make_what=b SET full_auto=false :all_param IF %echo_info%==1 ECHO %param_cnt% Parameters received by _pdf2mz3 IF %echo_info%==1 ECHO %book_name%,%pg_count%,%pg_width%,%pg_height%,%pg_format%, IF %echo_info%==1 ECHO %scale%,%jpg_q_l%,%jpg_q_h%,%res_px_l%,%res_px_h%,%book_type%, IF %echo_info%==1 ECHO %zoomminscale%,%zoommaxscale%,%zoomsnap%,%zoomsteps%,%zoominit%,%maxloaded%, IF %echo_info%==1 ECHO %pagethickness%,%maxthickness%,%thumbscale%,%logo_pos%,%settings%, IF %echo_info%==1 ECHO %plugin_list%,%qualitycontrol%,%centercovers%,%cornerhint%,%pageoffset%,%dragrange%, IF %echo_info%==1 ECHO %searchmethod%,%shadows%,%searchclear%,%startpage%,%version_name%,%make_pg%, IF %echo_info%==1 ECHO %parameter_list%,%thumbloadtext%,%custom_webaddress%,%bookmark_title%,%make_what% IF %echo_info%==1 PAUSE :: Delete all double quotes SET book_name=%book_name:"=% SET version_name=%version_name:"=% SET plugin_list=%plugin_list:"=% SET parameter_list=%parameter_list:"=% SET settings=%settings:"=% SET zoomsnap=%zoomsnap:"=% SET bookmark_title=%bookmark_title:"=% SET custom_webaddress=%custom_webaddress:"=% IF %echo_info%==1 ECHO make_what %make_what% bookmark_title %bookmark_title% make_pg %make_pg% IF %echo_info%==1 PAUSE IF NOT [%book_type%]==[pdf] goto no_chk_pdf2swf IF [%make_pg%]==[n] goto no_chk_pdf2swf :: ------------------------------------------------------------- :: The installation location of the swftools pdf to swf converter :: CHANGE THIS TO WHERE YOUR INSTALLATION OF THE SWFTOOLS IS SET PDF2SWF=C:\Arquivos de programas\SWFTools\pdf2swf.exe :: -------------------------------------------------------------- :: Defaults workaround for x64 platforms. IF NOT EXIST "%PDF2SWF%" ( IF EXIST "C:\Program Files (x86)\SWFTools\pdf2swf.exe" ( SET PDF2SWF=C:^\Program Files ^(x86^)^\SWFTools\pdf2swf.exe ) ) :: Work around if swftol is installed at C: level IF NOT EXIST "%PDF2SWF%" ( IF EXIST "C:\SWFTools\pdf2swf.exe" ( SET PDF2SWF=C:^\SWFTools\pdf2swf.exe ) ) :: Test if the swftools are installed... IF NOT EXIST "%PDF2SWF%" GOTO swftools :: -------------------------------------------------------------- :no_chk_pdf2swf SET F_NAME=%book_name% :getparam1 IF [%full_auto%]==[true] GOTO proc_param1 ECHO. IF [%book_name%] == [] GOTO no_book_name_entered ECHO Please either enter the correct name of your MZ3 book ECHO *** NO SPACES WITHIN THE NAME!! *** SET /p h_book_name="or accept %book_name% as the name of you book (Return)" IF [%h_book_name%] == [] goto proc_param1 SET book_name=%h_book_name% goto proc_param1 :no_book_name_entered SET book_name=demo ECHO If your book is not named demo enter the name of your MZ3 book SET /p h_book_name="*** No spaces ***, without extension .pdf!: " IF [%h_book_name%] == [] GOTO proc_param1 SET book_name=%h_book_name% :proc_param1 ::SET book_name=%book_name:"=% ::SET book_name=%book_name:"=% SET F_NAME=%book_name% IF [%book_type%]==[pdf] SET pdf_name=%book_name%.pdf IF NOT [%book_type%]==[pdf] ECHO A book of type %book_type% will be created IF [%book_type%]==[pdf] if NOT [%make_pg%]==[n] ECHO A book type %book_type% will be created, converting %pdf_name% into swf pages IF [%book_type%]==[pdf] if [%make_pg%]==[n] ECHO A book of type %book_type% will be created, but no pages converted. IF [%echo_info%]==[1] ECHO pdf_name %pdf_name% book_name %book_name% book_type %book_type% IF [%make_what%]==[n] goto convert_pages :: skip check for PDF file in case of pages are not to be converted or it is not a pdf type of book IF [%make_pg%]==[n] goto chk_param2_pg IF NOT [%book_type%]==[pdf] goto chk_param2 :: check if pdf file exists IF EXIST %pdf_name% goto chk_param2 ECHO. ECHO No PDF file named %pdf_name% found ECHO Please copy the pdf file %pdf_name% to this folder: %CD% GOTO no_book_name_entered :chk_param2 ECHO. IF %book_type%==pdf ECHO PDF file %pdf_name% found :chk_param2_pg IF [%full_auto%]==[true] GOTO getparam3 :getparam2 ECHO. SET /p h_pg_count= "How many pages should your book have (def %pg_count%; even # please): " IF [%h_pg_count%]==[] ECHO A default amount of %pg_count% pages is assumed... if NOT [%h_pg_count%]==[] set pg_count=%h_pg_count% :getparam3 IF NOT [%pg_format%]==[US] GOTO not_us SET width=816 SET height=1056 :not_us IF NOT [%pg_format%]==[DIN] goto not_din SET width=679 SET height=960 :not_din IF NOT [%version_name%]==[n] SET book_name=%book_name%_%version_name% IF [%make_what%]==[n] goto start_conv IF [%full_auto%]==[true] goto start_conv :: 816 * 1056 for a US form letter 8.5 inch :: 679 * 960 for a DIN A4 letter ECHO Hint: For a DIN A4 page is 679*960 a good combination ECHO For a US letter 8.5 inch page is 816*1056 a good combination SET /p h_width="New pagewidth (default is %width%): " IF NOT [%h_width%]==[] SET width=%h_width% SET /p h_height="New pageheight (default is %height%): " IF NOT [%h_height%]==[] SET height=%h_height% ECHO. SET scale=0 SET h_scale=0 ECHO the high resolution pages will be used for print ECHO and can be used for for higher zoom scales. SET /p h_scale="zoomscale at which a high resolution img will be loaded (def 0; no switching): " IF NOT [%h_scale%] == [] SET scale=%h_scale% :start_conv :: everything prepared, now start the conversion (if needed and requested) :: If a folder with the given name does not exist already, it will be created IF NOT EXIST %book_name%\NUL MD %book_name% IF NOT EXIST %book_name%\pages\NUL MD %book_name%\pages :: the /book and /pages folders will be created in any case! IF [%make_what%]==[n] goto prep_CD IF [%make_what%]==[c] goto prep_CD :: make_what is either m or b IF NOT EXIST %book_name%\jpgpng\NUL MD %book_name%\jpgpng IF NOT EXIST %book_name%\%book_name%\sound\NUL MD %book_name%\sound\ IF NOT EXIST %book_name%\%book_name%\video\NUL MD %book_name%\video\ :pg_folder_created IF NOT EXIST %book_name%\thumbs\NUL MD %book_name%\thumbs IF NOT EXIST _search_index\NUL MD _search_index IF NOT EXIST _custom_files\NUL MD _custom_files :: prepare parallel folders for CD copy; if megazine\ folder exists AND make_what==true :prep_cd IF [%make_what%]==[n] GOTO convert_pages IF [%make_what%]==[m] goto no_MD_make_what IF EXIST megazine\NUL GOTO yes_megazine3_framework ECHO No MegaZine3 Software found at %cd% ECHO If a copy is exists at %book_name%_CD\megazine\, this copy will be used PAUSE IF NOT EXIST %book_name%_CD\megazine\NUL GOTO no_megazine3_framework :yes_megazine3_framework :: make_what is either c or b IF NOT EXIST %book_name%_CD\NUL MD %book_name%_CD IF NOT EXIST %book_name%_CD\megazine\pages\NUL MD %book_name%_CD\megazine\pages\ IF NOT EXIST %book_name%_CD\megazine\NUL MD %book_name%_CD\megazine IF NOT EXIST %book_name%_CD\megazine\jpgpng\NUL MD %book_name%_CD\megazine\jpgpng\ IF NOT EXIST %book_name%_CD\megazine\sound\NUL MD %book_name%_CD\megazine\sound\ IF NOT EXIST %book_name%_CD\megazine\video\NUL MD %book_name%_CD\megazine\video\ IF NOT EXIST %book_name%_CD\megazine\_search_index\NUL MD %book_name%_CD\megazine\_search_index\ :: Create autrun.inf file ECHO [AutoRun] > %book_name%_CD\autorun.inf ECHO open^=megazine/megazine.exe >> %book_name%_CD\autorun.inf ECHO icon=mz3.ico >> %book_name%_CD\autorun.inf :no_MD_make_what :: if a preloader file named bookname.swf or bookname_versionname.swf is provided, this file will be copied to megazine/ also; no need to save anything first... :: The custom preloader files can be provided at _custom_files :: GOTO chk_preloader :no_megazine3_framework ECHO There is no MegaZine3 framework available (no folder named megazine/). ECHO Please download the latest version from here: ECHO http://megazine.mightypirates.de/index.php?id=download ECHO. ECHO Without a complete framework, this command file job cannot complete ECHO it's full job. Files might be missing like: preloader, plugins, asul files, ... ECHO. ECHO Copy the megazine framework here: %CD% ECHO. ECHO Please abort (CRTL-C), then copy the megazine3 files and start again. ECHO You also can continue and the MegaZine3 file and the index file will be created, ECHO but the book will not work. ECHO. PAUSE :chk_preloader :: check, if a custom preloader exists; and if so, copy that file to megazine/ :: take version preloader if exists (v), if not take book preloader if exists (b), if not take custom_preloader if exists (c, for compatibility), if no custom preloader exists take standard preloader (s); :: if not even the standard preloader exists, start book directly (m) SET preloader_type=m IF EXIST megazine\preloader.swf SET preloader_type=s IF EXIST _custom_files\custom_preloader.swf SET preloader_type=c IF EXIST _custom_files\%f_name%.swf SET preloader_type=b IF EXIST _custom_files\%book_name%.swf SET preloader_type=v IF [%preloader_type%]==[c] ( XCOPY /e /y _custom_files\custom_preloader.swf megazine\ SET preloader_name=megazine/custom_preloader.swf ) IF [%preloader_type%]==[m] ( SET preloader_name=megazine/megazine.swf ) IF [%preloader_type%]==[s] ( SET preloader_name=megazine/preloader.swf ) IF [%preloader_type%]==[b] ( XCOPY /e /y _custom_files\%f_name%.swf megazine\ SET preloader_name=megazine/%f_name%.swf ) IF [%preloader_type%]==[v] ( XCOPY /e /y _custom_files\%book_name%.swf megazine\ SET preloader_name=megazine/%book_name%.swf ) :chk_logo_name SET logo_name=gui/engine/poweredby.png SET h_logo_name=_custom_files/custom_logo IF EXIST %h_logo_name%.png ( XCOPY /e /y _custom_files\custom_logo.png megazine\ SET logo_name=custom_logo.png ) IF EXIST %h_logo_name%.jpg ( XCOPY /e /y _custom_files\custom_logo.jpg megazine\ SET logo_name=custom_logo.jpg ) IF EXIST %h_logo_name%.swf ( XCOPY /e /y _custom_files\custom_logo.swf megazine\ SET logo_name=custom_logo.swf ) :no_logo_c SET custom_pagebackground= SET h_custom_pagebackground=_custom_files/custom_pagebackground IF EXIST %h_custom_pagebackground%.png ( XCOPY /e /y _custom_files\custom_pagebackground.png megazine\ SET custom_pagebackground=custom_pagebackground.png ) IF EXIST %h_custom_pagebackground%.jpg ( XCOPY /e /y _custom_files\custom_pagebackground.jpg megazine\ SET custom_pagebackground=custom_pagebackground.jpg ) IF EXIST %h_custom_pagebackground%.swf ( XCOPY /e /y _custom_files\custom_pagebackground.swf megazine\ SET custom_pagebackground=custom_pagebackground.swf ) ECHO. ECHO The logo used is %logo_name% ECHO preloader file is %preloader_name% ECHO custom_pagebackground is %custom_pagebackground% ECHO The url linked with the logo is %custom_webaddress% (if provided and logo shown) ECHO. IF %echo_info%==1 ECHO +++ Show pdf conversion settings if book_type is pdf (it is %book_type%) :: Process all pages IF %book_type%==pdf ECHO now ready to convert using %PDF2SWF% IF [%make_what%]==[n] GOTO convert_pages IF [%make_what%]==[c] ECHO Book will be prepared for copy on media IF [%make_what%]==[b] ECHO Book will be prepared for copy on media also ECHO for number of pages %pg_count% ECHO of size %width%*%height% ECHO from PDF file %pdf_name% ECHO writing low res pages to %book_name%/pages/page_lx ECHO writing high res pages to %book_name%/pages/page_hx ECHO with pagenumbers x=1 to %pg_count% IF [%scale%] == [0] ECHO no reload of other resolution at specific zoom scale IF NOT [%scale%]==[0] ECHO change resolution at zoomscale %scale% IF NOT [%parameter_list%]==[] ECHO parameter list %parameter_list% IF NOT [%thumbloadtext%]==[] ECHO thumbloadtext %thumbloadtext% IF [%make_what%]==[c] ECHO A folder with all files needed IF [%make_what%]==[b] ECHO Parallel to the book %book_name% a folder with all files needed IF [%make_what%]==[c] ECHO for a copy on media is created with the name %book_name%_CD IF [%make_what%]==[b] ECHO for a copy on media is created with the name %book_name%_CD ECHO. ECHO *** If you want to modify more parameters ECHO *** or only want to enter the book name and page numbers: ECHO *** Start the file _set_param.bat instead of _pdf2mz3.bat! ECHO. IF [%full_auto%]==[true] goto no_pause PAUSE :no_pause :convert_pages IF %echo_info%==1 ECHO +++ create_pdf if book_type is pdf (it is %book_type%) IF [%make_pg%]==[n] goto no_create_pg IF NOT [%book_type%]==[pdf] GOTO create_mz3 FOR /L %%i IN (1,1,%pg_count%) DO ( ECHO Processing page %%i "%PDF2SWF%" -q -t -T 9 -s internallinkfunction=megazine.PDFlinkHandler -j%jpg_q_h% -s zoom=%res_px_h% -G -p %%i -f "%pdf_name%" "%book_name%/pages/page_h%%i.swf" "%PDF2SWF%" -q -t -T 9 -s internallinkfunction=megazine.PDFlinkHandler -j%jpg_q_l% -s zoom=%res_px_l% -G -p %%i -f "%pdf_name%" "%book_name%/pages/page_l%%i.swf" ) :no_create_pg :create_mz3 IF [%make_what%]==[n] goto no_mz3copy_make_what IF [%make_what%]==[m] goto no_mz3copy_make_what :: copy MegaZine3 software, search index, thumbs, images and created pages to the respective folder in %book_name%_CD ECHO Now the MegaZine3 Software, the search index and the data (jpg, png, swf, snd, vid) are copied to the CD folder IF EXIST megazine\megazine.exe COPY megazine\megazine.exe %book_name%_CD\megazine\ IF EXIST _changed_mz3_files\megazine.exe COPY _changed_mz3_files\megazine.exe %book_name%_CD\megazine\ :: IF megazine.swf already exist in CD/megazine folder it is assumed that the software already was copied, :: and another copy process is omitted. If you want a fresh copy, delete the CD/megazine folder first IF EXIST %book_name%_CD\megazine\megazine.swf goto no_mz3copy_make_what XCOPY /e /y megazine\*.* %book_name%_CD\megazine\ :no_mz3copy_make_what IF [%make_what%]==[m] goto build_index_file IF NOT [%make_pg%]==[n] XCOPY /e /y %book_name%\pages\*.* %book_name%_CD\megazine\pages\ IF [%make_what%]==[n] goto end XCOPY /e /y VERSION. %book_name%_CD\ XCOPY /e /y COPYING. %book_name%_CD\ XCOPY /e /y README. %book_name%_CD\ IF exist _search_index\%f_name%.txt XCOPY /e /y _search_index\%f_name%.txt %book_name%_CD\megazine\_search_index\ IF [%make_what%]==[c] goto build_index_file XCOPY /e /y %book_name%\jpgpng\*.* %book_name%_CD\megazine\jpgpng\ XCOPY /e /y %book_name%\video\*.* %book_name%_CD\megazine\video\ XCOPY /e /y %book_name%\sound\*.* %book_name%_CD\megazine\sound\ XCOPY /e /y %book_name%\thumbs\*.* %book_name%_CD\megazine\thumbs\ :build_index_file IF [%make_what%]==[c] goto build_mz3_file ECHO Now creating the index_%book_name%.html files :: Write Index_File ECHO ^<^^!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"^> >index_%book_name%.html ECHO ^ >>index_%book_name%.html ECHO ^
>>index_%book_name%.html ECHO ^^^^^