mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-04-19 19:21:18 +00:00
changes
Signed-off-by: a <a>
This commit is contained in:
parent
b46ccdde44
commit
20dc2f60cd
@ -19,7 +19,7 @@ public class EEAppConfig {
|
||||
|
||||
@Bean(name = "RunningEE")
|
||||
public boolean runningEnterpriseEdition() {
|
||||
// TODO: Implement EE detection
|
||||
return false;
|
||||
return applicationProperties.getEnterpriseEdition().getEnabled();
|
||||
// TODO: check EE license key
|
||||
}
|
||||
}
|
||||
|
@ -160,4 +160,22 @@ public class AppConfig {
|
||||
public String accessibilityStatement() {
|
||||
return applicationProperties.getLegal().getAccessibilityStatement();
|
||||
}
|
||||
|
||||
@Bean(name = "analyticsPrompt")
|
||||
public boolean analyticsPrompt() {
|
||||
return applicationProperties.getSystem().getEnableAnalytics() == null
|
||||
|| "undefined".equals(applicationProperties.getSystem().getEnableAnalytics());
|
||||
}
|
||||
|
||||
@Bean(name = "analyticsEnabled")
|
||||
public boolean analyticsEnabled() {
|
||||
if (applicationProperties.getEnterpriseEdition().getEnabled()) return true;
|
||||
return applicationProperties.getSystem().getEnableAnalytics() != null
|
||||
&& Boolean.parseBoolean(applicationProperties.getSystem().getEnableAnalytics());
|
||||
}
|
||||
|
||||
@Bean(name = "StirlingPDFLabel")
|
||||
public String stirlingPDFLabel() {
|
||||
return "Stirling-PDF" + " v" + appVersion();
|
||||
}
|
||||
}
|
||||
|
@ -15,16 +15,16 @@ import stirling.software.SPDF.model.PdfMetadata;
|
||||
public class PdfMetadataService {
|
||||
|
||||
private final ApplicationProperties applicationProperties;
|
||||
private final String appVersion;
|
||||
private final String stirlingPDFLabel;
|
||||
private final UserServiceInterface userService;
|
||||
|
||||
@Autowired
|
||||
public PdfMetadataService(
|
||||
ApplicationProperties applicationProperties,
|
||||
@Qualifier("appVersion") String appVersion,
|
||||
@Qualifier("StirlingPDFLabel") String stirlingPDFLabel,
|
||||
@Autowired(required = false) UserServiceInterface userService) {
|
||||
this.applicationProperties = applicationProperties;
|
||||
this.appVersion = appVersion;
|
||||
this.stirlingPDFLabel = stirlingPDFLabel;
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@ -59,51 +59,40 @@ public class PdfMetadataService {
|
||||
|
||||
private void setNewDocumentMetadata(PDDocument pdf, PdfMetadata pdfMetadata) {
|
||||
|
||||
String creator = "Stirling-PDF";
|
||||
String creator = stirlingPDFLabel;
|
||||
|
||||
// if (applicationProperties
|
||||
// .getEnterpriseEdition()
|
||||
// .getCustomMetadata()
|
||||
// .isAutoUpdateMetadata()) {
|
||||
if (applicationProperties
|
||||
.getEnterpriseEdition()
|
||||
.getCustomMetadata()
|
||||
.isAutoUpdateMetadata()) {
|
||||
|
||||
// producer =
|
||||
//
|
||||
// applicationProperties.getEnterpriseEdition().getCustomMetadata().getProducer();
|
||||
// creator =
|
||||
// applicationProperties.getEnterpriseEdition().getCustomMetadata().getCreator();
|
||||
// title = applicationProperties.getEnterpriseEdition().getCustomMetadata().getTitle();
|
||||
creator = applicationProperties.getEnterpriseEdition().getCustomMetadata().getCreator();
|
||||
pdf.getDocumentInformation().setProducer(stirlingPDFLabel);
|
||||
}
|
||||
|
||||
// if ("{filename}".equals(title)) {
|
||||
// title = "Filename"; // Replace with actual filename logic
|
||||
// } else if ("{unchanged}".equals(title)) {
|
||||
// title = pdfMetadata.getTitle(); // Keep the original title
|
||||
// }
|
||||
// }
|
||||
|
||||
pdf.getDocumentInformation().setCreator(creator + " " + appVersion);
|
||||
pdf.getDocumentInformation().setCreator(creator);
|
||||
pdf.getDocumentInformation().setCreationDate(Calendar.getInstance());
|
||||
}
|
||||
|
||||
private void setCommonMetadata(PDDocument pdf, PdfMetadata pdfMetadata) {
|
||||
String producer = "Stirling-PDF";
|
||||
String title = pdfMetadata.getTitle();
|
||||
pdf.getDocumentInformation().setTitle(title);
|
||||
pdf.getDocumentInformation().setProducer(producer + " " + appVersion);
|
||||
pdf.getDocumentInformation().setProducer(stirlingPDFLabel);
|
||||
pdf.getDocumentInformation().setSubject(pdfMetadata.getSubject());
|
||||
pdf.getDocumentInformation().setKeywords(pdfMetadata.getKeywords());
|
||||
pdf.getDocumentInformation().setModificationDate(Calendar.getInstance());
|
||||
|
||||
String author = pdfMetadata.getAuthor();
|
||||
// if (applicationProperties
|
||||
// .getEnterpriseEdition()
|
||||
// .getCustomMetadata()
|
||||
// .isAutoUpdateMetadata()) {
|
||||
// author = applicationProperties.getEnterpriseEdition().getCustomMetadata().getAuthor();
|
||||
if (applicationProperties
|
||||
.getEnterpriseEdition()
|
||||
.getCustomMetadata()
|
||||
.isAutoUpdateMetadata()) {
|
||||
author = applicationProperties.getEnterpriseEdition().getCustomMetadata().getAuthor();
|
||||
|
||||
// if (userService != null) {
|
||||
// author = author.replace("username", userService.getCurrentUsername());
|
||||
// }
|
||||
// }
|
||||
if (userService != null) {
|
||||
author = author.replace("username", userService.getCurrentUsername());
|
||||
}
|
||||
}
|
||||
pdf.getDocumentInformation().setAuthor(author);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package stirling.software.SPDF.config.security.session;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -15,29 +13,17 @@ public class CustomHttpSessionListener implements HttpSessionListener {
|
||||
|
||||
private SessionPersistentRegistry sessionPersistentRegistry;
|
||||
|
||||
private final AtomicInteger activeSessions;
|
||||
|
||||
@Autowired
|
||||
public CustomHttpSessionListener(SessionPersistentRegistry sessionPersistentRegistry) {
|
||||
super();
|
||||
this.sessionPersistentRegistry = sessionPersistentRegistry;
|
||||
activeSessions = new AtomicInteger();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionCreated(HttpSessionEvent se) {
|
||||
log.info(
|
||||
"Session created: {} with count {}",
|
||||
se.getSession().getId(),
|
||||
activeSessions.incrementAndGet());
|
||||
}
|
||||
public void sessionCreated(HttpSessionEvent se) {}
|
||||
|
||||
@Override
|
||||
public void sessionDestroyed(HttpSessionEvent se) {
|
||||
log.info(
|
||||
"Session destroyed: {} with count {}",
|
||||
se.getSession().getId(),
|
||||
activeSessions.decrementAndGet());
|
||||
sessionPersistentRegistry.expireSession(se.getSession().getId());
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ public class UserController {
|
||||
@PostMapping("/admin/saveUser")
|
||||
public RedirectView saveUser(
|
||||
@RequestParam(name = "username", required = true) String username,
|
||||
@RequestParam(name = "password", required = true) String password,
|
||||
@RequestParam(name = "password", required = false) String password,
|
||||
@RequestParam(name = "role") String role,
|
||||
@RequestParam(name = "authType") String authType,
|
||||
@RequestParam(name = "forceChange", required = false, defaultValue = "false")
|
||||
|
@ -136,6 +136,7 @@ public class ApplicationProperties {
|
||||
private boolean customHTMLFiles;
|
||||
private String tessdataDir;
|
||||
private Boolean enableAlphaFunctionality;
|
||||
private String enableAnalytics;
|
||||
}
|
||||
|
||||
@Data
|
||||
@ -179,6 +180,7 @@ public class ApplicationProperties {
|
||||
|
||||
@Data
|
||||
public static class EnterpriseEdition {
|
||||
private Boolean enabled;
|
||||
@ToString.Exclude private String key;
|
||||
private CustomMetadata customMetadata = new CustomMetadata();
|
||||
|
||||
|
@ -17,6 +17,7 @@ public class RequestUriUtils {
|
||||
|| requestURI.startsWith(contextPath + "/public/")
|
||||
|| requestURI.startsWith(contextPath + "/pdfjs/")
|
||||
|| requestURI.startsWith(contextPath + "/login")
|
||||
|| requestURI.startsWith(contextPath + "/error")
|
||||
|| requestURI.endsWith(".svg")
|
||||
|| requestURI.endsWith(".png")
|
||||
|| requestURI.endsWith(".ico")
|
||||
|
@ -27,7 +27,6 @@ server.servlet.context-path=${SYSTEM_ROOTURIPATH:/}
|
||||
|
||||
spring.devtools.restart.enabled=true
|
||||
spring.devtools.livereload.enabled=true
|
||||
|
||||
spring.thymeleaf.encoding=UTF-8
|
||||
|
||||
spring.web.resources.mime-mappings.webmanifest=application/manifest+json
|
||||
@ -42,7 +41,7 @@ spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
spring.h2.console.enabled=false
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
|
||||
server.servlet.session.timeout: 30m
|
||||
# Change the default URL path for OpenAPI JSON
|
||||
springdoc.api-docs.path=/v1/api-docs
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=ضبط حجم/مقياس الصفحة
|
||||
home.scalePages.desc=تغيير حجم/مقياس الصفحة و/أو محتواها.
|
||||
scalePages.tags=تغيير الحجم,تعديل,الأبعاد,تكييف
|
||||
|
||||
home.pipeline.title=خط الأنابيب (متقدم)
|
||||
home.pipeline.title=خط الأنابيب
|
||||
home.pipeline.desc=تشغيل إجراءات متعددة على ملفات PDF عن طريق تحديد نصوص خط الأنابيب
|
||||
pipeline.tags=أتمتة,تسلسل,مبرمج,معالجة دفعات
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Adjust page size/scale
|
||||
home.scalePages.desc=Change the size/scale of page and/or its contents.
|
||||
scalePages.tags=resize,modify,dimension,adapt
|
||||
|
||||
home.pipeline.title=Pipeline (Advanced)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Run multiple actions on PDFs by defining pipeline scripts
|
||||
pipeline.tags=automate,sequence,scripted,batch-process
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Upravit velikost/škálu stránky
|
||||
home.scalePages.desc=Změnit velikost/škálu stránky a/nebo její obsah.
|
||||
scalePages.tags=změnit velikost,upravit,rozměr,přizpůsobit
|
||||
|
||||
home.pipeline.title=Potrubí (Pokročilé)
|
||||
home.pipeline.title=Potrubí
|
||||
home.pipeline.desc=Spustit více akcí na PDF s definicí skriptů potrubí
|
||||
pipeline.tags=automatizovat,sekvence,skriptované,dávkové zpracování
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Seitengröße/Skalierung anpassen
|
||||
home.scalePages.desc=Größe/Skalierung der Seite und/oder des Inhalts ändern
|
||||
scalePages.tags=größe ändern,ändern,dimensionieren,anpassen
|
||||
|
||||
home.pipeline.title=Pipeline (Fortgeschritten)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Mehrere Aktionen auf ein PDF anwenden, definiert durch ein Pipeline Skript
|
||||
pipeline.tags=automatisieren,sequenzieren,skriptgesteuert,batch prozess
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Escalar/ajustar tamaño de página
|
||||
home.scalePages.desc=Escalar/cambiar el tamaño de una pagina y/o su contenido
|
||||
scalePages.tags=cambiar tamaño,modificar,dimensionar,adaptar
|
||||
|
||||
home.pipeline.title=Secuencia (Avanzado)
|
||||
home.pipeline.title=Secuencia
|
||||
home.pipeline.desc=Ejecutar varias tareas a PDFs definiendo una secuencia de comandos
|
||||
pipeline.tags=automatizar,secuencia,con script,proceso por lotes
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Ajuster l’échelle ou la taille
|
||||
home.scalePages.desc=Modifiez la taille ou l’échelle d’une page et/ou de son contenu.
|
||||
scalePages.tags=ajuster,redimensionner,resize,modify,dimension,adapt
|
||||
|
||||
home.pipeline.title=Pipeline (avancé)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Exécutez plusieurs actions sur les PDF en définissant des scripts de pipeline.
|
||||
pipeline.tags=automatiser,séquencer,automate,sequence,scripted,batch-process
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Prilagodite veličinu/razmjer stranice
|
||||
home.scalePages.desc=Promijenite veličinu/razmjer stranice i/ili njezin sadržaj.
|
||||
scalePages.tags=izmjena,modifikacija,dimenzija,adaptacija
|
||||
|
||||
home.pipeline.title=Pipeline (Advanced)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Izvršite više radnji na PDF-ovima definiranjem skripti u pipeline-u
|
||||
pipeline.tags=automatizacija,sekvenciranje,skriptirano,batch-process
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Menyesuaikan ukuran/skala halaman
|
||||
home.scalePages.desc=Mengubah ukuran/skala halaman dan/atau isinya.
|
||||
scalePages.tags=mengubah ukuran, memodifikasi, dimensi, mengadaptasi
|
||||
|
||||
home.pipeline.title=Pipeline (Lanjutan)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Menjalankan beberapa tindakan pada PDF dengan mendefinisikan skrip pipeline
|
||||
pipeline.tags=mengotomatiskan, mengurutkan, menulis, proses batch
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Regola le dimensioni/scala della pagina
|
||||
home.scalePages.desc=Modificare le dimensioni/scala della pagina e/o dei suoi contenuti.
|
||||
scalePages.tags=ridimensionare,modificare,dimensionare,adattare
|
||||
|
||||
home.pipeline.title=Pipeline (avanzato)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Esegui più azioni sui PDF definendo script di pipeline
|
||||
pipeline.tags=automatizzare,sequenziare,scriptare,elaborare in batch
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=ページの縮尺の調整
|
||||
home.scalePages.desc=ページやコンテンツの縮尺を変更します。
|
||||
scalePages.tags=resize,modify,dimension,adapt
|
||||
|
||||
home.pipeline.title=パイプライン (高度)
|
||||
home.pipeline.title=パイプライン
|
||||
home.pipeline.desc=パイプラインスクリプトを定義してPDF上で複数のアクションを実行します。
|
||||
pipeline.tags=automate,sequence,scripted,batch-process
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Aanpassen paginaformaat/schaal
|
||||
home.scalePages.desc=Wijzig de grootte/schaal van een pagina en/of de inhoud ervan.
|
||||
scalePages.tags=resize,aanpassen,dimensie,aanpassen
|
||||
|
||||
home.pipeline.title=Pijplijn (Geavanceerd)
|
||||
home.pipeline.title=Pijplijn
|
||||
home.pipeline.desc=Voer meerdere acties uit op PDF's door pipelinescripts te definiëren
|
||||
pipeline.tags=automatiseren,volgorde,gescrript,batch-verwerking
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Dopasuj rozmiar stron
|
||||
home.scalePages.desc=Dopasuj rozmiar stron wybranego dokumentu PDF
|
||||
scalePages.tags=resize,modify,dimension,adapt
|
||||
|
||||
home.pipeline.title=Automatyzacja (Zaawansowane)
|
||||
home.pipeline.title=Automatyzacja
|
||||
home.pipeline.desc=Wykonaj wiele akcji na dokumentach PDF, tworząc automatyzację
|
||||
pipeline.tags=automate,sequence,scripted,batch-process
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Ajustar Tamanho/Escala de Página
|
||||
home.scalePages.desc=Alterar o tamanho/escala da página e/ou seu conteúdo.
|
||||
scalePages.tags=redimensionar,modificar,dimensão,adaptar
|
||||
|
||||
home.pipeline.title=Pipeline (Avançado)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Executar várias ações em PDFs definindo scripts de pipeline
|
||||
pipeline.tags=automatizar,sequência,scriptado,processo-em-lote
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Prispôsobiť veľkosť/škálovanie stránok
|
||||
home.scalePages.desc=Zmeniť veľkosť/škálovanie stránky a/alebo jej obsahu.
|
||||
scalePages.tags=veľkosť,modifikovať,rozmery,prispôsobiť
|
||||
|
||||
home.pipeline.title=Pipeline (Pokročilé)
|
||||
home.pipeline.title=Pipeline
|
||||
home.pipeline.desc=Spustiť viacero akcií na PDF definovaním pipeline skriptov
|
||||
pipeline.tags=automatizovať,sekvencia,skriptované,dávkové spracovanie
|
||||
|
||||
|
@ -380,7 +380,7 @@ home.scalePages.title=Sayfa boyutunu/ölçeğini ayarla
|
||||
home.scalePages.desc=Bir sayfanın ve/veya içeriğinin boyutunu/ölçeğini değiştirir
|
||||
scalePages.tags=boyutlandır,değiştir,boyut,uyarla
|
||||
|
||||
home.pipeline.title=Çoklu İşlemler (İleri Seviye)
|
||||
home.pipeline.title=Çoklu İşlemler
|
||||
home.pipeline.desc=Çoklu İşlemler tanımlayarak PDF'lere birden fazla işlemi çalıştır
|
||||
pipeline.tags=otomatikleştir,sıralı,betikli,toplu-işlem
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -298,3 +298,26 @@ span.icon-text::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.go-pro-link {
|
||||
position: relative;
|
||||
padding: 0.5rem 1rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.go-pro-badge {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
background-color: #007bff;
|
||||
border-radius: 0.25rem;
|
||||
text-transform: uppercase;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.go-pro-link:hover .go-pro-badge {
|
||||
background-color: #0056b3;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
@ -327,6 +327,9 @@ class PdfContainer {
|
||||
page.setRotation(PDFLib.degrees(page.getRotation().angle + rotationAngle));
|
||||
}
|
||||
}
|
||||
pdfDoc.setCreator(stirlingPDFLabel);
|
||||
pdfDoc.setProducer(stirlingPDFLabel);
|
||||
|
||||
const pdfBytes = await pdfDoc.save();
|
||||
const pdfBlob = new Blob([pdfBytes], { type: "application/pdf" });
|
||||
|
||||
|
@ -101,6 +101,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p th:text="#{enterpriseEdition.ssoAdvert}"></p>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const delete_confirm_text = /*[[#{adminUserSettings.confirmDeleteUser}]]*/ 'Should the user be deleted?';
|
||||
const change_confirm_text = /*[[#{adminUserSettings.confirmChangeUserStatus}]]*/ 'Should the user be disabled/enabled?';
|
||||
|
@ -69,6 +69,9 @@
|
||||
<script th:src="@{'/js/cacheFormInputs.js'}" th:if="${currentPage != 'home'}"></script>
|
||||
<script th:src="@{'/js/tab-container.js'}"></script>
|
||||
<script th:src="@{'/js/darkmode.js'}"></script>
|
||||
<script th:inline="javascript">
|
||||
const stirlingPDFLabel = /*[[${@StirlingPDFLabel}]]*/ '';
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
<th:block th:fragment="game">
|
||||
|
@ -354,6 +354,12 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="https://stirlingpdf.com/pricing" class="nav-link go-pro-link" target="_blank" rel="noopener noreferrer">
|
||||
<span class="go-pro-badge" th:text="#{enterpriseEdition.button}"></span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<!-- Settings Button -->
|
||||
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#settingsModal">
|
||||
|
Loading…
x
Reference in New Issue
Block a user