topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 4:03 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: software to build ebook by importing PDF files and creating table of contents  (Read 5790 times)

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
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.

Can anyone help me?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
I don't know an answer, but i think dc member ewemoa has looked into such tools.  maybe he can post his discoveries..

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
I looked into Calibre and it doesn't really have that capability

xtabber

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 618
    • View Profile
    • Donate to Member
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.

Can anyone help me?
Take a look at PDF EX-Change Pro. It's extremely powerful, although its user interface is not always intuitive. Many features are hard to find and the documentation dense and not that easy to navigate.

PDF EXchange Editor provides an option to automatically create a top level bookmark pointing to each new document inserted into an existing document, as well as a bookmark editor and macro facility that should be enough to do what you want. The Pro version costs nearly twice as much, but adds tools that would allow you to more fully automate the process.

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
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.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
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:

Scriba

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
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.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
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.

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 [Select]
  1. ;PdfMergeMark  (by nod5  version 160924)
  2. ;Merge (concatenate, join) pdf files and add bookmarks
  3.  
  4. ;How to use:
  5. ;1 Install PDFtk Server for Windows, https://www.pdflabs.com/tools/pdftk-server/
  6. ;2 Create pdflist.txt in same folder as PdfMergeMark.ahk
  7. ;3 Add one pdf file path per line, in the order you want. Save.
  8. ;4 Run PdfMergeMark.ahk  --> outputs yyyymmddhhmmss.pdf
  9.  
  10. ;pdflist.txt example:
  11. ;C:\test\file name.pdf
  12. ;C:\folder\another.pdf
  13. ;C:\some other folder\this file.pdf
  14.  
  15. ;optional: custom path to pdftk
  16. pdftk =
  17. out := A_ScriptDir "\" a_now ".pdf"
  18. if !FileExist(pdftk)
  19.   pdftk := A_ScriptDir "\pdftk.exe"
  20. if !FileExist(pdftk)
  21.   pdftk = C:\Program Files (x86)\PDFtk Server\bin\pdftk.exe
  22. if !FileExist(pdftk) or !FileExist(A_ScriptDir "\pdflist.txt")
  23. clip := ClipBoardAll
  24. p := 1
  25. Loop, Read, %A_ScriptDir%\pdflist.txt
  26. {
  27. SplitPath, A_LoopReadLine, name,,ext, noext
  28. If !FileExist(A_LoopReadLine) or (ext!="pdf")
  29. tooltip, Reading... %A_LoopReadLine%
  30. runwait %comspec% /c ""%pdftk%" "%A_LoopReadLine%" dump_data | clip",,hide
  31. RegExMatch(clipboard, "NumberOfPages: (\d+)\R",pages)  ;NumberOfPages: 154 -> 154
  32. bm .= "`nBookmarkBegin"
  33. bm .= "`nBookmarkTitle: " noext
  34. bm .= "`nBookmarkLevel: 1"
  35. bm .= "`nBookmarkPageNumber: " p
  36. p := p + pages1
  37. pdfstring .= A_Space """" A_LoopReadLine """"
  38. }
  39. FileAppend, %bm%, %out%_txt
  40. tooltip, Concatenating...
  41. runwait "%pdftk%" %pdfstring% cat output "%out%_temp",,hide    ;concatenate pdfs
  42. runwait "%pdftk%" A="%out%_temp" cat A1-end output "%out%_temp2",,hide ;del old bookmarks
  43. tooltip, Bookmarking...
  44. runwait "%pdftk%" "%out%_temp2" update_info "%out%_txt" output "%out%",,hide  ;new bookmarks
  45. FileDelete, %out%_* ; clear temp files
  46. clipboard := clip   ;restore clipboard
  47. tooltip, FINISHED
  48. sleep 1000

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:\folder\another.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.

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
I think this one can do what you asked for
http://www.sejda.com/desktop