1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2026-03-14 13:55:44 +01:00

Merge branch 'master' of github.com:24eme/signaturepdf

This commit is contained in:
Gabriel Poma 2025-07-16 12:34:36 +02:00
commit d30798a440
3 changed files with 17 additions and 7 deletions

View file

@ -668,7 +668,12 @@ async function save(order) {
const pdfBooklet = await window['PDFLib'].PDFDocument.create();
for(let i = nbPages; i > 0; i--) {
orgaPages.push([i, 2 * nbPages - i + 1]);
let pages = [i, 2 * nbPages - i + 1];
if(i % 2) {
orgaPages.push(pages.reverse());
} else {
orgaPages.push(pages);
}
}
for(pages of orgaPages.reverse()) {
await merge2Pages(pdfBooklet, pdf.getPages()[pages[0] - 1], pdf.getPages()[pages[1] - 1], pageWidth, pageHeight)
@ -983,8 +988,12 @@ async function pageOrganization() {
};
document.addEventListener('DOMContentLoaded', function () {
if(window.location.hash.match(/#booklet/)) {
document.querySelector('#select_formatting').value = "booklet";
document.querySelector('#demo_link').href = document.querySelector('#demo_link').href + '#booklet';
}
if(window.location.hash && window.location.hash.match(/^\#http/)) {
let hashUrl = window.location.hash.replace(/^\#/, '');
let hashUrl = window.location.hash.replace('#booklet', '').replace(/^\#/, '');
pageUpload();
uploadFromUrl(hashUrl);
} else if (window.location.hash && canUseCache()) {

View file

@ -28,7 +28,7 @@
<a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action"><i class="bi bi-type-strikethrough"></i> <?php echo _("Strike through text") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action"><i class="bi bi-people-fill"></i> <?php echo _("Allow multiple people to sign via a shared link") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action"><i class="bi bi-patch-check"></i> <?php echo _("Sign with the server certificate") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action"><i class="bi bi-droplet-half"></i> <?php echo _("Add a watermark") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action position-relative"><i class="bi bi-droplet-half"></i> <?php echo _("Add a watermark") ?><span class="badge rounded-pill text-dark border border-dark position-absolute top-50 end-0 translate-middle-y me-3"><?php echo _("New") ?></span></a>
<!-- <a href="<?php echo $REVERSE_PROXY_URL; ?>/signature" class="list-group-item list-group-item-action"><i class="bi bi-bounding-box"></i> <?php echo _("Redact areas") ?></a> -->
</div>
</div>
@ -41,9 +41,10 @@
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-arrows-move"></i> <?php echo _("Reorder pages") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-download"></i> <?php echo _("Extract pages") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-arrow-clockwise"></i> <?php echo _("Rotate pages") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-rulers"></i> <?php echo _("Change or standardize the paper size") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action position-relative"><i class="bi bi-rulers"></i> <?php echo _("Change or standardize the paper size") ?><span class="badge rounded-pill text-dark border border-dark position-absolute top-50 end-0 translate-middle-y me-3"><?php echo _("New") ?></span></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-trash"></i> <?php echo _("Delete pages") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action"><i class="bi bi-images"></i> <?php echo _("Convert images to PDF") ?></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization#booklet" class="list-group-item list-group-item-action position-relative"><i class="bi bi-book"></i> <?php echo _("Generate a booklet") ?><span class="badge rounded-pill text-dark border border-dark position-absolute top-50 end-0 translate-middle-y me-3"><?php echo _("New") ?></span></a>
<a href="<?php echo $REVERSE_PROXY_URL; ?>/organization" class="list-group-item list-group-item-action position-relative"><i class="bi bi-images"></i> <?php echo _("Convert images to PDF") ?><span class="badge rounded-pill text-dark border border-dark position-absolute top-50 end-0 translate-middle-y me-3"><?php echo _("New") ?></span></a>
</div>
</div>
<div class="card mt-4">

View file

@ -22,7 +22,7 @@
<input id="input_pdf_upload" placeholder="<?php echo _("Choose a PDF"); ?>" class="form-control form-control-lg" type="file" accept=".pdf,application/pdf,image/png,image/jpeg" multiple="true" />
<p class="mt-2 small fw-light text-dark">&nbsp;</p>
<?php if($PDF_DEMO_LINK): ?>
<p class="mt-4"><a class="link-opacity-75 link-primary link-offset-2 link-underline-opacity-25 link-underline-opacity-100-hover small" href="#<?php echo $PDF_DEMO_LINK ?>"><?php echo _("Test with a demo PDF") ?></a></p>
<p class="mt-4"><a id="demo_link" class="link-opacity-75 link-primary link-offset-2 link-underline-opacity-25 link-underline-opacity-100-hover small" href="#<?php echo $PDF_DEMO_LINK ?>"><?php echo _("Test with a demo PDF") ?></a></p>
<?php endif; ?>
</div>
</div>
@ -165,7 +165,7 @@
<option value="" selected><?php echo _("Normal") ?></option>
<option value="booklet"><?php echo _("Booklet") ?></option>
</select>
<label for="select-format"><?php echo _("PDF Formatting") ?></label>
<label for="select-format"><?php echo _("Formatting") ?></label>
</div>
</div>
<div class="modal-footer">