Add rotate and compress (#7)
* Add files via upload * Update build.gradle * Update general.css
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
43
src/main/resources/templates/compress-pdf.html
Normal file
43
src/main/resources/templates/compress-pdf.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<th:block th:insert="~{common :: head}"></th:block>
|
||||
<title>S-PDF Add-Image</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:insert="~{navbar.html :: navbar}"></div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2>Compress PDF</h2>
|
||||
|
||||
|
||||
|
||||
<form action="#" th:action="@{/compress-pdf}" th:object="${rotateForm}"
|
||||
method="post" enctype="multipart/form-data">
|
||||
<p>Warning: This process can take up to a minute depending on file-size</p>
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput"
|
||||
name="fileInput" required> <label
|
||||
class="custom-file-label" for="fileInput">Choose PDF</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="imageCompressionLevel">Value between 1 and 100 (1 being most reduced)</label> <input type="number" class="form-control"
|
||||
id="imageCompressionLevel" name="imageCompressionLevel" step="1" value="1" min="1" max="100" required>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Compress</button>
|
||||
</form>
|
||||
<th:block th:insert="~{common :: filelist}"></th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{footer.html :: footer}"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
61
src/main/resources/templates/convert-pdf.html
Normal file
61
src/main/resources/templates/convert-pdf.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:insert="~{common :: head}"></th:block>
|
||||
<title>S-PDF ConvertToPDF</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:insert="~{navbar.html :: navbar}"></div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2>Image to PDF</h2>
|
||||
|
||||
<form method="post" enctype="multipart/form-data"
|
||||
th:action="@{/convert-to-pdf}">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput"
|
||||
name="fileInput" required> <label
|
||||
class="custom-file-label" for="fileInput">Choose Image</label>
|
||||
</div>
|
||||
<br><br>
|
||||
<button type="submit" class="btn btn-primary">Convert</button>
|
||||
|
||||
</form>
|
||||
<th:block th:insert="~{common :: filelist}"></th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2>PDF to img</h2>
|
||||
<form method="post" enctype="multipart/form-data"
|
||||
th:action="@{/convert-from-pdf}">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput"
|
||||
name="fileInput" required> <label
|
||||
class="custom-file-label" for="fileInput">Choose PDF</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Image Format</label> <select class="form-control"
|
||||
name="imageFormat">
|
||||
<option value="jpg">JPEG</option>
|
||||
<option value="png">PNG</option>
|
||||
<option value="gif">GIF</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Convert</button>
|
||||
</form>
|
||||
<th:block th:insert="~{common :: filelist}"></th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{footer.html :: footer}"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,84 +1,108 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:insert="~{common :: head}"></th:block>
|
||||
<title>S-PDF</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:insert="~{navbar.html :: navbar}"></div>
|
||||
<!-- Jumbotron -->
|
||||
<div class="jumbotron jumbotron-fluid" id="jumbotron">
|
||||
<div class="container">
|
||||
<h1 class="display-4">Stirling PDF</h1>
|
||||
<p class="lead">Your locally hosted one-stop-shop for all your
|
||||
PDF needs. (Made 100% in ChatGPT in 1 day as a experiment)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Features -->
|
||||
<div class="container">
|
||||
<div class="row h-100">
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Merge PDFs</h5>
|
||||
<p class="card-text">Easily merge multiple PDFs into one.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/merge-pdfs}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Split PDFs</h5>
|
||||
<p class="card-text">Split your PDFs into multiple single-page
|
||||
documents or at specific page numbers.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/split-pdfs}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Convert to PDF</h5>
|
||||
<p class="card-text">Convert images to PDF.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/convert-to-pdf}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-100">
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body dark-card">
|
||||
<h5 class="card-title">Convert from PDF</h5>
|
||||
<p class="card-text">Convert PDF to Image.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/convert-from-pdf}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add image to PDF</h5>
|
||||
<p class="card-text">Adds image/watermark to a PDF</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/add-image}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">PDF Organizer</h5>
|
||||
<p class="card-text">Rearrange PDF pages into any order (or
|
||||
remove)</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/pdf-organizer}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{footer.html :: footer}"></div>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<th:block th:insert="~{common :: head}"></th:block>
|
||||
<title>S-PDF</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:insert="~{navbar.html :: navbar}"></div>
|
||||
<!-- Jumbotron -->
|
||||
<div class="jumbotron jumbotron-fluid" id="jumbotron">
|
||||
<div class="container">
|
||||
<h1 class="display-4">Stirling PDF</h1>
|
||||
<p class="lead">Your locally hosted one-stop-shop for all your
|
||||
PDF needs. (Made 100% in ChatGPT in 1 day as a experiment)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Features -->
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row h-100">
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Merge PDFs</h5>
|
||||
<p class="card-text">Easily merge multiple PDFs into one.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/merge-pdfs}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Split PDFs</h5>
|
||||
<p class="card-text">Split PDFs into multiple documents</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/split-pdfs}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add image to PDF</h5>
|
||||
<p class="card-text">Adds image/watermark to a PDF</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/add-image}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row h-100">
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Convert to/from PDF</h5>
|
||||
<p class="card-text">Convert images to/from PDF.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/convert-pdf}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">PDF Organizer</h5>
|
||||
<p class="card-text">Remove/Rearrange pages in any order</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/pdf-organizer}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Rotate PDFs</h5>
|
||||
<p class="card-text">Easily rotate your PDFs.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/rotate-pdf}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row h-100">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-4 h-100">
|
||||
<div class="dark-card card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Compress PDFs</h5>
|
||||
<p class="card-text">Compress PDFs to reduce their file size.</p>
|
||||
<a href="#" class="btn btn-primary" th:href="@{/compress-pdf}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{footer.html :: footer}"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -12,29 +12,31 @@
|
||||
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/merge-pdfs}"
|
||||
th:classappend="${currentPage}=='/merge-pdfs' ? 'active' : ''">Merge
|
||||
th:classappend="${currentPage}=='merge-pdfs' ? 'active' : ''">Merge
|
||||
PDFs</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/split-pdfs}"
|
||||
th:classappend="${currentPage}=='/split-pdfs' ? 'active' : ''">Split
|
||||
th:classappend="${currentPage}=='split-pdfs' ? 'active' : ''">Split
|
||||
PDFs</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/convert-to-pdf}"
|
||||
th:classappend="${currentPage}=='/convert-to-pdf' ? 'active' : ''">Convert
|
||||
to PDF</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/convert-from-pdf}"
|
||||
th:classappend="${currentPage}=='/convert-from-pdf' ? 'active' : ''">Convert
|
||||
from PDF</a></li>
|
||||
th:href="@{/convert-pdf}"
|
||||
th:classappend="${currentPage}=='convert-pdf' ? 'active' : ''">Convert
|
||||
to/from PDF</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/add-image}"
|
||||
th:classappend="${currentPage}=='/add-image' ? 'active' : ''">Add
|
||||
th:classappend="${currentPage}=='add-image' ? 'active' : ''">Add
|
||||
image to PDF</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/pdf-organizer}"
|
||||
th:classappend="${currentPage}=='/pdf-organizer' ? 'active' : ''">PDF
|
||||
th:classappend="${currentPage}=='pdf-organizer' ? 'active' : ''">PDF
|
||||
Organizer</a></li>
|
||||
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/rotate-pdf}"
|
||||
th:classappend="${currentPage}=='rotate-pdf' ? 'active' : ''">Rotate PDF</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#"
|
||||
th:href="@{/compress-pdf}"
|
||||
th:classappend="${currentPage}=='compress-pdf' ? 'active' : ''">Compress PDF</a></li>
|
||||
|
||||
<input type="checkbox" id="toggle-dark-mode"
|
||||
th:onclick="javascript:toggleDarkMode()">
|
||||
<a class="nav-link" href="#" for="toggle-dark-mode">Dark Mode</a>
|
||||
|
||||
47
src/main/resources/templates/rotate-pdf.html
Normal file
47
src/main/resources/templates/rotate-pdf.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<th:block th:insert="~{common :: head}"></th:block>
|
||||
<title>S-PDF Add-Image</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:insert="~{navbar.html :: navbar}"></div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2>Rotate PDF</h2>
|
||||
|
||||
|
||||
|
||||
<form action="#" th:action="@{/rotate-pdf}" th:object="${rotateForm}"
|
||||
method="post" enctype="multipart/form-data">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput"
|
||||
name="fileInput" required> <label
|
||||
class="custom-file-label" for="fileInput">Choose PDF</label>
|
||||
</div>
|
||||
|
||||
<label for="angle">Select rotation angle (in multiples of
|
||||
90 degrees):</label> <select id="angle" class="form-control" name="angle">
|
||||
<option value="90">90</option>
|
||||
<option value="180">180</option>
|
||||
<option value="270">270</option>
|
||||
<option value="-90">-90</option>
|
||||
<option value="-180">-180</option>
|
||||
<option value="-270">-270</option>
|
||||
</select> <br>
|
||||
<button type="submit" class="btn btn-primary">Rotate</button>
|
||||
</form>
|
||||
<th:block th:insert="~{common :: filelist}"></th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{footer.html :: footer}"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user