ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

software to build ebook by importing PDF files and creating table of contents

<< < (2/2)

I will do that.

I've been searching for the past hour and hope to find an easy to use and good solution.

It doesn't have to be freeware if it works well.

I do not know enough about eBooks to discern if this utility would be helpful.  But it is open source and may be worth a look:


Would it perhaps be easier to copy/paste your articles into something like Google Docs, adjust the formatting a bit (as needed) so it knows how to update the table of contents, and then export as PDF?

It might not take very long in each article to select the title and headings and change their formatting as appropriate, especially if you use keyboard shortcuts.

I have a lot of articles that I've written that I want to assemble into one or more ebooks.

I can easily format each as a PDF file, but I don't know what software to use to merge them all, in the correct order, and at the same time create a table of contents that updates every time I add a new file.
-HankFriedman (September 19, 2016, 12:25 AM)
--- End quote ---

Hi Hank. This might help, but only if you with ebook had in mind a merged .pdf file rather than .epub (reflowing text).

I updated an older autohotkey script of mine. It now uses pdftk to merge many pdf files to one big pdf with one bookmark per component pdf file. the order is set in a plain txt file so it is easy to add/rearrange.

--- Code: Autohotkey ---#SingleInstance,Force;PdfMergeMark  (by nod5  version 160924);Merge (concatenate, join) pdf files and add bookmarks ;How to use:;1 Install PDFtk Server for Windows,;2 Create pdflist.txt in same folder as PdfMergeMark.ahk;3 Add one pdf file path per line, in the order you want. Save.;4 Run PdfMergeMark.ahk  --> outputs yyyymmddhhmmss.pdf ;pdflist.txt example:;C:\test\file name.pdf;C:\folder\another.pdf;C:\some other folder\this file.pdf ;optional: custom path to pdftkpdftk =out := A_ScriptDir "\" a_now ".pdf"if !FileExist(pdftk)  pdftk := A_ScriptDir "\pdftk.exe"if !FileExist(pdftk)  pdftk = C:\Program Files (x86)\PDFtk Server\bin\pdftk.exeif !FileExist(pdftk) or !FileExist(A_ScriptDir "\pdflist.txt") exitappclip := ClipBoardAllclipboard =p := 1Loop, Read, %A_ScriptDir%\pdflist.txt{SplitPath, A_LoopReadLine, name,,ext, noextIf !FileExist(A_LoopReadLine) or (ext!="pdf") continuetooltip, Reading... %A_LoopReadLine%runwait %comspec% /c ""%pdftk%" "%A_LoopReadLine%" dump_data | clip",,hideRegExMatch(clipboard, "NumberOfPages: (\d+)\R",pages)  ;NumberOfPages: 154 -> 154bm .= "`nBookmarkBegin"bm .= "`nBookmarkTitle: " noextbm .= "`nBookmarkLevel: 1"bm .= "`nBookmarkPageNumber: " pp := p + pages1pdfstring .= A_Space """" A_LoopReadLine """"}FileAppend, %bm%, %out%_txttooltip, Concatenating...runwait "%pdftk%" %pdfstring% cat output "%out%_temp",,hide    ;concatenate pdfsrunwait "%pdftk%" A="%out%_temp" cat A1-end output "%out%_temp2",,hide ;del old bookmarkstooltip, Bookmarking...runwait "%pdftk%" "%out%_temp2" update_info "%out%_txt" output "%out%",,hide  ;new bookmarksFileDelete, %out%_* ; clear temp filesclipboard := clip   ;restore clipboardtooltip, FINISHEDsleep 1000tooltip
The pdflist.txt can be created and edited in Notepad. Put the path of each pdf file to merge in the order you want.

--- ---C:\test\file name.pdf
C:\some other folder\this file.pdf
Some limitations:
All bookmarks are on the same level, in other words no tree view of bookmarks (chapter 1, 1.1,  ...)
No bookmark numbering (unless the user adds numbers to the filenames)
May fail if pdflist is very, very long (when exceeding maximum line string length for cmd)

I might add some more stuff later on and make a small NANY release out of it.

I think this one can do what you asked for


[0] Message Index

[*] Previous page

Go to full version