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 | |
| Version | 1.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.4 to 1.2
- core/core_pdf_embedder.php +6 -3
- css/pdfemb-embed-pdf.css +27 -15
- js/all-pdfemb-basic.min.js +7 -5
- js/pdfemb-embed-pdf.js +43 -13
- js/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/78-H.bcmap +0 -0
- js/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/78-V.bcmap +0 -0
- js/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/Add-H.bcmap +0 -0
- js/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/Add-V.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- js/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- js/pdfjs/cmaps/B5-H.bcmap +0 -0
- js/pdfjs/cmaps/B5-V.bcmap +0 -0
- js/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- js/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- js/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- js/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- js/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- js/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- js/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- js/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/Ext-H.bcmap +0 -0
- js/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/Ext-V.bcmap +0 -0
- js/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/GB-H.bcmap +4 -0
- js/pdfjs/cmaps/GB-V.bcmap +0 -0
- js/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- js/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- js/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/GBT-H.bcmap +0 -0
- js/pdfjs/cmaps/GBT-V.bcmap +0 -0
- js/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/H.bcmap +0 -0
- js/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- js/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- js/pdfjs/cmaps/Hankaku.bcmap +0 -0
- js/pdfjs/cmaps/Hiragana.bcmap +0 -0
- js/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/KSC-H.bcmap +0 -0
- js/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- js/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- js/pdfjs/cmaps/KSC-V.bcmap +0 -0
- js/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- js/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- js/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- js/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- js/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- js/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- js/pdfjs/cmaps/Katakana.bcmap +0 -0
- js/pdfjs/cmaps/LICENSE +36 -0
- js/pdfjs/cmaps/NWP-H.bcmap +0 -0
- js/pdfjs/cmaps/NWP-V.bcmap +0 -0
- js/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- js/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- js/pdfjs/cmaps/Roman.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- js/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- js/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- js/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- js/pdfjs/cmaps/V.bcmap +0 -0
- js/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- pdf_embedder.php +1 -1
- 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: "
|
| 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 |
-
|
| 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 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
background-color: grey;
|
| 23 |
-
|
| 24 |
-
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
div.pdfemb-toolbar-top {
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
div.pdfemb-toolbar-bottom {
|
| 32 |
-
position:
|
| 33 |
-
bottom:
|
| 34 |
left: 0px;
|
| 35 |
-
margin-bottom: -36px;
|
| 36 |
}
|
| 37 |
|
| 38 |
div.pdfemb-toolbar button {
|
| 39 |
-
margin: 6px 0
|
| 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
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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
|
| 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(
|
| 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!=
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
| 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 |
-
|
|
|
|
| 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 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 164 |
toolbar.append(prevbtn);
|
| 165 |
-
var nextbtn = $('<button
|
| 166 |
toolbar.append(nextbtn);
|
| 167 |
|
|
|
|
|
|
|
| 168 |
if (showIsSecure) {
|
| 169 |
-
toolbar.append($('<
|
| 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.
|
| 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.
|
| 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
|
