pdfjs_viewer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +230 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +7 -0
  7. data/CHANGELOG.md +2 -0
  8. data/Gemfile +8 -0
  9. data/Gemfile.lock +67 -0
  10. data/LICENSE +204 -0
  11. data/README.md +128 -0
  12. data/Rakefile +6 -0
  13. data/app/controllers/pdfjs_viewer/assets_controller.rb +27 -0
  14. data/app/controllers/pdfjs_viewer/viewer_controller.rb +11 -0
  15. data/app/helpers/pdfjs_viewer/application_helper.rb +20 -0
  16. data/app/views/pdfjs_viewer/viewer/show.html.erb +775 -0
  17. data/bin/build_pdfjs +24 -0
  18. data/bin/console +14 -0
  19. data/bin/setup +8 -0
  20. data/config/routes.rb +11 -0
  21. data/lib/generators/pdfjs_viewer/install_generator.rb +20 -0
  22. data/lib/generators/pdfjs_viewer/templates/README +20 -0
  23. data/lib/generators/pdfjs_viewer/templates/pdfjs_viewer.rb +30 -0
  24. data/lib/pdfjs_viewer/configuration.rb +21 -0
  25. data/lib/pdfjs_viewer/engine.rb +19 -0
  26. data/lib/pdfjs_viewer/version.rb +7 -0
  27. data/lib/pdfjs_viewer.rb +22 -0
  28. data/pdfjs_viewer.gemspec +54 -0
  29. data/public/build/pdf.mjs +23371 -0
  30. data/public/build/pdf.mjs.map +1 -0
  31. data/public/build/pdf.sandbox.mjs +218 -0
  32. data/public/build/pdf.sandbox.mjs.map +1 -0
  33. data/public/build/pdf.worker.mjs +58148 -0
  34. data/public/build/pdf.worker.mjs.map +1 -0
  35. data/public/web/cmaps/78-EUC-H.bcmap +0 -0
  36. data/public/web/cmaps/78-EUC-V.bcmap +0 -0
  37. data/public/web/cmaps/78-H.bcmap +0 -0
  38. data/public/web/cmaps/78-RKSJ-H.bcmap +0 -0
  39. data/public/web/cmaps/78-RKSJ-V.bcmap +0 -0
  40. data/public/web/cmaps/78-V.bcmap +0 -0
  41. data/public/web/cmaps/78ms-RKSJ-H.bcmap +0 -0
  42. data/public/web/cmaps/78ms-RKSJ-V.bcmap +0 -0
  43. data/public/web/cmaps/83pv-RKSJ-H.bcmap +0 -0
  44. data/public/web/cmaps/90ms-RKSJ-H.bcmap +0 -0
  45. data/public/web/cmaps/90ms-RKSJ-V.bcmap +0 -0
  46. data/public/web/cmaps/90msp-RKSJ-H.bcmap +0 -0
  47. data/public/web/cmaps/90msp-RKSJ-V.bcmap +0 -0
  48. data/public/web/cmaps/90pv-RKSJ-H.bcmap +0 -0
  49. data/public/web/cmaps/90pv-RKSJ-V.bcmap +0 -0
  50. data/public/web/cmaps/Add-H.bcmap +0 -0
  51. data/public/web/cmaps/Add-RKSJ-H.bcmap +0 -0
  52. data/public/web/cmaps/Add-RKSJ-V.bcmap +0 -0
  53. data/public/web/cmaps/Add-V.bcmap +0 -0
  54. data/public/web/cmaps/Adobe-CNS1-0.bcmap +0 -0
  55. data/public/web/cmaps/Adobe-CNS1-1.bcmap +0 -0
  56. data/public/web/cmaps/Adobe-CNS1-2.bcmap +0 -0
  57. data/public/web/cmaps/Adobe-CNS1-3.bcmap +0 -0
  58. data/public/web/cmaps/Adobe-CNS1-4.bcmap +0 -0
  59. data/public/web/cmaps/Adobe-CNS1-5.bcmap +0 -0
  60. data/public/web/cmaps/Adobe-CNS1-6.bcmap +0 -0
  61. data/public/web/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  62. data/public/web/cmaps/Adobe-GB1-0.bcmap +0 -0
  63. data/public/web/cmaps/Adobe-GB1-1.bcmap +0 -0
  64. data/public/web/cmaps/Adobe-GB1-2.bcmap +0 -0
  65. data/public/web/cmaps/Adobe-GB1-3.bcmap +0 -0
  66. data/public/web/cmaps/Adobe-GB1-4.bcmap +0 -0
  67. data/public/web/cmaps/Adobe-GB1-5.bcmap +0 -0
  68. data/public/web/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  69. data/public/web/cmaps/Adobe-Japan1-0.bcmap +0 -0
  70. data/public/web/cmaps/Adobe-Japan1-1.bcmap +0 -0
  71. data/public/web/cmaps/Adobe-Japan1-2.bcmap +0 -0
  72. data/public/web/cmaps/Adobe-Japan1-3.bcmap +0 -0
  73. data/public/web/cmaps/Adobe-Japan1-4.bcmap +0 -0
  74. data/public/web/cmaps/Adobe-Japan1-5.bcmap +0 -0
  75. data/public/web/cmaps/Adobe-Japan1-6.bcmap +0 -0
  76. data/public/web/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  77. data/public/web/cmaps/Adobe-Korea1-0.bcmap +0 -0
  78. data/public/web/cmaps/Adobe-Korea1-1.bcmap +0 -0
  79. data/public/web/cmaps/Adobe-Korea1-2.bcmap +0 -0
  80. data/public/web/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  81. data/public/web/cmaps/B5-H.bcmap +0 -0
  82. data/public/web/cmaps/B5-V.bcmap +0 -0
  83. data/public/web/cmaps/B5pc-H.bcmap +0 -0
  84. data/public/web/cmaps/B5pc-V.bcmap +0 -0
  85. data/public/web/cmaps/CNS-EUC-H.bcmap +0 -0
  86. data/public/web/cmaps/CNS-EUC-V.bcmap +0 -0
  87. data/public/web/cmaps/CNS1-H.bcmap +0 -0
  88. data/public/web/cmaps/CNS1-V.bcmap +0 -0
  89. data/public/web/cmaps/CNS2-H.bcmap +0 -0
  90. data/public/web/cmaps/CNS2-V.bcmap +3 -0
  91. data/public/web/cmaps/ETHK-B5-H.bcmap +0 -0
  92. data/public/web/cmaps/ETHK-B5-V.bcmap +0 -0
  93. data/public/web/cmaps/ETen-B5-H.bcmap +0 -0
  94. data/public/web/cmaps/ETen-B5-V.bcmap +0 -0
  95. data/public/web/cmaps/ETenms-B5-H.bcmap +3 -0
  96. data/public/web/cmaps/ETenms-B5-V.bcmap +0 -0
  97. data/public/web/cmaps/EUC-H.bcmap +0 -0
  98. data/public/web/cmaps/EUC-V.bcmap +0 -0
  99. data/public/web/cmaps/Ext-H.bcmap +0 -0
  100. data/public/web/cmaps/Ext-RKSJ-H.bcmap +0 -0
  101. data/public/web/cmaps/Ext-RKSJ-V.bcmap +0 -0
  102. data/public/web/cmaps/Ext-V.bcmap +0 -0
  103. data/public/web/cmaps/GB-EUC-H.bcmap +0 -0
  104. data/public/web/cmaps/GB-EUC-V.bcmap +0 -0
  105. data/public/web/cmaps/GB-H.bcmap +4 -0
  106. data/public/web/cmaps/GB-V.bcmap +0 -0
  107. data/public/web/cmaps/GBK-EUC-H.bcmap +0 -0
  108. data/public/web/cmaps/GBK-EUC-V.bcmap +0 -0
  109. data/public/web/cmaps/GBK2K-H.bcmap +0 -0
  110. data/public/web/cmaps/GBK2K-V.bcmap +0 -0
  111. data/public/web/cmaps/GBKp-EUC-H.bcmap +0 -0
  112. data/public/web/cmaps/GBKp-EUC-V.bcmap +0 -0
  113. data/public/web/cmaps/GBT-EUC-H.bcmap +0 -0
  114. data/public/web/cmaps/GBT-EUC-V.bcmap +0 -0
  115. data/public/web/cmaps/GBT-H.bcmap +0 -0
  116. data/public/web/cmaps/GBT-V.bcmap +0 -0
  117. data/public/web/cmaps/GBTpc-EUC-H.bcmap +0 -0
  118. data/public/web/cmaps/GBTpc-EUC-V.bcmap +0 -0
  119. data/public/web/cmaps/GBpc-EUC-H.bcmap +0 -0
  120. data/public/web/cmaps/GBpc-EUC-V.bcmap +0 -0
  121. data/public/web/cmaps/H.bcmap +0 -0
  122. data/public/web/cmaps/HKdla-B5-H.bcmap +0 -0
  123. data/public/web/cmaps/HKdla-B5-V.bcmap +0 -0
  124. data/public/web/cmaps/HKdlb-B5-H.bcmap +0 -0
  125. data/public/web/cmaps/HKdlb-B5-V.bcmap +0 -0
  126. data/public/web/cmaps/HKgccs-B5-H.bcmap +0 -0
  127. data/public/web/cmaps/HKgccs-B5-V.bcmap +0 -0
  128. data/public/web/cmaps/HKm314-B5-H.bcmap +0 -0
  129. data/public/web/cmaps/HKm314-B5-V.bcmap +0 -0
  130. data/public/web/cmaps/HKm471-B5-H.bcmap +0 -0
  131. data/public/web/cmaps/HKm471-B5-V.bcmap +0 -0
  132. data/public/web/cmaps/HKscs-B5-H.bcmap +0 -0
  133. data/public/web/cmaps/HKscs-B5-V.bcmap +0 -0
  134. data/public/web/cmaps/Hankaku.bcmap +0 -0
  135. data/public/web/cmaps/Hiragana.bcmap +0 -0
  136. data/public/web/cmaps/KSC-EUC-H.bcmap +0 -0
  137. data/public/web/cmaps/KSC-EUC-V.bcmap +0 -0
  138. data/public/web/cmaps/KSC-H.bcmap +0 -0
  139. data/public/web/cmaps/KSC-Johab-H.bcmap +0 -0
  140. data/public/web/cmaps/KSC-Johab-V.bcmap +0 -0
  141. data/public/web/cmaps/KSC-V.bcmap +0 -0
  142. data/public/web/cmaps/KSCms-UHC-H.bcmap +0 -0
  143. data/public/web/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  144. data/public/web/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  145. data/public/web/cmaps/KSCms-UHC-V.bcmap +0 -0
  146. data/public/web/cmaps/KSCpc-EUC-H.bcmap +0 -0
  147. data/public/web/cmaps/KSCpc-EUC-V.bcmap +0 -0
  148. data/public/web/cmaps/Katakana.bcmap +0 -0
  149. data/public/web/cmaps/LICENSE +36 -0
  150. data/public/web/cmaps/NWP-H.bcmap +0 -0
  151. data/public/web/cmaps/NWP-V.bcmap +0 -0
  152. data/public/web/cmaps/RKSJ-H.bcmap +0 -0
  153. data/public/web/cmaps/RKSJ-V.bcmap +0 -0
  154. data/public/web/cmaps/Roman.bcmap +0 -0
  155. data/public/web/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  156. data/public/web/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  157. data/public/web/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  158. data/public/web/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  159. data/public/web/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  160. data/public/web/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  161. data/public/web/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  162. data/public/web/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  163. data/public/web/cmaps/UniGB-UCS2-H.bcmap +0 -0
  164. data/public/web/cmaps/UniGB-UCS2-V.bcmap +0 -0
  165. data/public/web/cmaps/UniGB-UTF16-H.bcmap +0 -0
  166. data/public/web/cmaps/UniGB-UTF16-V.bcmap +0 -0
  167. data/public/web/cmaps/UniGB-UTF32-H.bcmap +0 -0
  168. data/public/web/cmaps/UniGB-UTF32-V.bcmap +0 -0
  169. data/public/web/cmaps/UniGB-UTF8-H.bcmap +0 -0
  170. data/public/web/cmaps/UniGB-UTF8-V.bcmap +0 -0
  171. data/public/web/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  172. data/public/web/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  173. data/public/web/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  174. data/public/web/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  175. data/public/web/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  176. data/public/web/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  177. data/public/web/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  178. data/public/web/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  179. data/public/web/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  180. data/public/web/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  181. data/public/web/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  182. data/public/web/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  183. data/public/web/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  184. data/public/web/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  185. data/public/web/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  186. data/public/web/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  187. data/public/web/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  188. data/public/web/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  189. data/public/web/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  190. data/public/web/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  191. data/public/web/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  192. data/public/web/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  193. data/public/web/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  194. data/public/web/cmaps/UniKS-UCS2-H.bcmap +0 -0
  195. data/public/web/cmaps/UniKS-UCS2-V.bcmap +0 -0
  196. data/public/web/cmaps/UniKS-UTF16-H.bcmap +0 -0
  197. data/public/web/cmaps/UniKS-UTF16-V.bcmap +0 -0
  198. data/public/web/cmaps/UniKS-UTF32-H.bcmap +0 -0
  199. data/public/web/cmaps/UniKS-UTF32-V.bcmap +0 -0
  200. data/public/web/cmaps/UniKS-UTF8-H.bcmap +0 -0
  201. data/public/web/cmaps/UniKS-UTF8-V.bcmap +0 -0
  202. data/public/web/cmaps/V.bcmap +0 -0
  203. data/public/web/cmaps/WP-Symbol.bcmap +0 -0
  204. data/public/web/compressed.tracemonkey-pldi-09.pdf +0 -0
  205. data/public/web/debugger.css +114 -0
  206. data/public/web/debugger.mjs +627 -0
  207. data/public/web/iccs/CGATS001Compat-v2-micro.icc +0 -0
  208. data/public/web/iccs/LICENSE +116 -0
  209. data/public/web/images/altText_add.svg +3 -0
  210. data/public/web/images/altText_disclaimer.svg +3 -0
  211. data/public/web/images/altText_done.svg +3 -0
  212. data/public/web/images/altText_spinner.svg +30 -0
  213. data/public/web/images/altText_warning.svg +3 -0
  214. data/public/web/images/annotation-check.svg +11 -0
  215. data/public/web/images/annotation-comment.svg +16 -0
  216. data/public/web/images/annotation-help.svg +26 -0
  217. data/public/web/images/annotation-insert.svg +10 -0
  218. data/public/web/images/annotation-key.svg +11 -0
  219. data/public/web/images/annotation-newparagraph.svg +11 -0
  220. data/public/web/images/annotation-noicon.svg +7 -0
  221. data/public/web/images/annotation-note.svg +42 -0
  222. data/public/web/images/annotation-paperclip.svg +6 -0
  223. data/public/web/images/annotation-paragraph.svg +16 -0
  224. data/public/web/images/annotation-pushpin.svg +7 -0
  225. data/public/web/images/comment-actionsButton.svg +3 -0
  226. data/public/web/images/comment-closeButton.svg +3 -0
  227. data/public/web/images/comment-editButton.svg +3 -0
  228. data/public/web/images/cursor-editorFreeHighlight.svg +6 -0
  229. data/public/web/images/cursor-editorFreeText.svg +3 -0
  230. data/public/web/images/cursor-editorInk.svg +4 -0
  231. data/public/web/images/cursor-editorTextHighlight.svg +8 -0
  232. data/public/web/images/editor-toolbar-delete.svg +5 -0
  233. data/public/web/images/editor-toolbar-edit.svg +3 -0
  234. data/public/web/images/findbarButton-next.svg +3 -0
  235. data/public/web/images/findbarButton-previous.svg +3 -0
  236. data/public/web/images/gv-toolbarButton-download.svg +3 -0
  237. data/public/web/images/loading-icon.gif +0 -0
  238. data/public/web/images/loading.svg +1 -0
  239. data/public/web/images/messageBar_closingButton.svg +3 -0
  240. data/public/web/images/messageBar_info.svg +3 -0
  241. data/public/web/images/messageBar_warning.svg +3 -0
  242. data/public/web/images/secondaryToolbarButton-documentProperties.svg +3 -0
  243. data/public/web/images/secondaryToolbarButton-firstPage.svg +3 -0
  244. data/public/web/images/secondaryToolbarButton-handTool.svg +3 -0
  245. data/public/web/images/secondaryToolbarButton-lastPage.svg +3 -0
  246. data/public/web/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  247. data/public/web/images/secondaryToolbarButton-rotateCw.svg +3 -0
  248. data/public/web/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  249. data/public/web/images/secondaryToolbarButton-scrollPage.svg +3 -0
  250. data/public/web/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  251. data/public/web/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  252. data/public/web/images/secondaryToolbarButton-selectTool.svg +3 -0
  253. data/public/web/images/secondaryToolbarButton-spreadEven.svg +3 -0
  254. data/public/web/images/secondaryToolbarButton-spreadNone.svg +3 -0
  255. data/public/web/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  256. data/public/web/images/toolbarButton-bookmark.svg +3 -0
  257. data/public/web/images/toolbarButton-currentOutlineItem.svg +3 -0
  258. data/public/web/images/toolbarButton-download.svg +4 -0
  259. data/public/web/images/toolbarButton-editorFreeText.svg +5 -0
  260. data/public/web/images/toolbarButton-editorHighlight.svg +6 -0
  261. data/public/web/images/toolbarButton-editorInk.svg +4 -0
  262. data/public/web/images/toolbarButton-editorSignature.svg +6 -0
  263. data/public/web/images/toolbarButton-editorStamp.svg +8 -0
  264. data/public/web/images/toolbarButton-menuArrow.svg +3 -0
  265. data/public/web/images/toolbarButton-openFile.svg +3 -0
  266. data/public/web/images/toolbarButton-pageDown.svg +3 -0
  267. data/public/web/images/toolbarButton-pageUp.svg +3 -0
  268. data/public/web/images/toolbarButton-presentationMode.svg +3 -0
  269. data/public/web/images/toolbarButton-print.svg +3 -0
  270. data/public/web/images/toolbarButton-search.svg +3 -0
  271. data/public/web/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  272. data/public/web/images/toolbarButton-sidebarToggle.svg +3 -0
  273. data/public/web/images/toolbarButton-viewAttachments.svg +3 -0
  274. data/public/web/images/toolbarButton-viewLayers.svg +3 -0
  275. data/public/web/images/toolbarButton-viewOutline.svg +3 -0
  276. data/public/web/images/toolbarButton-viewThumbnail.svg +3 -0
  277. data/public/web/images/toolbarButton-zoomIn.svg +3 -0
  278. data/public/web/images/toolbarButton-zoomOut.svg +3 -0
  279. data/public/web/images/treeitem-collapsed.svg +1 -0
  280. data/public/web/images/treeitem-expanded.svg +1 -0
  281. data/public/web/locale/ach/viewer.ftl +275 -0
  282. data/public/web/locale/af/viewer.ftl +262 -0
  283. data/public/web/locale/an/viewer.ftl +307 -0
  284. data/public/web/locale/ar/viewer.ftl +627 -0
  285. data/public/web/locale/ast/viewer.ftl +251 -0
  286. data/public/web/locale/az/viewer.ftl +307 -0
  287. data/public/web/locale/be/viewer.ftl +618 -0
  288. data/public/web/locale/bg/viewer.ftl +451 -0
  289. data/public/web/locale/bn/viewer.ftl +297 -0
  290. data/public/web/locale/bo/viewer.ftl +297 -0
  291. data/public/web/locale/br/viewer.ftl +382 -0
  292. data/public/web/locale/brx/viewer.ftl +268 -0
  293. data/public/web/locale/bs/viewer.ftl +618 -0
  294. data/public/web/locale/ca/viewer.ftl +343 -0
  295. data/public/web/locale/cak/viewer.ftl +341 -0
  296. data/public/web/locale/ckb/viewer.ftl +292 -0
  297. data/public/web/locale/cs/viewer.ftl +621 -0
  298. data/public/web/locale/cy/viewer.ftl +627 -0
  299. data/public/web/locale/da/viewer.ftl +615 -0
  300. data/public/web/locale/de/viewer.ftl +615 -0
  301. data/public/web/locale/dsb/viewer.ftl +621 -0
  302. data/public/web/locale/el/viewer.ftl +615 -0
  303. data/public/web/locale/en-CA/viewer.ftl +615 -0
  304. data/public/web/locale/en-GB/viewer.ftl +615 -0
  305. data/public/web/locale/en-US/viewer.ftl +667 -0
  306. data/public/web/locale/eo/viewer.ftl +615 -0
  307. data/public/web/locale/es-AR/viewer.ftl +615 -0
  308. data/public/web/locale/es-CL/viewer.ftl +615 -0
  309. data/public/web/locale/es-ES/viewer.ftl +615 -0
  310. data/public/web/locale/es-MX/viewer.ftl +580 -0
  311. data/public/web/locale/et/viewer.ftl +319 -0
  312. data/public/web/locale/eu/viewer.ftl +619 -0
  313. data/public/web/locale/fa/viewer.ftl +378 -0
  314. data/public/web/locale/ff/viewer.ftl +297 -0
  315. data/public/web/locale/fi/viewer.ftl +615 -0
  316. data/public/web/locale/fr/viewer.ftl +611 -0
  317. data/public/web/locale/fur/viewer.ftl +615 -0
  318. data/public/web/locale/fy-NL/viewer.ftl +615 -0
  319. data/public/web/locale/ga-IE/viewer.ftl +263 -0
  320. data/public/web/locale/gd/viewer.ftl +343 -0
  321. data/public/web/locale/gl/viewer.ftl +615 -0
  322. data/public/web/locale/gn/viewer.ftl +614 -0
  323. data/public/web/locale/gu-IN/viewer.ftl +297 -0
  324. data/public/web/locale/he/viewer.ftl +615 -0
  325. data/public/web/locale/hi-IN/viewer.ftl +297 -0
  326. data/public/web/locale/hr/viewer.ftl +618 -0
  327. data/public/web/locale/hsb/viewer.ftl +621 -0
  328. data/public/web/locale/hu/viewer.ftl +615 -0
  329. data/public/web/locale/hy-AM/viewer.ftl +314 -0
  330. data/public/web/locale/hye/viewer.ftl +318 -0
  331. data/public/web/locale/ia/viewer.ftl +615 -0
  332. data/public/web/locale/id/viewer.ftl +603 -0
  333. data/public/web/locale/is/viewer.ftl +600 -0
  334. data/public/web/locale/it/viewer.ftl +623 -0
  335. data/public/web/locale/ja/viewer.ftl +603 -0
  336. data/public/web/locale/ka/viewer.ftl +615 -0
  337. data/public/web/locale/kab/viewer.ftl +595 -0
  338. data/public/web/locale/kk/viewer.ftl +603 -0
  339. data/public/web/locale/km/viewer.ftl +273 -0
  340. data/public/web/locale/kn/viewer.ftl +263 -0
  341. data/public/web/locale/ko/viewer.ftl +603 -0
  342. data/public/web/locale/lij/viewer.ftl +297 -0
  343. data/public/web/locale/lo/viewer.ftl +343 -0
  344. data/public/web/locale/locale.json +1 -0
  345. data/public/web/locale/lt/viewer.ftl +318 -0
  346. data/public/web/locale/ltg/viewer.ftl +296 -0
  347. data/public/web/locale/lv/viewer.ftl +297 -0
  348. data/public/web/locale/meh/viewer.ftl +137 -0
  349. data/public/web/locale/mk/viewer.ftl +265 -0
  350. data/public/web/locale/ml/viewer.ftl +524 -0
  351. data/public/web/locale/mr/viewer.ftl +289 -0
  352. data/public/web/locale/ms/viewer.ftl +297 -0
  353. data/public/web/locale/my/viewer.ftl +256 -0
  354. data/public/web/locale/nb-NO/viewer.ftl +615 -0
  355. data/public/web/locale/ne-NP/viewer.ftl +284 -0
  356. data/public/web/locale/nl/viewer.ftl +615 -0
  357. data/public/web/locale/nn-NO/viewer.ftl +609 -0
  358. data/public/web/locale/oc/viewer.ftl +436 -0
  359. data/public/web/locale/pa-IN/viewer.ftl +615 -0
  360. data/public/web/locale/pl/viewer.ftl +618 -0
  361. data/public/web/locale/pt-BR/viewer.ftl +615 -0
  362. data/public/web/locale/pt-PT/viewer.ftl +615 -0
  363. data/public/web/locale/rm/viewer.ftl +615 -0
  364. data/public/web/locale/ro/viewer.ftl +302 -0
  365. data/public/web/locale/ru/viewer.ftl +618 -0
  366. data/public/web/locale/sat/viewer.ftl +355 -0
  367. data/public/web/locale/sc/viewer.ftl +394 -0
  368. data/public/web/locale/scn/viewer.ftl +124 -0
  369. data/public/web/locale/sco/viewer.ftl +314 -0
  370. data/public/web/locale/si/viewer.ftl +301 -0
  371. data/public/web/locale/sk/viewer.ftl +621 -0
  372. data/public/web/locale/skr/viewer.ftl +524 -0
  373. data/public/web/locale/sl/viewer.ftl +621 -0
  374. data/public/web/locale/son/viewer.ftl +256 -0
  375. data/public/web/locale/sq/viewer.ftl +606 -0
  376. data/public/web/locale/sr/viewer.ftl +451 -0
  377. data/public/web/locale/sv-SE/viewer.ftl +615 -0
  378. data/public/web/locale/szl/viewer.ftl +307 -0
  379. data/public/web/locale/ta/viewer.ftl +273 -0
  380. data/public/web/locale/te/viewer.ftl +289 -0
  381. data/public/web/locale/tg/viewer.ftl +615 -0
  382. data/public/web/locale/th/viewer.ftl +603 -0
  383. data/public/web/locale/tl/viewer.ftl +307 -0
  384. data/public/web/locale/tr/viewer.ftl +615 -0
  385. data/public/web/locale/trs/viewer.ftl +247 -0
  386. data/public/web/locale/uk/viewer.ftl +618 -0
  387. data/public/web/locale/ur/viewer.ftl +298 -0
  388. data/public/web/locale/uz/viewer.ftl +237 -0
  389. data/public/web/locale/vi/viewer.ftl +603 -0
  390. data/public/web/locale/wo/viewer.ftl +177 -0
  391. data/public/web/locale/xh/viewer.ftl +262 -0
  392. data/public/web/locale/zh-CN/viewer.ftl +603 -0
  393. data/public/web/locale/zh-TW/viewer.ftl +603 -0
  394. data/public/web/standard_fonts/FoxitDingbats.pfb +0 -0
  395. data/public/web/standard_fonts/FoxitFixed.pfb +0 -0
  396. data/public/web/standard_fonts/FoxitFixedBold.pfb +0 -0
  397. data/public/web/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  398. data/public/web/standard_fonts/FoxitFixedItalic.pfb +0 -0
  399. data/public/web/standard_fonts/FoxitSerif.pfb +0 -0
  400. data/public/web/standard_fonts/FoxitSerifBold.pfb +0 -0
  401. data/public/web/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  402. data/public/web/standard_fonts/FoxitSerifItalic.pfb +0 -0
  403. data/public/web/standard_fonts/FoxitSymbol.pfb +0 -0
  404. data/public/web/standard_fonts/LICENSE_FOXIT +27 -0
  405. data/public/web/standard_fonts/LICENSE_LIBERATION +102 -0
  406. data/public/web/standard_fonts/LiberationSans-Bold.ttf +0 -0
  407. data/public/web/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  408. data/public/web/standard_fonts/LiberationSans-Italic.ttf +0 -0
  409. data/public/web/standard_fonts/LiberationSans-Regular.ttf +0 -0
  410. data/public/web/viewer.css +6766 -0
  411. data/public/web/viewer.html +768 -0
  412. data/public/web/viewer.mjs +17445 -0
  413. data/public/web/viewer.mjs.map +1 -0
  414. data/public/web/wasm/LICENSE_OPENJPEG +39 -0
  415. data/public/web/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  416. data/public/web/wasm/LICENSE_PDFJS_QCMS +22 -0
  417. data/public/web/wasm/LICENSE_QCMS +21 -0
  418. data/public/web/wasm/openjpeg.wasm +0 -0
  419. data/public/web/wasm/openjpeg_nowasm_fallback.js +29 -0
  420. data/public/web/wasm/qcms_bg.wasm +0 -0
  421. metadata +526 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ab5da8dcd03e46e999a0c9d296f61a5aa87fc1dcf3bc63bb9246156c5a463a7b
4
+ data.tar.gz: 5acb8ee010ae22c20150f13db99a2f62e95027d7530b23aaf6e046484ef0fe5d
5
+ SHA512:
6
+ metadata.gz: 7a1c866de4b20ca5bdd3b2dea6e41554fd73d6ac30f79f8bc6dd0658b9f37b5abb980b6ec806960f435175dd138e84161f929047831ea0a9d5b5d9478c6cfa03
7
+ data.tar.gz: f2728c3191c41433159fe5fe27d51a99fc367281cc6799d92e8c6b8074c7275822b23f6f8edd8a93705c8661b38711f9162e798c666880c29f039348f203f593
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /node_modules/
10
+ *.gem
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,230 @@
1
+ # Copyright (c) 2014 - 2023 UNICEF. All rights reserved.
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - tmp
6
+
7
+ Layout/LineLength:
8
+ Max: 120
9
+
10
+ Metrics/BlockLength:
11
+ Exclude:
12
+ - Gemfile*
13
+ - config/routes.rb
14
+ - lib/tasks/*
15
+ - spec/**/*
16
+
17
+ Metrics/ClassLength:
18
+ Max: 125
19
+
20
+ Metrics/ModuleLength:
21
+ Exclude:
22
+ - spec/**/*
23
+
24
+ Style/ClassAndModuleChildren:
25
+ EnforcedStyle: compact
26
+
27
+ Style/Documentation:
28
+ Exclude:
29
+ - spec/**/*
30
+
31
+ Style/FrozenStringLiteralComment:
32
+ Exclude:
33
+ - bin/*
34
+
35
+ Style/OptionalBooleanParameter:
36
+ Enabled: false
37
+
38
+ # New cops
39
+ Gemspec/DeprecatedAttributeAssignment: # new in 1.30
40
+ Enabled: true
41
+ Gemspec/DevelopmentDependencies: # new in 1.44
42
+ Enabled: true
43
+ Gemspec/RequireMFA: # new in 1.23
44
+ Enabled: true
45
+ Layout/LineContinuationLeadingSpace: # new in 1.31
46
+ Enabled: true
47
+ Layout/LineContinuationSpacing: # new in 1.31
48
+ Enabled: true
49
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
50
+ Enabled: true
51
+ Layout/SpaceBeforeBrackets: # new in 1.7
52
+ Enabled: true
53
+ Lint/AmbiguousAssignment: # new in 1.7
54
+ Enabled: true
55
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
56
+ Enabled: true
57
+ Lint/AmbiguousRange: # new in 1.19
58
+ Enabled: true
59
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
60
+ Enabled: true
61
+ Lint/DeprecatedConstants: # new in 1.8
62
+ Enabled: true
63
+ Lint/DuplicateBranch: # new in 1.3
64
+ Enabled: true
65
+ Lint/DuplicateMagicComment: # new in 1.37
66
+ Enabled: true
67
+ Lint/DuplicateMatchPattern: # new in 1.50
68
+ Enabled: true
69
+ Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
70
+ Enabled: true
71
+ Lint/EmptyBlock: # new in 1.1
72
+ Enabled: true
73
+ Lint/EmptyClass: # new in 1.3
74
+ Enabled: true
75
+ Lint/EmptyInPattern: # new in 1.16
76
+ Enabled: true
77
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
78
+ Enabled: true
79
+ Lint/LambdaWithoutLiteralBlock: # new in 1.8
80
+ Enabled: true
81
+ Lint/MixedCaseRange: # new in 1.53
82
+ Enabled: true
83
+ Lint/NoReturnInBeginEndBlocks: # new in 1.2
84
+ Enabled: true
85
+ Lint/NonAtomicFileOperation: # new in 1.31
86
+ Enabled: true
87
+ Lint/NumberedParameterAssignment: # new in 1.9
88
+ Enabled: true
89
+ Lint/OrAssignmentToConstant: # new in 1.9
90
+ Enabled: true
91
+ Lint/RedundantDirGlobSort: # new in 1.8
92
+ Enabled: true
93
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
94
+ Enabled: true
95
+ Lint/RefinementImportMethods: # new in 1.27
96
+ Enabled: true
97
+ Lint/RequireRangeParentheses: # new in 1.32
98
+ Enabled: true
99
+ Lint/RequireRelativeSelfPath: # new in 1.22
100
+ Enabled: true
101
+ Lint/SymbolConversion: # new in 1.9
102
+ Enabled: true
103
+ Lint/ToEnumArguments: # new in 1.1
104
+ Enabled: true
105
+ Lint/TripleQuotes: # new in 1.9
106
+ Enabled: true
107
+ Lint/UnexpectedBlockArity: # new in 1.5
108
+ Enabled: true
109
+ Lint/UnmodifiedReduceAccumulator: # new in 1.1
110
+ Enabled: true
111
+ Lint/UselessRescue: # new in 1.43
112
+ Enabled: true
113
+ Lint/UselessRuby2Keywords: # new in 1.23
114
+ Enabled: true
115
+ Metrics/CollectionLiteralLength: # new in 1.47
116
+ Enabled: true
117
+ Naming/BlockForwarding: # new in 1.24
118
+ Enabled: true
119
+ Security/CompoundHash: # new in 1.28
120
+ Enabled: true
121
+ Security/IoMethods: # new in 1.22
122
+ Enabled: true
123
+ Style/ArgumentsForwarding: # new in 1.1
124
+ Enabled: true
125
+ Style/ArrayIntersect: # new in 1.40
126
+ Enabled: true
127
+ Style/CollectionCompact: # new in 1.2
128
+ Enabled: true
129
+ Style/ComparableClamp: # new in 1.44
130
+ Enabled: true
131
+ Style/ConcatArrayLiterals: # new in 1.41
132
+ Enabled: true
133
+ Style/DataInheritance: # new in 1.49
134
+ Enabled: true
135
+ Style/DirEmpty: # new in 1.48
136
+ Enabled: true
137
+ Style/DocumentDynamicEvalDefinition: # new in 1.1
138
+ Enabled: true
139
+ Style/EmptyHeredoc: # new in 1.32
140
+ Enabled: true
141
+ Style/EndlessMethod: # new in 1.8
142
+ Enabled: true
143
+ Style/EnvHome: # new in 1.29
144
+ Enabled: true
145
+ Style/ExactRegexpMatch: # new in 1.51
146
+ Enabled: true
147
+ Style/FetchEnvVar: # new in 1.28
148
+ Enabled: true
149
+ Style/FileEmpty: # new in 1.48
150
+ Enabled: true
151
+ Style/FileRead: # new in 1.24
152
+ Enabled: true
153
+ Style/FileWrite: # new in 1.24
154
+ Enabled: true
155
+ Style/HashConversion: # new in 1.10
156
+ Enabled: true
157
+ Style/HashExcept: # new in 1.7
158
+ Enabled: true
159
+ Style/IfWithBooleanLiteralBranches: # new in 1.9
160
+ Enabled: true
161
+ Style/InPatternThen: # new in 1.16
162
+ Enabled: true
163
+ Style/MagicCommentFormat: # new in 1.35
164
+ Enabled: true
165
+ Style/MapCompactWithConditionalBlock: # new in 1.30
166
+ Enabled: true
167
+ Style/MapToHash: # new in 1.24
168
+ Enabled: true
169
+ Style/MapToSet: # new in 1.42
170
+ Enabled: true
171
+ Style/MinMaxComparison: # new in 1.42
172
+ Enabled: true
173
+ Style/MultilineInPatternThen: # new in 1.16
174
+ Enabled: true
175
+ Style/NegatedIfElseCondition: # new in 1.2
176
+ Enabled: true
177
+ Style/NestedFileDirname: # new in 1.26
178
+ Enabled: true
179
+ Style/NilLambda: # new in 1.3
180
+ Enabled: true
181
+ Style/NumberedParameters: # new in 1.22
182
+ Enabled: true
183
+ Style/NumberedParametersLimit: # new in 1.22
184
+ Enabled: true
185
+ Style/ObjectThen: # new in 1.28
186
+ Enabled: true
187
+ Style/OpenStructUse: # new in 1.23
188
+ Enabled: true
189
+ Style/OperatorMethodCall: # new in 1.37
190
+ Enabled: true
191
+ Style/QuotedSymbols: # new in 1.16
192
+ Enabled: true
193
+ Style/RedundantArgument: # new in 1.4
194
+ Enabled: true
195
+ Style/RedundantArrayConstructor: # new in 1.52
196
+ Enabled: true
197
+ Style/RedundantConstantBase: # new in 1.40
198
+ Enabled: true
199
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
200
+ Enabled: true
201
+ Style/RedundantDoubleSplatHashBraces: # new in 1.41
202
+ Enabled: true
203
+ Style/RedundantEach: # new in 1.38
204
+ Enabled: true
205
+ Style/RedundantFilterChain: # new in 1.52
206
+ Enabled: true
207
+ Style/RedundantHeredocDelimiterQuotes: # new in 1.45
208
+ Enabled: true
209
+ Style/RedundantInitialize: # new in 1.27
210
+ Enabled: true
211
+ Style/RedundantLineContinuation: # new in 1.49
212
+ Enabled: true
213
+ Style/RedundantRegexpArgument: # new in 1.53
214
+ Enabled: true
215
+ Style/RedundantRegexpConstructor: # new in 1.52
216
+ Enabled: true
217
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
218
+ Enabled: true
219
+ Style/RedundantStringEscape: # new in 1.37
220
+ Enabled: true
221
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
222
+ Enabled: true
223
+ Style/SelectByRegexp: # new in 1.22
224
+ Enabled: true
225
+ Style/StringChars: # new in 1.12
226
+ Enabled: true
227
+ Style/SwapValues: # new in 1.1
228
+ Enabled: true
229
+ Style/YAMLFileRead: # new in 1.53
230
+ Enabled: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.3.8
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.10
7
+ before_install: gem install bundler -v 1.17.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ ## 0.1.0 - 2025-08-06
2
+ - Initial Release
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in pdfjs_viewer.gemspec
8
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pdfjs_viewer (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.3)
10
+ diff-lcs (1.6.2)
11
+ json (2.13.2)
12
+ language_server-protocol (3.17.0.5)
13
+ lint_roller (1.1.0)
14
+ parallel (1.27.0)
15
+ parser (3.3.9.0)
16
+ ast (~> 2.4.1)
17
+ racc
18
+ prism (1.4.0)
19
+ racc (1.8.1)
20
+ rainbow (3.1.1)
21
+ rake (10.5.0)
22
+ regexp_parser (2.11.0)
23
+ rspec (3.13.1)
24
+ rspec-core (~> 3.13.0)
25
+ rspec-expectations (~> 3.13.0)
26
+ rspec-mocks (~> 3.13.0)
27
+ rspec-core (3.13.5)
28
+ rspec-support (~> 3.13.0)
29
+ rspec-expectations (3.13.5)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.13.0)
32
+ rspec-mocks (3.13.5)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.13.0)
35
+ rspec-support (3.13.4)
36
+ rubocop (1.79.2)
37
+ json (~> 2.3)
38
+ language_server-protocol (~> 3.17.0.2)
39
+ lint_roller (~> 1.1.0)
40
+ parallel (~> 1.10)
41
+ parser (>= 3.3.0.2)
42
+ rainbow (>= 2.2.2, < 4.0)
43
+ regexp_parser (>= 2.9.3, < 3.0)
44
+ rubocop-ast (>= 1.46.0, < 2.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 2.4.0, < 4.0)
47
+ rubocop-ast (1.46.0)
48
+ parser (>= 3.3.7.2)
49
+ prism (~> 1.4)
50
+ ruby-progressbar (1.13.0)
51
+ unicode-display_width (3.1.4)
52
+ unicode-emoji (~> 4.0, >= 4.0.4)
53
+ unicode-emoji (4.0.4)
54
+
55
+ PLATFORMS
56
+ arm64-darwin-24
57
+ ruby
58
+
59
+ DEPENDENCIES
60
+ bundler (~> 2.0)
61
+ pdfjs_viewer!
62
+ rake (~> 10.0)
63
+ rspec (~> 3.0)
64
+ rubocop (~> 1.79)
65
+
66
+ BUNDLED WITH
67
+ 2.5.22
data/LICENSE ADDED
@@ -0,0 +1,204 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+ <<<<<<< HEAD
178
+ =======
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
204
+ >>>>>>> 4f25c1d96fd15e00a484b6745549c65cda43b757
data/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # PdfjsViewer
2
+
3
+ A Rails engine that provides PDF.js viewer functionality as a mountable engine. This gem allows you to easily integrate the PDF viewer from https://mozilla.github.io/pdf.js/ into your Rails application.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'pdfjs_viewer'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install pdfjs_viewer
20
+
21
+ ## Usage
22
+
23
+ ### 1. Generate Configuration File
24
+
25
+ Run the install generator to create a configuration file:
26
+
27
+ ```bash
28
+ rails generate pdfjs_viewer:install
29
+ ```
30
+
31
+ This will create `config/initializers/pdfjs_viewer.rb` with all available configuration options.
32
+
33
+ ### 2. Mount the Engine
34
+
35
+ Add this to your application's `config/routes.rb`:
36
+
37
+ ```ruby
38
+ mount PdfjsViewer::Engine => "/pdf"
39
+ ```
40
+
41
+ ### 3. Configure the Viewer (Optional)
42
+
43
+ Edit `config/initializers/pdfjs_viewer.rb` to customize which toolbar buttons are shown:
44
+
45
+ ```ruby
46
+ PdfjsViewer.configure do |config|
47
+ config.show_highlight_button = true # Show/hide highlight tool
48
+ config.show_text_button = true # Show/hide text annotation tool
49
+ config.show_draw_button = true # Show/hide drawing tool
50
+ config.show_add_edit_image_button = true # Show/hide image editing tool
51
+ config.show_print_button = true # Show/hide print button
52
+ config.show_save_button = true # Show/hide save/download button
53
+ config.show_open_file_button = true # Show/hide open file button
54
+ config.stylesheet_path = '/pdf.css' # Url path to override css file
55
+ end
56
+ ```
57
+
58
+ ### 4. Use the Viewer
59
+
60
+ #### Display a PDF from a URL
61
+
62
+ Navigate to the viewer with a file parameter:
63
+
64
+ ```
65
+ http://localhost:3000/pdfjs/viewer?file=https://example.com/sample.pdf
66
+ ```
67
+
68
+ #### Embed in Your Views
69
+
70
+ You can embed the viewer in your Rails views:
71
+
72
+ ```erb
73
+ <iframe
74
+ src="<%= pdfjs_viewer_path %>?file=<%= CGI.escape(@pdf_url) %>"
75
+ frameborder="0" />
76
+ ```
77
+ or you can use the object tag
78
+
79
+ ```erb
80
+ <object
81
+ src="<%= pdfjs_viewer_path %>?file=<%= CGI.escape(@pdf_url) %>"
82
+ width="100%"
83
+ height="600px" >
84
+ <div>A fallback link/message if viewer does not load</div>
85
+ </object>
86
+ ```
87
+
88
+ A helper `pdfjs_viewer_path` is defined to return the path of the viewer
89
+
90
+ ### 5. Styling and Customization
91
+
92
+ The viewer loads with default PDF.js styling. To customize the appearance, you can:
93
+
94
+ - Set `config.stylesheet_path` to a url path to a stylesheet in the initializer.
95
+ The viewer uses css variables that you can override in this css file.
96
+ - Modify the viewer template if needed
97
+ - Use the configuration options to show/hide specific toolbar elements
98
+
99
+ ## Requirements
100
+
101
+ - Rails 5.0 or higher
102
+ - Modern web browser with JavaScript enabled
103
+
104
+ ## Updating pdfjs from Mozilla
105
+
106
+ ### Requirements
107
+
108
+ - [node/npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
109
+
110
+ ### Instructions
111
+
112
+ 1. Run update script
113
+
114
+ ```
115
+ bin/build_pdfjs $PDF_JS_VERSION
116
+ ```
117
+
118
+ 2. Script will replace the files in `public/web` and `public/build`. Any updates to viewer.html will need to be made manually in `app/views/pdfjs_viewer/viewer/show.html.erb`. You can use the html file located at `public/web/viewer.html` as a reference.
119
+
120
+ 3. Afterwards commit and push changes.
121
+
122
+ ## Contributing
123
+
124
+ Bug reports and pull requests are welcome on GitHub at https://github.com/primeroIMS/pdfjs-viewer.
125
+
126
+ ## License
127
+
128
+ This gem is available as open source under the terms of the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec