Advertisement
Guest User

Convert VitalSource Bookshelf vbk ebooks to PDF v2

a guest
Sep 4th, 2011
19,907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.67 KB | None | 0 0
  1. DMT's magically awesome 2010 guide to...
  2. ========================================
  3.  
  4. - How to convert VitalSource BookShelf E-books (.vbk) to PDF
  5.  
  6. - How to remove DRM from VitalSource Bookshelf E-books
  7.  
  8. - How to Remove DRM from .vbk files
  9.  
  10. - How to be realise that DMT loves you
  11.  
  12. * All conveniently the same thing, but we has to make our offerings to the Google overlords. When you make offerings, the overlords see fit to pass knowledge to more persons. We find this a tolerable trade-off. For now.
  13.  
  14.  
  15. þ Ü±Ü þ
  16. ÛÛÛÛÛ ÞÜ ÜÛÜ ÜÝ ÛÛÛÛÛ
  17. ÛÛÛÛÛ ÛÛÜÜÜÛÛÛÛÛÜÜÜÛÛ ÛÛÛÛÛ
  18. ÛÛÛÛÛ ßßßßßßßßßßßßßßß ÛÛÛÛÛ
  19. ÛÛÛÛÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
  20. ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
  21. ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
  22. ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
  23. ÛÛÛÛÛÜÜÜÜÜÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÜÜÜÜÜÛÛÛÛÛ
  24.  
  25. °°°°° DO MORE TRIBE °°°°°
  26.  
  27. °°°°° PROUDLY PRESENTS °°°°°
  28. ±±±±± ±±±±±
  29. ²²²²² Company: VitalSource ²²²²²
  30. ÛÛÛÛÛ Product: BookShelf E-books ÛÛÛÛÛ
  31. ÛÛÛÛÛ Protection: Evil proprietary DRM ÛÛÛÛÛ
  32. ÛÛÛÛÛ Platform: Windows + Mac ÛÛÛÛÛ
  33. ÜÛÛÛÛÛÜ ÜÛÛÛÛÛÜ
  34. ÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜ
  35. ÛÛÛÛÛßß ßßÛÛÛÛÛ
  36. ÛÛÛÛÛ ÛÛÛÛÛ
  37. ÛÛÛÛÛ We are coming for this world.. ÛÛÛÛÛ
  38. ÛÛÛÛÛ ÛÛÛÛÛ
  39. ÛÛÛÛÛ ÛÛÛÛÛ
  40. ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
  41. ÛÛÛÛÛ ÛÛÛÛÛ
  42. ÛÛÛÛÛ Do More Tribe is proud to announce the release of a new ÛÛÛÛÛ
  43. ÛÛÛÛÛ DRM-removal technique. VitalSource BookShelf sells DRM'd Ebooks ÛÛÛÛÛ
  44. ÛÛÛÛÛ in a proprietary format. ÛÛÛÛÛ
  45. ÛÛÛÛÛ ÛÛÛÛÛ
  46. ÛÛÛÛÛ We find this unacceptable. ÛÛÛÛÛ
  47. ÛÛÛÛÛ ÛÛÛÛÛ
  48. ÛÛÛÛÛ If you pay for an ebook, it is yours to view on any device you ÛÛÛÛÛ
  49. ÛÛÛÛÛ own. Do not let anyone ever tell you otherwise. It's very ÛÛÛÛÛ
  50. ÛÛÛÛÛ surprising that nobody on the interwebs seems to have figured out ÛÛÛÛÛ
  51. ÛÛÛÛÛ how to bypass the restriction. It's quite a fun little trick. ÛÛÛÛÛ
  52. ÛÛÛÛÛ ÛÛÛÛÛ
  53. ÛÛÛÛÛ The VitalSource Bookshelf software allows you to print your ÛÛÛÛÛ
  54. ÛÛÛÛÛ Ebook, but only 5 pages at a time. On the surface this would ÛÛÛÛÛ
  55. ÛÛÛÛÛ seem to foil the print-to-PDF method, however using some ÛÛÛÛÛ
  56. ÛÛÛÛÛ AppleScript magic we can have their own software do all the work ÛÛÛÛÛ
  57. ÛÛÛÛÛ for us ;) ÛÛÛÛÛ
  58. ÛÛÛÛÛ ÛÛÛÛÛ
  59. ÛÛÛÛÛ You will need a computer running MacOS in order to do this, ÛÛÛÛÛ
  60. ÛÛÛÛÛ however the resulting PDF will work on any computer. There are ÛÛÛÛÛ
  61. ÛÛÛÛÛ VMWare images of MacOS available online if you don't have a Mac. ÛÛÛÛÛ
  62. ÛÛÛÛÛ ÛÛÛÛÛ
  63. ÛÛÛÛÛ The AppleScript code below will dump the entire ebook out into ÛÛÛÛÛ
  64. ÛÛÛÛÛ a bunch of pdfs, each containing 5 pages each. We can then ÛÛÛÛÛ
  65. ÛÛÛÛÛ easily merge them together to create one DRM-free PDF containing ÛÛÛÛÛ
  66. ÛÛÛÛÛ all the pages. ÛÛÛÛÛ
  67. ÛÛÛÛÛ ÛÛÛÛÛ
  68. ÛÛÛÛÛ 1. Open your ebook up in the VitalSource app. ÛÛÛÛÛ
  69. ÛÛÛÛÛ ÛÛÛÛÛ
  70. ÛÛÛÛÛ 2. Load up AppleScript and paste in the following code: ÛÛÛÛÛ
  71.  
  72. set totalPages to 340
  73. set startPage to 0
  74. set authorName to "DMT"
  75.  
  76. tell application "VitalSource Bookshelf"
  77. activate
  78. repeat with theIncrementValue from startPage to totalPages - 1 by 5
  79. if (theIncrementValue = 0) then
  80. set thisValue to "a"
  81. else
  82. set thisValue to theIncrementValue
  83. end if
  84. tell application "System Events" to keystroke "p" using command down
  85. tell application "System Events" to keystroke thisValue as string
  86. tell application "System Events" to keystroke tab
  87. tell application "System Events" to keystroke theIncrementValue + 5 as string
  88. tell application "System Events" to keystroke tab
  89. tell application "System Events" to keystroke return
  90. tell application "System Events" to keystroke return
  91. tell application "System Events" to keystroke "p" using command down
  92. tell application "System Events" to keystroke theIncrementValue as string
  93. tell application "System Events" to keystroke tab
  94. tell application "System Events" to keystroke tab
  95. tell application "System Events" to keystroke authorName
  96. tell application "System Events" to keystroke return
  97. delay 7
  98. end repeat
  99. end tell
  100.  
  101. ÛÛÛÛÛ Or if the above doesn't work. ÛÛÛÛÛ
  102.  
  103. # Saves current document open in VitalSource Bookshelf as PDF
  104.  
  105. set totalPages to 497
  106. set startPage to 1
  107.  
  108. activate application "VitalSource Bookshelf"
  109. tell application "System Events"
  110. tell process "VitalSource Bookshelf"
  111. repeat with theIncrementValue from startPage to totalPages - 1 by 10
  112. set thisValue to theIncrementValue
  113.  
  114. # Wait until the first Print dialog opens before proceeding
  115. repeat until exists window "Print"
  116. # Open the print dialog
  117. keystroke "p" using command down
  118. end repeat
  119.  
  120. # First print dialoge. Print pages ten at a time.
  121. keystroke thisValue as string
  122. keystroke tab
  123. keystroke thisValue + 9 as string
  124. keystroke tab
  125. # delay 2
  126. click button "Continue" of window "Print"
  127.  
  128. # Wait until the second Print dialog opens before proceeding
  129. repeat until exists window "Print"
  130. end repeat
  131.  
  132. # Expand the "PDF" menu button (must be expanded before the menu is referencable)
  133. click menu button "PDF" of window "Print"
  134.  
  135. # Wait until the Menu button menu is created before proceeding
  136. repeat until exists menu item "Save as PDF…" of menu 1 of menu button "PDF" of window "Print"
  137. end repeat
  138.  
  139. # Select the "Save as PDF" menu item
  140. click menu item "Save as PDF…" of menu 1 of menu button "PDF" of window "Print"
  141.  
  142. # Wait until the Save dialog opens before proceeding
  143. repeat until exists window "Save"
  144. end repeat
  145.  
  146. # Save. Set name to page numbers saved.
  147. keystroke thisValue as string
  148. keystroke "_"
  149. keystroke thisValue + 9 as string
  150. click button "Save" of window "Save"
  151.  
  152. # Wait for dialog to close before proceeding.
  153. repeat until not (exists window "Save")
  154. end repeat
  155. end repeat
  156. end tell
  157. end tell
  158.  
  159. ÛÛÛÛÛ Compliments of MTB. If the book starts at page "i" or some ÛÛÛÛÛ
  160. ÛÛÛÛÛ rubbish and goes on to "ii", "iii", ... "xx", ... "1", "2" ... ÛÛÛÛÛ
  161. ÛÛÛÛÛ print the "i-x" pages manually. Then follow the instructions ÛÛÛÛÛ
  162. ÛÛÛÛÛ by DMT. Start from 1 to the last page of the book. You may need ÛÛÛÛÛ
  163. ÛÛÛÛÛ to print the last ten pages manually as well. ÛÛÛÛÛ
  164.  
  165.  
  166. ÛÛÛÛÛ Did you notice how we even took away the sides of our sexy ASCII ÛÛÛÛÛ
  167. ÛÛÛÛÛ art just so you would have hassle-free copy+paste? That is how ÛÛÛÛÛ
  168. ÛÛÛÛÛ much DMT loves you <3 ÛÛÛÛÛ
  169. ÛÛÛÛÛ ÛÛÛÛÛ
  170. ÛÛÛÛÛ I'm not even joking. We really do love you. ÛÛÛÛÛ
  171. ÛÛÛÛÛ ÛÛÛÛÛ
  172. ÛÛÛÛÛ 3. Change the totalPages to the number of pages, and authorName ÛÛÛÛÛ
  173. ÛÛÛÛÛ to whatever you want that field set to in the pdf. ÛÛÛÛÛ
  174. ÛÛÛÛÛ ÛÛÛÛÛ
  175. ÛÛÛÛÛ 4. The delay of 7 seconds is quite conservative, this should do ÛÛÛÛÛ
  176. ÛÛÛÛÛ nicely for most people. If your computer is really fast then ÛÛÛÛÛ
  177. ÛÛÛÛÛ you can probably lower it a bit, but if the saving of any one ÛÛÛÛÛ
  178. ÛÛÛÛÛ pdf takes more than the delay then the script will break and ÛÛÛÛÛ
  179. ÛÛÛÛÛ you'll have to manually stop it. If this happens just set the ÛÛÛÛÛ
  180. ÛÛÛÛÛ startPage to the Next page you don't have. Pages are saved ÛÛÛÛÛ
  181. ÛÛÛÛÛ starting from 0 (page 0 is called "a" in the app, fuck knows why) ÛÛÛÛÛ
  182. ÛÛÛÛÛ and up in increments of 5, so you'll end up with 0.pdf, 5.pdf, ÛÛÛÛÛ
  183. ÛÛÛÛÛ 10.pdf, etc etc. So if it breaks and you have to re-start it, ÛÛÛÛÛ
  184. ÛÛÛÛÛ the number you start it from will always be either 0 or a ÛÛÛÛÛ
  185. ÛÛÛÛÛ multiple of 5. ÛÛÛÛÛ
  186. ÛÛÛÛÛ ÛÛÛÛÛ
  187. ÛÛÛÛÛ 5. So now you have your pdfs, time to join them together. If ÛÛÛÛÛ
  188. ÛÛÛÛÛ you want to do this on MacOS, install the textlive-context ÛÛÛÛÛ
  189. ÛÛÛÛÛ port with: ÛÛÛÛÛ
  190. ÛÛÛÛÛ ÛÛÛÛÛ
  191. ÛÛÛÛÛ # port install texlive-context ÛÛÛÛÛ
  192. ÛÛÛÛÛ ÛÛÛÛÛ
  193. ÛÛÛÛÛ If you want to merge them on a ubuntu or debian linux box, then ÛÛÛÛÛ
  194. ÛÛÛÛÛ you want to do: ÛÛÛÛÛ
  195. ÛÛÛÛÛ ÛÛÛÛÛ
  196. ÛÛÛÛÛ # apt-get install context ÛÛÛÛÛ
  197. ÛÛÛÛÛ ÛÛÛÛÛ
  198. ÛÛÛÛÛ Make sure all the pdfs are in one directory, then cd into that ÛÛÛÛÛ
  199. ÛÛÛÛÛ directory and type: ÛÛÛÛÛ
  200. ÛÛÛÛÛ ÛÛÛÛÛ
  201. ÛÛÛÛÛ # texexec --pdfarrange --result all.pdf `ls -1 *.pdf |sort -n` ÛÛÛÛÛ
  202. ÛÛÛÛÛ ÛÛÛÛÛ
  203. ÛÛÛÛÛ You now have your fully DRM-free PDF :) ÛÛÛÛÛ
  204. ÛÛÛÛÛ ÛÛÛÛÛ
  205. ÛÛÛÛÛ -DMT 2010, be love ÛÛÛÛÛ
  206. ÛÛÛÛÛ ÛÛÛÛÛ
  207. ÛÛÛÛÛ ÛÛÛÛÛ
  208. ßßÛÛÜ ÜÛÛßß
  209. ßÜ Üß
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement