Jump to content
Sign in to follow this  
libreau3

Comic Book Archives

Recommended Posts

libreau3

Hello all I was wondering if any one new of a way to extract the files from a Comic Book Archive (.cbr)?

My original thought was to use 7za.exe (&-zip console app) but when I run:

7za x 1.cbr 

7-zip returns:

Processing archive: 1.cbr
Error: Can not open file as archive
 
Does anyone a suggestion or other method?
PS I am trying to make a .cbr to .pdf script

Share this post


Link to post
Share on other sites
libreau3

Thnx for the GREAT HELP. It was mind blowing. I mean really Kaboom, there is nothing but smoldering ash left on my shoulders.

I already knew all of that I just wanted to make my own cbr to pdf.

Share this post


Link to post
Share on other sites
orbs

i'm truely glad i could help! i guess you'll just have to study the internals of the .cbr format yourself, or find a reader application that supports conversion to PDF and has an API.

b.t.w. some hints suggest that .cbr is actually a .rar format, so you can rename the extension and call the console version of WinRAR to extract the images, then automate some standard image viewer application to print the images to PDF.

ready... set... GO!  :bike:

Share this post


Link to post
Share on other sites
libreau3

b.t.w. some hints suggest that .cbr is actually a .rar format, so you can rename the extension and call the console version of WinRAR to extract the images,

Been there done that. I have a brain and am quite capable of reading the first to links on Google.

Share this post


Link to post
Share on other sites
Melba23

libreau3,

Please lose the attitude. You made no mention of any previous knowledge in the OP so you have absolutely no right to complain when someone offers you help. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Melba23

libreau3,

Thanks. And we now return to our normal programming. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Mobius

@OP,

7ZA.exe is the standalone version of the 7zip download that only supports 7z, xz, ZIP, GZIP, BZIP2 and TAR formats natively.

So looking at this copied information about comic book formats from the wiki:

.cb7 → 7z

.cba → ACE

.cbr → RAR

.cbt → TAR

.cbz → ZIP

Of course 7za will fail on the cbr file you posted about.

There are dynamic link libraries (and command line binaries) available for extraction of these archive formats available on the web, should you wish to automate the process or write your own application.

There are even some pdf user defined functions and examples on this forum if you search.

Regarding extraction:

The simplest method is merely to automate command-line applications for the various formats, a good example of a tool that does this is universal extractor;

http://legroom.net/software/uniextract

Whose AutoIt sourcecode (available at the site) might assist you; should you decide upon this method for your tool.

Where you go from here is upto you.

Vlad

Share this post


Link to post
Share on other sites
MHz

Does anyone a suggestion or other method?

PS I am trying to make a .cbr to .pdf script

I use the open source program named Calibre to do these tasks. It has many command line tools to handle ebook tasks such as this and is good to use with AutoIt. For conversion tasks, you can have a look here that shows many parameters available to use. If interested. Calibre has plenty of features to discover if your into the ebook stuff. Your problem could be handled perhaps in just one line of code.

  • Like 1

Share this post


Link to post
Share on other sites
libreau3

Regarding extraction:

The simplest method is merely to automate command-line applications for the various formats, a good example of a tool that does this is universal extractor.

Mobius,

     I installed uniextract and went through the binarys. In there I found several exe that will work.

Thnx for that idea.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • robertocm
      By robertocm
      change linked image paths in excel 2007 Open XML Files with AutoIt and 7-zip:
      #include <File.au3> ;Change this Local $sFind = "C:\Users\MyUserName\Documents\MyImageFolder\My%20Image1.png" Local $sReplace = "C:\Users\ANOTHERUSERNAME\Documents\AnotherImageFolder\My%20Image1.png" Local Const $sMessage = "Directory to change excel image paths" Local $sFileSelectFolder = FileSelectFolder($sMessage, "") Local $sTempDir = @ScriptDir & "\testdir" ;Required 7-zip Local $PathZipProgram = @ProgramFilesDir & "\7-Zip\" If Not(FileExists($PathZipProgram & "\7z.exe")) Then MsgBox(16, "", "7z.exe not found in path " & $PathZipProgram) Exit EndIf ;look for excel files in selected directory and all subdirectories Local $SFileList = _FileListToArrayRec($sFileSelectFolder, "*.xls.;*.xlsm", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) If Not @error Then For $i = 1 To $SFileList[0] DirRemove($sTempDir, 1) ;use x command to keep the folder stucture, -aoa Overwrite All existing files without prompt, use -r to unzip the subfolders from the zip file RunWait('"' & $PathZipProgram & '7z.exe" x -aoa -r "' & $SFileList[$i] & '" -o"' & $sTempDir & '" -y', $PathZipProgram, @SW_HIDE) __ReplaceImagePaths($sTempDir, $sFind, $sReplace) RunWait('"' & $PathZipProgram & '7z.exe" a -r "' & $SFileList[$i] & '" "' & $sTempDir & '\*" -tzip -y', $PathZipProgram, @SW_HIDE) Next Else MsgBox(16, "Error", "No files were found in the folder specified.") EndIf DirRemove($sTempDir, 1) Func __ReplaceImagePaths($sTempDir, $sFind, $sReplace) ;List all files with .xml.rels extension in the directory \xl\drawings\_rels Local $aFileList = _FileListToArray($sTempDir & "\xl\drawings\_rels", "*.xml.rels", 1, True) If @error = 1 Then ;MsgBox (0, "", "Path was invalid") SplashTextOn("Title", "Path was invalid", -1, -1, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Exit EndIf If @error = 4 Then ;MsgBox (0, "No files", "No files were found") SplashTextOn("Title", "No files were found", -1, -1, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Exit EndIf Local $iRetval ;Loop through the array For $i = 1 To $aFileList[0] $iRetval = _ReplaceStringInFile($aFileList[$i], $sFind, $sReplace) Next EndFunc  
      Some references:
      https://stackoverflow.com/questions/37145369/change-path-to-picture-links-in-excel http://www.jkp-ads.com/Articles/Excel2007FileFormat.asp EDITED:
      Note: it seems that if User Account Control (UAC) is enabled then 7zip is unable to overwrite the destination file (using the same name).
      In this case, a possible solution would be to rename the original excel file before (see _PathSplit in help file).
      In my case i prefer just to disable UAC
    • tintin92
      By tintin92
      Hello,

      How can I automatically download a list of zip files, like the ones in the quote, using a AutoIt script?
      Is it possible with AutoIt script?
       
    • Kevin Finnegan
      By Kevin Finnegan
      Hi all,
      Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
      I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
      Here is the working version:
      ; Compress the directories one by one in the zip using the listfile.... Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _ & $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD) Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.
       
    • ur
      By ur
      I got a UDF to zip the files from below link.
      With this I am able to create a zip file but the post processing of zip file creation I am checking the zip file exists or not, but it is giving the message as file not found.
       
      Any sugestions??
      #include "Zip.au3" ZipLogs() Func ZipLogs() $ResultsFolder = @ScriptDir & "\Results" $ResultsDestFolder = @ScriptDir & "\Results_Archive" $zipFile = $ResultsDestFolder & "\Results_"&TodayDateTime()&".zip" DirCreate($ResultsDestFolder) Dim $Zip = _Zip_Create($zipFile) ;Create The Zip File. Returns a Handle to the zip File _Zip_AddFolderContents($Zip, $ResultsFolder) ;Add a folder's content in the zip file if FileExists(@ScriptDir&"\Logging.log") then _Zip_AddFile($Zip,@ScriptDir&"\Logging.log") FileDelete(@ScriptDir&"\Logging.log") EndIf if FileExists(@ScriptDir&"\RemoteExecution_Log.txt") then _Zip_AddFile($Zip,@ScriptDir&"\RemoteExecution_Log.txt") FileDelete(@ScriptDir&"\RemoteExecution_Log.txt") EndIf if FileExists($zipFile) then DirRemove($ResultsFolder,$DIR_REMOVE) Else MsgBox(0,"","Zip file not found") EndIf return $zipFile EndFunc  
      Zip.au3
    • careca
      By careca
      Hi there, my aim was to be able to pack files, even inside folders, into a .dat file (just because) and then extract the files from it, while retaining the path structure.
      Run the script as normal, drag files and or folders into the listview, when all files you want to pack are there, press "go" button.
      Doesn't work if you drag from multiple sources, only admits drag and drop from the same folder.
      SFX.dat is created, to extract them back run the script with '/ext' parameter, it extracts the .ini which is what holds the filenames, then it extracts the file one by one efectivelly splitting .dat into pieces and writing those pieces into new files. There you go.
      This is a proof of concept, not sure it will be of use to anyone, but there you go.
      #Region ;Wrapper ;#RequireAdmin ;Disables Console #pragma compile(UPX, false) #pragma compile(CompanyName, '') #pragma compile(ProductVersion, 1.0) #pragma compile(FileVersion, 1.0) #pragma compile(x64, false) #pragma compile(Icon, 'Archive1.ico') #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_ShowProgress=y #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Icon='Archive1.ico' #AutoIt3Wrapper_Res_Icon_Add='Archive1.ico' #Autoit3Wrapper_Testing=n #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_AU3Check=y #AutoIt3Wrapper_Run_Debug_Mode=n #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #EndRegion ;Wrapper ;============================================================================= #Region ;FileInstall #include <File.au3> #include <Marquee.au3> #include <WinAPIEx.au3> #include <Constants.au3> #include <GuiListView.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Global $__aGUIDropFiles = 0, $__hGUI = 0 Local $StringSep = 'SeparateHere' Local $WFl, $Split, $Fop, $FRd, $Listview, $ContextMenu, $aReturn, $aList Local $GetItemTxt1, $GetItemTxt2, $SectArray, $IRead, $SplitIni, $Splt, $Dir, $DropDir, $DropDirIni Local $GMarquee, $Progress_1, $LabelP ;============================================================================= ;RegWrite( ;============================================================================= Local $aProcessList = ProcessList(@AutoItPID) If $aProcessList[0][1] >= 2 Then Exit OnAutoItExitRegister("Quit") Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 1) #EndRegion ;FileInstall FileInstall("Marquee.au3", @TempDir & "\Marquee.au3") FileInstall("Archive1.ico", @TempDir & "\Archive1.ico", 0) TraySetIcon(@TempDir & "\Archive1.ico") GUISetIcon(@TempDir & "\Archive1.ico") ;============================================================================= If StringInStr($cmdlineRaw, "/source") Then FileInstall("SFX.au3", @TempDir & "\SFX.au3", 0) Exit ElseIf StringInStr($cmdlineRaw, "/Ext") Then If FileExists($CmdLine[2]) Then $GMarquee = GUICreate("SFX", 240, 70, -1, @DesktopHeight / 4) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Progress_1 = GUICtrlCreateProgress(10, 10, 220, 20, 0x0008) $LabelP = GUICtrlCreateLabel('Working...', 10, 40, 100) GUISetState(@SW_SHOW) _ProgressMarquee_Start($Progress_1) ;Start $WFl = FileOpen($CmdLine[2], 512) $FRd = FileRead($WFl) $Split = StringSplit($FRd, $StringSep, 1) FileWrite('SFX.ini', Binary($Split[1])) $DropDirIni = IniRead("SFX.ini", "Path", 'DropDir', '') $SectArray = IniReadSection('SFX.ini', 'Binary') For $f = 1 To $SectArray[0][0] DirCreate($DropDirIni) FileWrite($DropDirIni & $SectArray[$f][0], Binary($Split[$f + 1])) Next FileClose($WFl) _ProgressMarquee_Stop($Progress_1) ;Stop GUIDelete($GMarquee) MsgBox(64, 'SFX', 'Complete!') FileDelete('SFX.ini') Exit Else MsgBox(64, 'Error', 'Parameter wrong or file not found: ' & @CRLF & 'Syntax Example: SFX.exe /Ext "C:\Somefile.dat"') EndIf Else ;StringInStr($cmdlineRaw, "/Build") Then $__hGUI = GUICreate('Drag&Drop Multiple Files', 600, 315, 100, 100, Default, $WS_EX_ACCEPTFILES) $Listview = GUICtrlCreateListView('Path|Size', 10, 10, 580, 258, $LVS_SHOWSELALWAYS + $LVS_SINGLESEL + $LVS_EDITLABELS + $LVS_NOSORTHEADER, $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) $ContextMenu = GUICtrlCreateContextMenu($Listview) GUICtrlCreateMenuItem("Delete", $ContextMenu, 1) GUICtrlSetOnEvent(-1, "Delete") GUICtrlCreateMenuItem("Clear List", $ContextMenu, 2) GUICtrlSetOnEvent(-1, "Clear") GUICtrlCreateButton('Go', 10, 280, 50, -1) GUICtrlSetOnEvent(-1, 'Go') GUICtrlSetBkColor($Listview, 0x888888) GUICtrlSetState($Listview, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW, $__hGUI) TraySetIcon(@TempDir & "\Archive1.ico") GUISetIcon(@TempDir & "\Archive1.ico") GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_DROPPED, "Drop") GUIRegisterMsg($WM_DROPFILES, 'WM_DROPFILES') _WinAPI_ChangeWindowMessageFilterEx($__hGUI, $WM_DROPFILES, $MSGFLT_ALLOW) _WinAPI_ChangeWindowMessageFilterEx($__hGUI, $WM_COPYDATA, $MSGFLT_ALLOW) _WinAPI_ChangeWindowMessageFilterEx($__hGUI, $WM_COPYGLOBALDATA, $MSGFLT_ALLOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(500) WEnd GUIDelete($__hGUI) EndIf ;============================================================================= Func Go() $GMarquee = GUICreate("SFX", 240, 70, -1, @DesktopHeight / 4) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Progress_1 = GUICtrlCreateProgress(10, 10, 220, 20, 0x0008) $LabelP = GUICtrlCreateLabel('Working...', 10, 40, 100) GUISetState(@SW_SHOW) _ProgressMarquee_Start($Progress_1) ;Start If _GUICtrlListView_GetItemCount($Listview) <> 0 Then For $c = 0 To _GUICtrlListView_GetItemCount($Listview) - 1 $GetItemTxt1 = _GUICtrlListView_GetItemText($Listview, $c, 0) $GetItemTxt2 = _GUICtrlListView_GetItemText($Listview, $c, 1) IniWrite('SFX.ini', 'Binary', $GetItemTxt1, $GetItemTxt2) Next EndIf $SectArray = IniReadSection("SFX.ini", "Binary") $DropDirIni = IniRead("SFX.ini", "Path", 'DropDir', '') $Fop = FileOpen('SFX.ini', 16) $FRd = FileRead($Fop) FileClose($Fop) $WFl = FileOpen('SFX.Dat', 26) FileWrite($WFl, $FRd & StringToBinary($StringSep, 1)) FileDelete('SFX.ini') ;============================================================================= For $s = 1 To $SectArray[0][0] $Fop = FileOpen($DropDir & $SectArray[$s][0], 16) $FRd = FileRead($Fop) FileClose($Fop) FileWrite($WFl, $FRd & StringToBinary($StringSep, 1)) Next FileClose($WFl) _ProgressMarquee_Stop($Progress_1) ;Stop GUIDelete($GMarquee) MsgBox(64, 'SFX', 'Complete!') EndFunc ;==>Go ;============================================================================= Func Delete() _GUICtrlListView_DeleteItemsSelected($Listview) EndFunc ;==>Delete ;============================================================================= Func Clear() _GUICtrlListView_DeleteAllItems($Listview) EndFunc ;==>Clear ;============================================================================= Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $lParam Switch $iMsg Case $WM_DROPFILES Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam) If UBound($aReturn) Then $__aGUIDropFiles = $aReturn Else Local Const $aError[1] = [0] $__aGUIDropFiles = $aError EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES ;============================================================================= Func Drop() $GMarquee = GUICreate("SFX", 240, 70, -1, @DesktopHeight / 4) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Progress_1 = GUICtrlCreateProgress(10, 10, 220, 20, 0x0008) $LabelP = GUICtrlCreateLabel('Working...', 10, 40, 100) GUISetState(@SW_SHOW) _ProgressMarquee_Start($Progress_1) ;Start $DropDir = StringLeft($__aGUIDropFiles[1], StringInStr($__aGUIDropFiles[1], '\', 2, -1)) IniWrite('SFX.ini', 'Path', 'DropDir', StringLeft($__aGUIDropFiles[1], StringInStr($__aGUIDropFiles[1], '\', 2, -1))) For $i = 1 To $__aGUIDropFiles[0] Local $StrDropCheckFolder = StringInStr($__aGUIDropFiles[$i], '.') If $StrDropCheckFolder = 0 Then $aList = _FileListToArrayRec($__aGUIDropFiles[$i], '*', 1, 1, 0, 2) For $f = 1 To $aList[0] GUICtrlCreateListViewItem(StringTrimLeft($aList[$f], StringLen($DropDir)) & '|' & FileGetSize($aList[$f]), $Listview) GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 0, -1) GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 1, -1) Next Else GUICtrlCreateListViewItem(StringTrimLeft($__aGUIDropFiles[$i], StringLen($DropDir)) & '|' & FileGetSize($__aGUIDropFiles[$i]), $Listview) GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 0, -1) GUICtrlSendMsg($Listview, $LVM_SETCOLUMNWIDTH, 1, -1) EndIf Next _ProgressMarquee_Stop($Progress_1) ;Stop GUIDelete($GMarquee) EndFunc ;==>Drop ;============================================================================= Func Quit() Exit EndFunc ;==>Quit ;============================================================================= EDIT: Bugfixes, now uses parameter to extract a specific filename .dat:
      sfx.exe /ext "Filepath.dat"
      It extracts to the same path as when it was packed.
      Regfile to call the unpack (exe path has to be adjusted):
       
×