PDF Embedder - Version 1.2

Version Description

Fixed 'scrollbar' issues.

Displays page number on toolbar ("Page 1/10").

Added 'Loading...' indicator.

Improved display of many PDFs (Added 'cmaps' to the distribution).

Download this release

Release Info

Developer danlester
Plugin Icon 128x128 PDF Embedder
Version 1.2
Comparing to
See all releases

Code changes from version 1.0.4 to 1.2

Files changed (175) hide show
  1. core/core_pdf_embedder.php +6 -3
  2. css/pdfemb-embed-pdf.css +27 -15
  3. js/all-pdfemb-basic.min.js +7 -5
  4. js/pdfemb-embed-pdf.js +43 -13
  5. js/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  6. js/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  7. js/pdfjs/cmaps/78-H.bcmap +0 -0
  8. js/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  9. js/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  10. js/pdfjs/cmaps/78-V.bcmap +0 -0
  11. js/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  12. js/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  13. js/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  14. js/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  15. js/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  16. js/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  17. js/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  18. js/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  19. js/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  20. js/pdfjs/cmaps/Add-H.bcmap +0 -0
  21. js/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  22. js/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  23. js/pdfjs/cmaps/Add-V.bcmap +0 -0
  24. js/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  25. js/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  26. js/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  27. js/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  28. js/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  29. js/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  30. js/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  31. js/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  32. js/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  33. js/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  34. js/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  35. js/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  36. js/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  37. js/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  38. js/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  39. js/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  40. js/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  41. js/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  42. js/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  43. js/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  44. js/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  45. js/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  46. js/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  47. js/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  48. js/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  49. js/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  50. js/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  51. js/pdfjs/cmaps/B5-H.bcmap +0 -0
  52. js/pdfjs/cmaps/B5-V.bcmap +0 -0
  53. js/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  54. js/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  55. js/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  56. js/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  57. js/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  58. js/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  59. js/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  60. js/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  61. js/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  62. js/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  63. js/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  64. js/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  65. js/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  66. js/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  67. js/pdfjs/cmaps/EUC-H.bcmap +0 -0
  68. js/pdfjs/cmaps/EUC-V.bcmap +0 -0
  69. js/pdfjs/cmaps/Ext-H.bcmap +0 -0
  70. js/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  71. js/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  72. js/pdfjs/cmaps/Ext-V.bcmap +0 -0
  73. js/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  74. js/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  75. js/pdfjs/cmaps/GB-H.bcmap +4 -0
  76. js/pdfjs/cmaps/GB-V.bcmap +0 -0
  77. js/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  78. js/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  79. js/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  80. js/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  81. js/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  82. js/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  83. js/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  84. js/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  85. js/pdfjs/cmaps/GBT-H.bcmap +0 -0
  86. js/pdfjs/cmaps/GBT-V.bcmap +0 -0
  87. js/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  88. js/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  89. js/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  90. js/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  91. js/pdfjs/cmaps/H.bcmap +0 -0
  92. js/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  93. js/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  94. js/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  95. js/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  96. js/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  97. js/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  98. js/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  99. js/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  100. js/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  101. js/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  102. js/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  103. js/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  104. js/pdfjs/cmaps/Hankaku.bcmap +0 -0
  105. js/pdfjs/cmaps/Hiragana.bcmap +0 -0
  106. js/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  107. js/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  108. js/pdfjs/cmaps/KSC-H.bcmap +0 -0
  109. js/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  110. js/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  111. js/pdfjs/cmaps/KSC-V.bcmap +0 -0
  112. js/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  113. js/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  114. js/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  115. js/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  116. js/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  117. js/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  118. js/pdfjs/cmaps/Katakana.bcmap +0 -0
  119. js/pdfjs/cmaps/LICENSE +36 -0
  120. js/pdfjs/cmaps/NWP-H.bcmap +0 -0
  121. js/pdfjs/cmaps/NWP-V.bcmap +0 -0
  122. js/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  123. js/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  124. js/pdfjs/cmaps/Roman.bcmap +0 -0
  125. js/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  126. js/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  127. js/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  128. js/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  129. js/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  130. js/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  131. js/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  132. js/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  133. js/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  134. js/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  135. js/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  136. js/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  137. js/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  138. js/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  139. js/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  140. js/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  141. js/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  142. js/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  143. js/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  144. js/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  145. js/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  146. js/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  147. js/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  148. js/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  149. js/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  150. js/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  151. js/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  152. js/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  153. js/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  154. js/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  155. js/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  156. js/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  157. js/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  158. js/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  159. js/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  160. js/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  161. js/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  162. js/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  163. js/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  164. js/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  165. js/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  166. js/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  167. js/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  168. js/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  169. js/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  170. js/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  171. js/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  172. js/pdfjs/cmaps/V.bcmap +0 -0
  173. js/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  174. pdf_embedder.php +1 -1
  175. readme.txt +19 -3
core/core_pdf_embedder.php CHANGED
@@ -31,7 +31,8 @@ class core_pdf_embedder {
31
  }
32
 
33
  protected function get_translation_array() {
34
- return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js');
 
35
  }
36
 
37
  protected function get_extra_js_name() {
@@ -80,7 +81,7 @@ class core_pdf_embedder {
80
  $width = isset($atts['width']) ? $atts['width'] : 'max';
81
  $height = isset($atts['height']) ? $atts['height'] : 'auto';
82
 
83
- $extra_style = isset($atts['border']) ? "border: ".$atts['border'].";" : "border:1px solid black; ";
84
  if (is_numeric($width)) {
85
  $extra_style .= "width: ".$width."px; ";
86
  }
@@ -88,8 +89,10 @@ class core_pdf_embedder {
88
  $extra_style .= "height: ".$height."px; ";
89
  }
90
 
 
 
91
  $returnhtml = '<div class="pdfemb-viewer" data-pdf-url="'.esc_attr($this->modify_pdfurl($url)).'" style="'.esc_attr($extra_style).'" '
92
- .'data-width="'.esc_attr($width).'" data-height="'.esc_attr($height).'"></div>';
93
 
94
  if (!is_null($content)) {
95
  $returnhtml .= do_shortcode($content);
31
  }
32
 
33
  protected function get_translation_array() {
34
+ return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js',
35
+ 'cmap_url' => $this->my_plugin_url().'js/pdfjs/cmaps/');
36
  }
37
 
38
  protected function get_extra_js_name() {
81
  $width = isset($atts['width']) ? $atts['width'] : 'max';
82
  $height = isset($atts['height']) ? $atts['height'] : 'auto';
83
 
84
+ $extra_style = isset($atts['border']) ? "border: ".esc_attr($atts['border']).";" : "border:1px solid black; ";
85
  if (is_numeric($width)) {
86
  $extra_style .= "width: ".$width."px; ";
87
  }
89
  $extra_style .= "height: ".$height."px; ";
90
  }
91
 
92
+ $toolbar = isset($atts['toolbar']) && in_array($atts['toolbar'], array('top', 'bottom', 'both')) ? $atts['toolbar'] : 'bottom';
93
+
94
  $returnhtml = '<div class="pdfemb-viewer" data-pdf-url="'.esc_attr($this->modify_pdfurl($url)).'" style="'.esc_attr($extra_style).'" '
95
+ .'data-width="'.esc_attr($width).'" data-height="'.esc_attr($height).'" data-toolbar="'.$toolbar.'"></div>';
96
 
97
  if (!is_null($content)) {
98
  $returnhtml .= do_shortcode($content);
css/pdfemb-embed-pdf.css CHANGED
@@ -4,10 +4,16 @@ div.pdfemb-viewer {
4
  line-height: 1;
5
  margin: 0px;
6
  padding: 0px;
 
 
 
 
 
 
7
  }
8
 
9
  div.pdfemb-viewer canvas {
10
- position: relative;
11
  top: 0px;
12
  bottom: 0px;
13
  margin: 0px;
@@ -16,27 +22,30 @@ div.pdfemb-viewer canvas {
16
 
17
  div.pdfemb-toolbar {
18
  padding: 0px;
19
- display: none;
20
-
21
- height: 36px;
 
22
  background-color: grey;
23
- z-index: 10;
24
- padding: 0px;
 
25
  }
26
 
27
  div.pdfemb-toolbar-top {
28
-
 
 
29
  }
30
 
31
  div.pdfemb-toolbar-bottom {
32
- position: relative;
33
- bottom: 34px;
34
  left: 0px;
35
- margin-bottom: -36px;
36
  }
37
 
38
  div.pdfemb-toolbar button {
39
- margin: 6px 0 0 10px;
40
  border: 1px solid #ccc;
41
  border-radius: 3px;
42
  height: 25px;
@@ -57,9 +66,12 @@ div.pdfemb-toolbar button {
57
  display: inline-block;
58
  }
59
 
60
- div.pdfemb-toolbar span {
61
- margin: 6px 0 0 10px;
62
- height: 25px;
 
 
 
63
  font-family: sans-serif;
64
  font-size: 10px;
65
  padding: 5px;
@@ -71,7 +83,7 @@ div.pdfemb-toolbar span {
71
  text-indent: 0px;
72
  text-shadow: none;
73
  font-weight: normal;
74
- display: inline-block;
75
  color: lightgray;
76
  }
77
 
4
  line-height: 1;
5
  margin: 0px;
6
  padding: 0px;
7
+ position: relative;
8
+ }
9
+
10
+ div.pdfemb-loadingmsg {
11
+ text-align: center;
12
+ padding: 5px;
13
  }
14
 
15
  div.pdfemb-viewer canvas {
16
+
17
  top: 0px;
18
  bottom: 0px;
19
  margin: 0px;
22
 
23
  div.pdfemb-toolbar {
24
  padding: 0px;
25
+ margin: 0px;
26
+ border: none;
27
+ z-index: 10;
28
+
29
  background-color: grey;
30
+ width: 100%;
31
+
32
+ display: none;
33
  }
34
 
35
  div.pdfemb-toolbar-top {
36
+ position: absolute;
37
+ top: 0px;
38
+ left: 0px;
39
  }
40
 
41
  div.pdfemb-toolbar-bottom {
42
+ position: absolute;
43
+ bottom: 0px;
44
  left: 0px;
 
45
  }
46
 
47
  div.pdfemb-toolbar button {
48
+ margin: 6px 0 6px 10px;
49
  border: 1px solid #ccc;
50
  border-radius: 3px;
51
  height: 25px;
66
  display: inline-block;
67
  }
68
 
69
+ div.pdfemb-toolbar button.pdfemb-btndisabled {
70
+ color: lightGray;
71
+ }
72
+
73
+ div.pdfemb-toolbar div {
74
+ margin: 6px 0 6px 10px;
75
  font-family: sans-serif;
76
  font-size: 10px;
77
  padding: 5px;
83
  text-indent: 0px;
84
  text-shadow: none;
85
  font-weight: normal;
86
+ display: inline;
87
  color: lightgray;
88
  }
89
 
js/all-pdfemb-basic.min.js CHANGED
@@ -1,5 +1,7 @@
1
- function pdfembGetPDF(b,a){a(b,!1)};jQuery(document).ready(function(b){b.fn.pdfEmbedder=function(){this.each(function(a,h){var e=b(h);e.append(b("<canvas></canvas>",{"class":"the-canvas"}));var c=e.attr("data-pdf-url");pdfembGetPDF(c,function(a,c){PDFJS.getDocument(a).then(function(a){e.data("pdfDoc",a);b.fn.pdfEmbedder.addToolbar(e,!1,c);e.data("pageNum",1);e.data("pageNumPending",null);b.fn.pdfEmbedder.renderPage(e,1);b(window).resize(function(){b.fn.pdfEmbedder.queueRenderPage(e,e.data("pageNum"))})},function(a){e.empty().append(b("<div></div>",
2
- {"class":"pdfemb-errormsg"}).append(document.createTextNode(a.message)))})})});return this};b.fn.pdfEmbedder.renderPage=function(a,h){a.data("pageRendering",!0);a.data("pdfDoc").getPage(h).then(function(e){var c=a.find(".the-canvas"),g,f=e.getViewport(1);g=f.width;f=f.height;(0>=g||0>=f)&&a.empty().append(document.createTextNode("PDF page width or height are invalid"));var k=a.parent().width(),d=g,l=f;if("max"==a.data("width"))d=k;else if("auto"==a.data("width"))d=g;else if(d=parseInt(a.data("width"),
3
- 10),isNaN(d)||0>=d)d=k;0>=d&&(d=g);d>k&&0<k&&(d=k);g=d/g;l=f*g;d!=c.width()&&c.width(d);d!=a.width()&&a.width(d);d=parseInt(a.data("height"),10);!isNaN(d)&&0<d&&d<l&&(l=d);a.height()!=l+4&&a.height(l+4);c.height()!=f*g&&c.height(f*g);f=e.getViewport(g);c[0].height=f.height;c[0].width=f.width;c={canvasContext:c[0].getContext("2d"),viewport:f};e.render(c).promise.then(function(){a.data("pageNum",h);a.data("pageRendering",!1);null!==a.data("pageNumPending")&&(b.fn.pdfEmbedder.renderPage(a,a.data("pageNumPending")),
4
- a.data("pageNumPending",null))})})};b.fn.pdfEmbedder.queueRenderPage=function(a,h){a.data("pageRendering")?a.data("pageNumPending",h):b.fn.pdfEmbedder.renderPage(a,h)};b.fn.pdfEmbedder.addToolbar=function(a,h,e){var c=b("<div></div>",{"class":"pdfemb-toolbar "+(h?" pdfemb-toolbar-top":"pdfemb-toolbar-bottom")}),g=b("<button>Prev</button>",{"class":"pdfemb-prev"});c.append(g);var f=b("<button>Next</button>",{"class":"pdfemb-next"});c.append(f);e&&c.append(b("<span>Secure</span>"));h?a.prepend(c):a.append(c);
5
- g.on("click",function(c){1>=a.data("pageNum")||(a.data("pageNum",a.data("pageNum")-1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pageNum")))});f.on("click",function(c){a.data("pageNum")>=a.data("pdfDoc").numPages||(a.data("pageNum",a.data("pageNum")+1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pageNum")))});a.on("mouseenter",function(b){a.find("div.pdfemb-toolbar").show()});a.on("mouseleave",function(b){a.find("div.pdfemb-toolbar").hide()})};PDFJS.workerSrc=pdfemb_trans.worker_src;b(".pdfemb-viewer").pdfEmbedder()});
 
 
1
+ function pdfembGetPDF(b,a){a(b,!1)};jQuery(document).ready(function(b){b.fn.pdfEmbedder=function(){this.each(function(a,h){var c=b(h);c.append(b("<div></div>",{"class":"pdfemb-loadingmsg"}).append(document.createTextNode("Loading...")));var e=c.attr("data-pdf-url");pdfembGetPDF(e,function(a,e){PDFJS.getDocument(a).then(function(a){c.empty().append(b("<canvas></canvas>",{"class":"the-canvas"}));c.data("pdfDoc",a);var d=c.data("toolbar");"bottom"!=d&&b.fn.pdfEmbedder.addToolbar(c,!0,e);"top"!=d&&b.fn.pdfEmbedder.addToolbar(c,!1,e);c.data("pageNum",
2
+ 1);c.data("pageCount",a.numPages);c.data("pageNumPending",null);b.fn.pdfEmbedder.renderPage(c,1);c.find("span.pdfemb-page-count").text(a.numPages);b(window).resize(function(){b.fn.pdfEmbedder.queueRenderPage(c,c.data("pageNum"))})},function(a){c.empty().append(b("<div></div>",{"class":"pdfemb-errormsg"}).append(document.createTextNode(a.message)))})})});return this};b.fn.pdfEmbedder.renderPage=function(a,h){a.data("pageRendering",!0);a.data("pdfDoc").getPage(h).then(function(c){var e=a.find(".the-canvas"),
3
+ g,f=c.getViewport(1);g=f.width;f=f.height;(0>=g||0>=f)&&a.empty().append(document.createTextNode("PDF page width or height are invalid"));var k=a.parent().width(),d=g,l=f;if("max"==a.data("width"))d=k;else if("auto"==a.data("width"))d=g;else if(d=parseInt(a.data("width"),10),isNaN(d)||0>=d)d=k;0>=d&&(d=g);d>k&&0<k&&(d=k);g=d/g;l=f*g;d!=e.width()&&e.width(d);d!=a.width()&&a.width(d);d=parseInt(a.data("height"),10);!isNaN(d)&&0<d&&d<l&&(l=d);a.height()!=l+4&&a.height(l+4);e.height()!=f*g&&e.height(f*
4
+ g);f=c.getViewport(g);e[0].height=f.height;e[0].width=f.width;e={canvasContext:e[0].getContext("2d"),viewport:f};c.render(e).promise.then(function(){a.data("pageNum",h);a.data("pageRendering",!1);a.find("span.pdfemb-page-num").text(h);h<a.data("pageCount")?a.find(".pdfemb-next").removeAttr("disabled").removeClass("pdfemb-btndisabled"):a.find(".pdfemb-next").attr("disabled","disabled").addClass("pdfemb-btndisabled");1<h?a.find(".pdfemb-prev").removeAttr("disabled").removeClass("pdfemb-btndisabled"):
5
+ a.find(".pdfemb-prev").attr("disabled","disabled").addClass("pdfemb-btndisabled");null!==a.data("pageNumPending")&&(b.fn.pdfEmbedder.renderPage(a,a.data("pageNumPending")),a.data("pageNumPending",null))})})};b.fn.pdfEmbedder.queueRenderPage=function(a,h){a.data("pageRendering")?a.data("pageNumPending",h):b.fn.pdfEmbedder.renderPage(a,h)};b.fn.pdfEmbedder.addToolbar=function(a,h,c){var e=b("<div></div>",{"class":"pdfemb-toolbar "+(h?" pdfemb-toolbar-top":"pdfemb-toolbar-bottom")}),g=b('<button class="pdfemb-prev">Prev</button>');
6
+ e.append(g);var f=b('<button class="pdfemb-next">Next</button>');e.append(f);e.append(b('<div>Page <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));c&&e.append(b("<div>Secure</div>"));h?a.prepend(e):a.append(e);g.on("click",function(c){1>=a.data("pageNum")||(a.data("pageNum",a.data("pageNum")-1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pageNum")))});f.on("click",function(c){a.data("pageNum")>=a.data("pdfDoc").numPages||(a.data("pageNum",a.data("pageNum")+
7
+ 1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pageNum")))});a.on("mouseenter",function(b){a.find("div.pdfemb-toolbar").show()});a.on("mouseleave",function(b){a.find("div.pdfemb-toolbar").hide()})};PDFJS.workerSrc=pdfemb_trans.worker_src;PDFJS.cMapUrl=pdfemb_trans.cmap_url;PDFJS.cMapPacked=!0;b(".pdfemb-viewer").pdfEmbedder()});
js/pdfemb-embed-pdf.js CHANGED
@@ -7,7 +7,8 @@ jQuery(document).ready(function ($) {
7
  this.each(function(index, rawDivContainer) {
8
 
9
  var divContainer = $(rawDivContainer);
10
- divContainer.append($('<canvas></canvas>', {'class': 'the-canvas'})); //style: 'border:1px solid black',
 
11
 
12
  var url = divContainer.attr('data-pdf-url');
13
 
@@ -16,18 +17,30 @@ jQuery(document).ready(function ($) {
16
  /**
17
  * Asynchronously downloads PDF.
18
  */
19
-
20
  PDFJS.getDocument(pdf).then(function (pdfDoc_) {
 
 
21
  divContainer.data('pdfDoc', pdfDoc_);
22
- //document.getElementById('page_count').textContent = this.pdfDoc.numPages;
23
-
24
- $.fn.pdfEmbedder.addToolbar(divContainer, false, showIsSecure);
 
 
 
 
 
 
 
25
 
26
  // Initial/first page rendering
27
  divContainer.data('pageNum', 1);
 
28
  divContainer.data('pageNumPending', null);
29
  $.fn.pdfEmbedder.renderPage(divContainer, 1);
30
 
 
 
31
  $(window).resize(function() {
32
  $.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pageNum'));
33
  });
@@ -136,6 +149,24 @@ jQuery(document).ready(function ($) {
136
  renderTask.promise.then(function () {
137
  divContainer.data('pageNum', pageNum);
138
  divContainer.data('pageRendering', false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  if (divContainer.data('pageNumPending') !== null) {
140
  // New page rendering is pending
141
  $.fn.pdfEmbedder.renderPage(divContainer, divContainer.data('pageNumPending'));
@@ -144,9 +175,6 @@ jQuery(document).ready(function ($) {
144
  });
145
  });
146
 
147
- // Update page counters
148
- // document.getElementById('page_num').textContent = pageNum;
149
-
150
  };
151
 
152
  $.fn.pdfEmbedder.queueRenderPage = function(divContainer, num) {
@@ -160,17 +188,17 @@ jQuery(document).ready(function ($) {
160
  $.fn.pdfEmbedder.addToolbar = function(divContainer, atTop, showIsSecure){
161
 
162
  var toolbar = $('<div></div>', {'class': 'pdfemb-toolbar '+(atTop ? ' pdfemb-toolbar-top' : 'pdfemb-toolbar-bottom')});
163
- var prevbtn = $('<button>Prev</button>', {'class': "pdfemb-prev"});
164
  toolbar.append(prevbtn);
165
- var nextbtn = $('<button>Next</button>', {'class': "pdfemb-next"});
166
  toolbar.append(nextbtn);
167
 
 
 
168
  if (showIsSecure) {
169
- toolbar.append($('<span>Secure</span>'));
170
  }
171
 
172
- //<span>Page: <span id="page_num"></span> / <span id="page_count"></span></span></div>
173
-
174
  if (atTop) {
175
  divContainer.prepend(toolbar);
176
  }
@@ -212,6 +240,8 @@ jQuery(document).ready(function ($) {
212
  // Apply plugin to relevant divs/};
213
 
214
  PDFJS.workerSrc = pdfemb_trans.worker_src;
 
 
215
  $('.pdfemb-viewer').pdfEmbedder();
216
 
217
  });
7
  this.each(function(index, rawDivContainer) {
8
 
9
  var divContainer = $(rawDivContainer);
10
+
11
+ divContainer.append($('<div></div>', {'class': 'pdfemb-loadingmsg'}).append(document.createTextNode('Loading...')));
12
 
13
  var url = divContainer.attr('data-pdf-url');
14
 
17
  /**
18
  * Asynchronously downloads PDF.
19
  */
20
+
21
  PDFJS.getDocument(pdf).then(function (pdfDoc_) {
22
+ divContainer.empty().append($('<canvas></canvas>', {'class': 'the-canvas'})); //style: 'border:1px solid black',
23
+
24
  divContainer.data('pdfDoc', pdfDoc_);
25
+
26
+ var toolbar_location = divContainer.data('toolbar');
27
+
28
+ if (toolbar_location != 'bottom') {
29
+ $.fn.pdfEmbedder.addToolbar(divContainer, true, showIsSecure);
30
+ }
31
+
32
+ if (toolbar_location != 'top') {
33
+ $.fn.pdfEmbedder.addToolbar(divContainer, false, showIsSecure);
34
+ }
35
 
36
  // Initial/first page rendering
37
  divContainer.data('pageNum', 1);
38
+ divContainer.data('pageCount', pdfDoc_.numPages);
39
  divContainer.data('pageNumPending', null);
40
  $.fn.pdfEmbedder.renderPage(divContainer, 1);
41
 
42
+ divContainer.find('span.pdfemb-page-count').text( pdfDoc_.numPages );
43
+
44
  $(window).resize(function() {
45
  $.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pageNum'));
46
  });
149
  renderTask.promise.then(function () {
150
  divContainer.data('pageNum', pageNum);
151
  divContainer.data('pageRendering', false);
152
+
153
+ // Update page counters
154
+ divContainer.find('span.pdfemb-page-num').text( pageNum );
155
+
156
+ if (pageNum < divContainer.data("pageCount")) {
157
+ divContainer.find('.pdfemb-next').removeAttr('disabled').removeClass('pdfemb-btndisabled');
158
+ }
159
+ else {
160
+ divContainer.find('.pdfemb-next').attr('disabled','disabled').addClass('pdfemb-btndisabled');
161
+ }
162
+
163
+ if (pageNum > 1) {
164
+ divContainer.find('.pdfemb-prev').removeAttr('disabled').removeClass('pdfemb-btndisabled');
165
+ }
166
+ else {
167
+ divContainer.find('.pdfemb-prev').attr('disabled','disabled').addClass('pdfemb-btndisabled');
168
+ }
169
+
170
  if (divContainer.data('pageNumPending') !== null) {
171
  // New page rendering is pending
172
  $.fn.pdfEmbedder.renderPage(divContainer, divContainer.data('pageNumPending'));
175
  });
176
  });
177
 
 
 
 
178
  };
179
 
180
  $.fn.pdfEmbedder.queueRenderPage = function(divContainer, num) {
188
  $.fn.pdfEmbedder.addToolbar = function(divContainer, atTop, showIsSecure){
189
 
190
  var toolbar = $('<div></div>', {'class': 'pdfemb-toolbar '+(atTop ? ' pdfemb-toolbar-top' : 'pdfemb-toolbar-bottom')});
191
+ var prevbtn = $('<button class="pdfemb-prev">Prev</button>');
192
  toolbar.append(prevbtn);
193
+ var nextbtn = $('<button class="pdfemb-next">Next</button>');
194
  toolbar.append(nextbtn);
195
 
196
+ toolbar.append($('<div>Page <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));
197
+
198
  if (showIsSecure) {
199
+ toolbar.append($('<div>Secure</div>'));
200
  }
201
 
 
 
202
  if (atTop) {
203
  divContainer.prepend(toolbar);
204
  }
240
  // Apply plugin to relevant divs/};
241
 
242
  PDFJS.workerSrc = pdfemb_trans.worker_src;
243
+ PDFJS.cMapUrl = pdfemb_trans.cmap_url;
244
+ PDFJS.cMapPacked = true;
245
  $('.pdfemb-viewer').pdfEmbedder();
246
 
247
  });
js/pdfjs/cmaps/78-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/78-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/78-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/78-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/78-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/78-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/78ms-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/78ms-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/83pv-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/90ms-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/90ms-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/90msp-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/90msp-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/90pv-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/90pv-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Add-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/Add-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/Add-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Add-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-0.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-1.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-3.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-4.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-5.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-6.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-0.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-1.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-3.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-4.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-5.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-0.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-1.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-3.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-4.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-5.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-6.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Korea1-0.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Korea1-1.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Korea1-2.bcmap ADDED
Binary file
js/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap ADDED
Binary file
js/pdfjs/cmaps/B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/B5pc-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/B5pc-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS1-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS1-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS2-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/CNS2-V.bcmap ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ �RCopyright 1990-2009 Adobe Systems Incorporated.
2
+ All rights reserved.
3
+ See ./LICENSE�CNS2-H
js/pdfjs/cmaps/ETHK-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/ETHK-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/ETen-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/ETen-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/ETenms-B5-H.bcmap ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ �RCopyright 1990-2009 Adobe Systems Incorporated.
2
+ All rights reserved.
3
+ See ./LICENSE� ETen-B5-H` ^
js/pdfjs/cmaps/ETenms-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Ext-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/Ext-RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/Ext-RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Ext-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GB-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GB-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GB-H.bcmap ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ �RCopyright 1990-2009 Adobe Systems Incorporated.
2
+ All rights reserved.
3
+ See ./LICENSE!!��]aX!!]`�21�> �p�z�$]��"R�d�-U�7�*�
4
+ �"]�h�"]�F�"]�$�"]��"]�`�"]�>�"]��"]�z�"]�X�"]�6�"]��"]�r�"]�P�"]�.�"]��"]�j�"]�H�"]�&�"]��"]�b�"]�@�"]��"]�|�"]�Z�"]�8�"]��"]�t�"]�R�"]�0�"]��"]�l�"]�J�"]�(�"]��"]�d�"]�B�"]� �"X�~�']�W�"]�5�"]��"]�q�"]�O�"]�-�"]��"]�i�"]�G�"]�%�"]��"]�a�"]�?�"]��"]�{�"]�Y�"]�7�"]��"]�s�"]�Q�"]�/�"]�
js/pdfjs/cmaps/GB-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBK-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBK-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBK2K-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBK2K-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBKp-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBKp-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBT-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBT-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBT-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBT-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBTpc-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBTpc-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBpc-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/GBpc-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKdla-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKdla-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKdlb-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKdlb-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKgccs-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKgccs-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKm314-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKm314-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKm471-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKm471-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKscs-B5-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/HKscs-B5-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Hankaku.bcmap ADDED
Binary file
js/pdfjs/cmaps/Hiragana.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-Johab-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-Johab-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCms-UHC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCms-UHC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCpc-EUC-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/KSCpc-EUC-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Katakana.bcmap ADDED
Binary file
js/pdfjs/cmaps/LICENSE ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ %%Copyright: -----------------------------------------------------------
2
+ %%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.
3
+ %%Copyright: All rights reserved.
4
+ %%Copyright:
5
+ %%Copyright: Redistribution and use in source and binary forms, with or
6
+ %%Copyright: without modification, are permitted provided that the
7
+ %%Copyright: following conditions are met:
8
+ %%Copyright:
9
+ %%Copyright: Redistributions of source code must retain the above
10
+ %%Copyright: copyright notice, this list of conditions and the following
11
+ %%Copyright: disclaimer.
12
+ %%Copyright:
13
+ %%Copyright: Redistributions in binary form must reproduce the above
14
+ %%Copyright: copyright notice, this list of conditions and the following
15
+ %%Copyright: disclaimer in the documentation and/or other materials
16
+ %%Copyright: provided with the distribution.
17
+ %%Copyright:
18
+ %%Copyright: Neither the name of Adobe Systems Incorporated nor the names
19
+ %%Copyright: of its contributors may be used to endorse or promote
20
+ %%Copyright: products derived from this software without specific prior
21
+ %%Copyright: written permission.
22
+ %%Copyright:
23
+ %%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24
+ %%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
+ %%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26
+ %%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ %%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
28
+ %%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29
+ %%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30
+ %%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31
+ %%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32
+ %%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33
+ %%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34
+ %%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
+ %%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ %%Copyright: -----------------------------------------------------------
js/pdfjs/cmaps/NWP-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/NWP-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/RKSJ-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/RKSJ-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/Roman.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UCS2-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UCS2-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF16-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF16-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF8-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniCNS-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UCS2-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UCS2-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF16-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF16-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF8-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniGB-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UCS2-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UCS2-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF16-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF16-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF8-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UCS2-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UCS2-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF16-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF16-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF32-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF32-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF8-H.bcmap ADDED
Binary file
js/pdfjs/cmaps/UniKS-UTF8-V.bcmap ADDED
Binary file
js/pdfjs/cmaps/V.bcmap ADDED
Binary file
js/pdfjs/cmaps/WP-Symbol.bcmap ADDED
Binary file
pdf_embedder.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required.
7
- * Version: 1.0.4
8
  * Author: Dan Lester
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required.
7
+ * Version: 1.2
8
  * Author: Dan Lester
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: danlester
3
  Tags: doc, docx, pdf, office, powerpoint, google, document, embed, intranet
4
  Requires at least: 3.3
5
  Tested up to: 4.1
6
- Stable tag: 1.0.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -40,7 +40,7 @@ When you insert into your post, it will appear in the editor as a 'shortcode' as
40
 
41
  You can optionally override width and height as follows:
42
 
43
- [pdf-embedder url="https://mysite.com/wp-content/uploads/2015/01/Plan-Summary.pdf" width="auto"]
44
 
45
  Note the default value for width is 'max'.
46
 
@@ -55,7 +55,13 @@ Resizing works as follows:
55
  The height will be calculated so that the document fits naturally, given the width already calculated.
56
 
57
  It is possible to specify a fixed height (e.g. height="200"), in which case the document may be cut off vertically and will need to be scrolled to see the whole page.
58
- The height will be reduced to fit if it is larger than needed to display the document correctly.
 
 
 
 
 
 
59
 
60
  == Screenshots ==
61
 
@@ -98,6 +104,16 @@ the Plugins section of your Wordpress admin
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
 
 
 
101
  = 1.0.4 =
102
 
103
  Added compatibility.js to support some minor browsers, e.g. Safari which did not allow ranged downloads
3
  Tags: doc, docx, pdf, office, powerpoint, google, document, embed, intranet
4
  Requires at least: 3.3
5
  Tested up to: 4.1
6
+ Stable tag: 1.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
40
 
41
  You can optionally override width and height as follows:
42
 
43
+ [pdf-embedder url="https://mysite.com/wp-content/uploads/2015/01/Plan-Summary.pdf" **width="auto"**]
44
 
45
  Note the default value for width is 'max'.
46
 
55
  The height will be calculated so that the document fits naturally, given the width already calculated.
56
 
57
  It is possible to specify a fixed height (e.g. height="200"), in which case the document may be cut off vertically and will need to be scrolled to see the whole page.
58
+ The height will be reduced to fit if it is larger than needed to display the document correctly.
59
+
60
+ Toolbar Location
61
+
62
+ Add toolbar="[top|bottom|both]" to the shortcode to change the location of the Next/Prev toolbar (default is 'bottom').
63
+
64
+ E.g. [pdf-embedder url="https://mysite.com/wp-content/uploads/2015/01/Plan-Summary.pdf" **toolbar="top"**]
65
 
66
  == Screenshots ==
67
 
104
 
105
  == Changelog ==
106
 
107
+ = 1.2 =
108
+
109
+ Fixed 'scrollbar' issues.
110
+
111
+ Displays page number on toolbar ("Page 1/10").
112
+
113
+ Added 'Loading...' indicator.
114
+
115
+ Improved display of many PDFs (Added 'cmaps' to the distribution).
116
+
117
  = 1.0.4 =
118
 
119
  Added compatibility.js to support some minor browsers, e.g. Safari which did not allow ranged downloads