Skip to content

v3.0.3 20240227 [Hotfix issue] #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/Http/Controllers/proc/watermarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ public function watermark(Request $request) {
try {
$ilovepdf = new Ilovepdf(env('ILOVEPDF_PUBLIC_KEY'),env('ILOVEPDF_SECRET_KEY'));
$ilovepdfTask = $ilovepdf->newTask('watermark');
$pdfFile = $ilovepdfTask->addFile($newFilePath);
if ($watermarkAction == 'img') {
$ilovepdfTask->setEncryption(true);
$wmImage = $ilovepdfTask->addElementFile(Storage::disk('local')->path('public/'.$pdfUpload_Location.'/'.$wmImageName));
$pdfFile = $ilovepdfTask->addFile($newFilePath);
$ilovepdfTask->setMode("image");
$ilovepdfTask->setImageFile($wmImage);
$ilovepdfTask->setTransparency($watermarkTransparency);
Expand All @@ -186,8 +186,10 @@ public function watermark(Request $request) {
$ilovepdfTask->setMosaic($isMosaic);
$ilovepdfTask->setVerticalPosition("middle");
} else if ($watermarkAction == 'txt') {
$ilovepdfTask->setFileEncryption($pdfEncKey);
$ilovepdfTask->setEncryptKey($pdfEncKey);
$ilovepdfTask->setEncryption(true);
$pdfFile = $ilovepdfTask->addFile($newFilePath);
$ilovepdfTask->setMode("text");
$ilovepdfTask->setText($watermarkText);
$ilovepdfTask->setPages($watermarkPage);
Expand Down
1 change: 1 addition & 0 deletions public/build/assets/app-BOaETB2h.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/assets/app-Q8IUc3hd.css

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/app-lite-Bcv6T1H2.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/assets/app-lite-DGYbdi6z.css

This file was deleted.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"file": "assets/index-D1AB55dp.js"
},
"resources/css/app-lite.css": {
"file": "assets/app-lite-DGYbdi6z.css",
"file": "assets/app-lite-Bcv6T1H2.css",
"src": "resources/css/app-lite.css",
"isEntry": true
},
"resources/css/app.css": {
"file": "assets/app-Q8IUc3hd.css",
"file": "assets/app-BOaETB2h.css",
"src": "resources/css/app.css",
"isEntry": true
},
Expand All @@ -26,7 +26,7 @@
]
},
"resources/js/kao-logic.js": {
"file": "assets/kao-logic-B_ZIctFK.js",
"file": "assets/kao-logic-CxNmQEhC.js",
"src": "resources/js/kao-logic.js",
"isEntry": true,
"imports": [
Expand Down
8 changes: 4 additions & 4 deletions public/ext-js/kao-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (firstArea) {
} else if (firstAreaAltInput.value == "watermark") {
wmLayout_ImageInputRestore()
wmLayout_image()
showVal(document.getElementById('watermarkFontTransparency').value,'image')
showVal(document.getElementById('watermarkImageTransparency').value,'image')
document.getElementById("submitBtn").style = null;
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ if (secondArea) {
} else if (firstAreaAltInput.value == "watermark") {
wmLayout_TextInputRestore()
wmLayout_text()
showVal(document.getElementById('watermarkFontTransparency').value,'text')
showVal(document.getElementById('watermarkTextTransparency').value,'text')
document.getElementById("submitBtn").style = null;
}
}
Expand Down Expand Up @@ -648,7 +648,7 @@ function reuseOnClickWmLayoutImageStyleAreaA() {
wmLayoutImageStyleAreaTextB.style.color = '#E0E4E5'
if (firstAreaInput.checked == true) {
firstColumnArea.style.borderColor = '#4DAAAA'
firstareatext.style.color = '#E0E4E5'
firstAreaText.style.color = '#E0E4E5'
firstAreaInput.checked = true
} else if (secondAreaInput.checked == true) {
secondColumnArea.style.borderColor = '#4DAAAA'
Expand All @@ -669,7 +669,7 @@ function reuseOnClickWmLayoutImageStyleAreaB() {
wmLayoutImageStyleAreaTextA.style.color = '#E0E4E5'
if (firstAreaInput.checked == true) {
firstColumnArea.style.borderColor = '#4DAAAA'
firstareatext.style.color = '#E0E4E5'
firstAreaText.style.color = '#E0E4E5'
firstAreaInput.checked = true
} else if (secondAreaInput.checked == true) {
secondColumnArea.style.borderColor = '#4DAAAA'
Expand Down
28 changes: 20 additions & 8 deletions resources/js/kao-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ if (uploadDropzone) {

if (!uploadDropzone) {
if (procBtn) {
if (document.getElementById('compress') !== null || document.getElementById('cnvFrPDF') !== null) {
if (document.getElementById('compress') !== null || document.getElementById('cnvFrPDF') !== null
|| document.getElementById('merge') !== null) {
console.log("Dropzone instance are not ready")
errMessage.innerText = "There was unexpected error !"
errSubMessage.innerText = ""
Expand Down Expand Up @@ -643,8 +644,7 @@ if (uploadDropzoneSingle) {

if (!uploadDropzoneSingle) {
if (procBtn) {
if (document.getElementById('merge') !== null || document.getElementById('split') !== null ||
document.getElementById('watermark') !== null) {
if (document.getElementById('split') !== null || document.getElementById('watermark') !== null) {
console.log("Dropzone instance are not ready")
errMessage.innerText = "There was unexpected error !"
errSubMessage.innerText = ""
Expand Down Expand Up @@ -770,7 +770,7 @@ function sendToAPI(files, proc, action) {
let wmRotation
var imgFile = document.getElementById('wm_file_input').files[0]
var wmPage = document.getElementById('watermarkPageImage').value
var wmTransparency = document.getElementById('watermarkFontTransparency').value
var wmTransparency = document.getElementById('watermarkImageTransparency').value
var wmMosaic = document.getElementById('isMosaicImage').checked
if (document.getElementById('wmRadioImageLayoutStyleA').checked == true) {
wmLayoutStyle = document.getElementById('wmRadioImageLayoutStyleA').value
Expand Down Expand Up @@ -811,7 +811,7 @@ function sendToAPI(files, proc, action) {
var wmFontColor = document.getElementById('watermarkFontColor').value
var wmPage = document.getElementById('watermarkPageText').value
var wmText = document.getElementById('watermarkText').value
var wmTransparency = document.getElementById('watermarkFontTransparency').value
var wmTransparency = document.getElementById('watermarkTextTransparency').value
var wmMosaic = document.getElementById('isMosaicText').checked
if (document.getElementById('wmRadioFontFamilyA').checked == true) {
wmFontFamily = document.getElementById('wmRadioFontFamilyA').value
Expand Down Expand Up @@ -1076,7 +1076,19 @@ function submit(event) {
if (document.getElementById('cnvToPDF') !== null) {
apiGateway("convert","")
} else {
apiGateway("merge","")
if (getUploadedFileName().length < 2) {
event.preventDefault()
errMessage.innerText = "PDF file can not be processed !"
errSubMessage.innerText = ""
errListTitleMessage.innerText = "Required fields:"
errAltSubMessageModal.style = null
resetErrListMessage()
generateMesssage("Minimum PDF to merge is 2 (Total files: "+getUploadedFileName().length+")")
loadingModal.hide()
errModal.show()
} else {
apiGateway("merge","")
}
}
} else {
event.preventDefault()
Expand Down Expand Up @@ -1487,8 +1499,8 @@ function submit(event) {
if (document.getElementById("wm_file_input").value) {
var imgFile = document.getElementById("wm_file_input")
let fileSize = imgFile.files[0].size
if (imgFile.files[0].type == "image/jpeg" && imgFile.files[0].type == "image/png"
&& imgFile.files[0].type == "image/jpg") {
if (imgFile.files[0].type == "image/jpeg" || imgFile.files[0].type == "image/png"
|| imgFile.files[0].type == "image/jpg") {
if (fileSize >= 5242880) {
event.preventDefault()
errMessage.innerText = "Uploaded file has exceeds the limit!"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/includes/head-lite.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<title>HANA PDF</title>
<link rel="icon" type="image/svg" href="{{ asset('assets/logo/ico.svg') }}">
<link rel="stylesheet" href="{{ asset('build/assets/font-C1ampFSP.css')}}" />
<link rel="stylesheet" href="{{ asset('build/assets/app-lite-DGYbdi6z.css')}}" />
<link rel="stylesheet" href="{{ asset('build/assets/app-lite-Bcv6T1H2.css')}}" />
2 changes: 1 addition & 1 deletion resources/views/includes/head.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@material-tailwind/html@latest/styles/material-tailwind.css" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/dropzone.css" />
<link rel="stylesheet" href="{{ asset('build/assets/font-C1ampFSP.css')}}" />
<link rel="stylesheet" href="{{ asset('build/assets/app-Q8IUc3hd.css')}}" />
<link rel="stylesheet" href="{{ asset('build/assets/app-BOaETB2h.css')}}" />
<link rel="script" href="{{ asset('build/assets/app-lW0wcPz6.js') }}" />
<link rel="script" href="{{ asset('build/assets/index-D1AB55dp.js')}}" />
2 changes: 1 addition & 1 deletion resources/views/includes/modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
</p>
<div class="flex flex-col items-center">
<button data-modal-hide="errModal" type="button" class="text-white bg-rt1 font-semibold font-quicksand rounded-md text-sm mx-auto px-5 py-2.5 w-1/6">OK</button>
<button data-modal-hide="errModal" type="button" class="text-white bg-rt1 font-semibold font-quicksand rounded-md text-sm mx-auto px-5 py-2.5 w-2/6 lg:w-1/6">OK</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/alternate-layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="content" class="flex flex-col min-h-screen justify-between">
@yield('content')
</div>
<script async type="module" src="/build/assets/kao-logic-B_ZIctFK.js"></script>
<script async type="module" src="/build/assets/kao-logic-CxNmQEhC.js"></script>
<script async type="module" src="https://unpkg.com/[email protected]/build/pdf.mjs"></script>
<script async type="module" src="https://unpkg.com/[email protected]/build/pdf.worker.mjs"></script>
<script async type="text/javascript" src="/ext-js/kao-controller.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/main-layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="content" class="flex flex-col min-h-screen justify-between">
@yield('content')
</div>
<script async type="module" src="/build/assets/kao-logic-B_ZIctFK.js"></script>
<script async type="module" src="/build/assets/kao-logic-CxNmQEhC.js"></script>
<script async type="text/javascript" src="/ext-js/kao-controller.js"></script>
<script async type="text/javascript" src="/ext-js/kao-main.js"></script>
<script async type="text/javascript" src="https://unpkg.com/@material-tailwind/html@latest/scripts/ripple.js"></script>
Expand Down
14 changes: 7 additions & 7 deletions resources/views/pages/watermark.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</div>
<div class="mb-6">
<label for="watermarkPageImage" class="block mb-2 font-quicksand text-xl font-bold text-pc4">Page</label>
<input type="text" id="watermarkPageImage" name="watermarkPageImage" class="block font-quicksand text-sm lg:w-4/6 font-medium text-dt1 w-fullcursor-pointer rounded-lg bg-lt1" placeholder="Example: 1,2,3 or 1-5 or 1,2-5 or all" onfocusout="checkValidation('watermarkPage')">
<input type="text" id="watermarkPageImage" name="watermarkPageImage" class="block font-quicksand text-sm w-full lg:w-4/6 font-medium text-dt1 w-fullcursor-pointer rounded-lg bg-lt1" placeholder="Example: 1,2,3 or 1-5 or 1,2-5 or all" onfocusout="checkValidation('watermarkPage')">
</div>
<div class="mb-6">
<label for="wmRadioImageRotationA" class="block mb-2 font-quicksand text-xl font-bold text-pc4">Orientation</label>
Expand Down Expand Up @@ -145,10 +145,10 @@
</ul>
</div>
<div class="mb-6 flex flex-col">
<label id="Transparency" class="block mb-2 font-quicksand text-xl font-bold text-pc4" for="watermarkFontTransparency">Opacity</label>
<label id="Transparency" class="block mb-2 font-quicksand text-xl font-bold text-pc4" for="watermarkImageTransparency">Opacity</label>
<div class="flex flex-row w-full">
<input id="watermarkFontTransparency" name="watermarkFontImageTransparency" type="range" min="0" max="100" value="100" step="1" class="w-full lg:w-4/6 h-2 mt-4 accent-ac rounded-lg cursor-pointer" oninput="showVal(this.value,'image')" onchange="showVal(this.value,'image')">
<label id="TransparencyValueImage" class="font-semibold text-md text-lt1 ml-3 mt-2.5 font-quicksand" for="watermarkFontTransparency">100 %</label>
<input id="watermarkImageTransparency" name="watermarkFontImageTransparency" type="range" min="0" max="100" value="100" step="1" class="w-full lg:w-4/6 h-2 mt-4 accent-ac rounded-lg cursor-pointer" oninput="showVal(this.value,'image')" onchange="showVal(this.value,'image')">
<label id="TransparencyValueImage" class="font-semibold text-md text-lt1 ml-3 mt-2.5 font-quicksand" for="watermarkImageTransparency">100 %</label>
</div>
</div>
<div id="isMosaicImageArea" class="mb-6">
Expand Down Expand Up @@ -368,10 +368,10 @@
</ul>
</div>
<div class="mb-6 flex flex-col">
<label id="Transparency" class="block mb-2 font-quicksand text-xl font-bold text-pc4" for="watermarkFontTransparency">Opacity</label>
<label id="Transparency" class="block mb-2 font-quicksand text-xl font-bold text-pc4" for="watermarkTextTransparency">Opacity</label>
<div class="flex flex-row w-full">
<input id="watermarkFontTransparency" name="watermarkFontTextTransparency" type="range" min="0" max="100" value="100" step="1" class="w-full lg:w-4/6 h-2 mt-4 accent-ac rounded-lg cursor-pointer" oninput="showVal(this.value,'image')" onchange="showVal(this.value,'image')">
<label id="TransparencyValueText" class="font-semibold text-md text-lt1 ml-3 mt-2.5 font-quicksand" for="watermarkFontTransparency">100 %</label>
<input id="watermarkTextTransparency" name="watermarkFontTextTransparency" type="range" min="0" max="100" value="100" step="1" class="w-full lg:w-4/6 h-2 mt-4 accent-ac rounded-lg cursor-pointer" oninput="showVal(this.value,'text')" onchange="showVal(this.value,'text')">
<label id="TransparencyValueText" class="font-semibold text-md text-lt1 ml-3 mt-2.5 font-quicksand" for="watermarkTextTransparency">100 %</label>
</div>
</div>
<div id="isMosaicImageArea" class="mb-6">
Expand Down