added pdf
Showing
28 changed files
with
21 additions
and
8 deletions
No preview for this file type
443 KB
559 KB
No preview for this file type
public/files/SME14pgNwsprAdbw/page.jpg
0 → 100644
77.8 KB
No preview for this file type
public/files/SME34NwsprT2Adcol/page.jpg
0 → 100644
126 KB
No preview for this file type
public/files/SMENwsprBannerAdcol/page.jpg
0 → 100644
57.7 KB
This file is too large to display.
public/files/SMET1FulPgMagAdcol/page.jpg
0 → 100644
116 KB
No preview for this file type
public/files/SMET1Postersmall/page.jpg
0 → 100644
88.6 KB
This file is too large to display.
public/files/SMET2Poster18x24/page.jpg
0 → 100644
223 KB
No preview for this file type
124 KB
public/files/SMET2TentCard/SMET2TentCard.pdf
0 → 100644
No preview for this file type
260 KB
No preview for this file type
public/files/SMET2TentCard/page.jpg
0 → 100644
77.2 KB
121 KB
124 KB
260 KB
This diff could not be displayed because it is too large.
No preview for this file type
279 KB
| 1 | // var pluginUrl = "http://localhost:8888/Forms"; | 1 | // var pluginUrl = "http://localhost:8888/Forms"; |
| 2 | // var pdf_customizer = "http://localhost:8888/pdf-customizer/public"; | 2 | // var pdf_customizer = "http://localhost:8888/pdf-customizer/public"; |
| 3 | 3 | ||
| 4 | var pluginUrl = "http://contact.gotenzing.com"; | 4 | var pluginUrl = "http://contact.gotenzing.com"; |
| 5 | var pdf_customizer = "http://pdf-customizer.synapsus.co"; | 5 | var pdf_customizer = "http://pdf-customizer.synapsus.co"; |
| 6 | 6 | ||
| 7 | function getAuth() { | 7 | function getAuth() { |
| 8 | 8 | ||
| ... | @@ -82,15 +82,17 @@ | ... | @@ -82,15 +82,17 @@ |
| 82 | var down = pheight - (up + height); | 82 | var down = pheight - (up + height); |
| 83 | var scaleH = $("Canvas").height() / pheight ; | 83 | var scaleH = $("Canvas").height() / pheight ; |
| 84 | var scaleW = $("Canvas").width() / pwidth ; | 84 | var scaleW = $("Canvas").width() / pwidth ; |
| 85 | var scaleDown = down / scaleH; | 85 | var scaleDown = down * scaleH; |
| 86 | var scaleRight = right/ scaleW; | 86 | var scaleRight = right* scaleW; |
| 87 | var scalewidth = width / scaleW; | 87 | var scalewidth = width * scaleW; |
| 88 | var scaleheight = height / scaleH; | 88 | var scaleheight = height * scaleH; |
| 89 | 89 | ||
| 90 | var c = document.getElementById("Canvas"); | 90 | var c = document.getElementById("Canvas"); |
| 91 | var ctx = c.getContext("2d"); | 91 | var ctx = c.getContext("2d"); |
| 92 | ctx.save(); | 92 | ctx.save(); |
| 93 | ctx.rect(scaleRight, scaleDown , scalewidth, scaleheight); | 93 | ctx.rect(scaleRight, scaleDown , scalewidth, scaleheight); |
| 94 | console.log(scaleRight, scaleDown , scalewidth, scaleheight); | ||
| 95 | console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH); | ||
| 94 | ctx.stroke(); | 96 | ctx.stroke(); |
| 95 | //console.log(pheight, pwidth,up, right, height, width); | 97 | //console.log(pheight, pwidth,up, right, height, width); |
| 96 | // console.log(myrect ) | 98 | // console.log(myrect ) |
| ... | @@ -202,9 +204,20 @@ | ... | @@ -202,9 +204,20 @@ |
| 202 | var pdflist = ""; | 204 | var pdflist = ""; |
| 203 | var pdfChange = ""; | 205 | var pdfChange = ""; |
| 204 | var f = 0; | 206 | var f = 0; |
| 207 | if(json[0].pwidth > '300'){ | ||
| 208 | var scaleImage = 300 / json[0].pwidth; | ||
| 209 | var imageHeight = json[0].pheight * scaleImage; | ||
| 210 | var imageWidth = '300'; | ||
| 211 | console.log(json[0].pheight , scaleImage, imageHeight); | ||
| 212 | }else{ | ||
| 213 | var imageWidth = json[0].pwidth; | ||
| 214 | var imageHeight = json[0].pheight; | ||
| 215 | console.log(json[0].pheight , scaleImage); | ||
| 216 | |||
| 217 | } | ||
| 205 | pdflist += '<div id="pdfPreview" class="column">'; | 218 | pdflist += '<div id="pdfPreview" class="column">'; |
| 206 | // pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">'; | 219 | // pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">'; |
| 207 | pdflist += '<canvas id="Canvas" width="252px" height="504px" style=" margin-top:60px; border-style: solid; border-width:1px; background-image: url(' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '); background-size:252px 504px;"></div>'; | 220 | pdflist += '<canvas id="Canvas" width="'+imageWidth+'" height="'+imageHeight+'" style=" margin-top:60px; border-style: solid; border-width:1px; background-image: url(' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '); background-size:'+imageWidth+'px '+imageHeight+'px"></div>'; |
| 208 | pdfChange += '<form id="changes" name="changes" enctype="multipart/form-data" action="" METHOD="POST"><h4>' + json[0].name + '</h4>'; | 221 | pdfChange += '<form id="changes" name="changes" enctype="multipart/form-data" action="" METHOD="POST"><h4>' + json[0].name + '</h4>'; |
| 209 | pdfChange += '<input type="hidden" id="id" name="id" value="' + json[0].idPDF + '">'; | 222 | pdfChange += '<input type="hidden" id="id" name="id" value="' + json[0].idPDF + '">'; |
| 210 | for (i = 0; i < json.length; ++i) { | 223 | for (i = 0; i < json.length; ++i) { | ... | ... |
-
Please register or sign in to post a comment