[Test PR] Desktop fix and unoconv to unoserver (#2971)

# Description of Changes

This pull request includes several updates to the Docker configuration
and Java application UI scaling. The changes enhance environment
variable management, dependency installation, and UI responsiveness to
different screen sizes.

### Docker Configuration Updates:
* Added new environment variables `STIRLING_PDF_DESKTOP_UI`,
`PYTHONPATH`, `UNO_PATH`, and `URE_BOOTSTRAP` to `Dockerfile` and
`Dockerfile.fat` to improve the configuration and integration of the
LibreOffice environment.
[[1]](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L38-R46)
[[2]](diffhunk://#diff-571631582b988e88c52c86960cc083b0b8fa63cf88f056f26e9e684195221c27L40-R49)
* Updated the `CMD` instruction in `Dockerfile` and `Dockerfile.fat` to
run both the Java application and `unoserver` simultaneously.
[[1]](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L87-R96)
[[2]](diffhunk://#diff-571631582b988e88c52c86960cc083b0b8fa63cf88f056f26e9e684195221c27L87-R100)
* Modified the `RUN` instruction to include additional Python
dependencies and setup a virtual environment.
[[1]](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L68-R81)
[[2]](diffhunk://#diff-571631582b988e88c52c86960cc083b0b8fa63cf88f056f26e9e684195221c27R72-R86)

### Workflow Enhancements:
* Added `STIRLING_PDF_DESKTOP_UI` environment variable to the GitHub
Actions workflows (`PR-Demo-Comment.yml` and `push-docker.yml`) to
ensure consistent environment settings.
[[1]](diffhunk://#diff-145fe5c0ed8c24e4673c9ad39800dd171a2d0a2e8050497cff980fc7e3a3df0dR106)
[[2]](diffhunk://#diff-76056236de05155107f6a660f1e3956059e37338011b8f0e72188afcb9b17b6fR41)

### Java Application UI Scaling:
* Introduced `UIScaling` utility to dynamically adjust the size of UI
components based on screen resolution in `DesktopBrowser` and
`LoadingWindow` classes.
[[1]](diffhunk://#diff-dff83b0fe53cba8ee80dc8cee96b9c2bfec612ec1f2c636ebdf22dedb36671e8L218-R219)
[[2]](diffhunk://#diff-dff83b0fe53cba8ee80dc8cee96b9c2bfec612ec1f2c636ebdf22dedb36671e8L267-R270)
[[3]](diffhunk://#diff-3e287daf297213b698b3c94d6e6ed4aae139d570ba6b115da459d72b5c36c42fL44-R64)
[[4]](diffhunk://#diff-3e287daf297213b698b3c94d6e6ed4aae139d570ba6b115da459d72b5c36c42fL86-R102)
* Improved the loading of icons by using the `UIScaling` utility for
better visual quality.

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.

---------

Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
Co-authored-by: a <a>
This commit is contained in:
Anthony Stirling
2025-02-18 11:57:56 +00:00
committed by GitHub
parent 68e8a0174c
commit d34c44ed7b
27 changed files with 540 additions and 127 deletions

View File

@@ -1,6 +1,7 @@
package stirling.software.SPDF.model;
public enum SortTypes {
CUSTOM,
REVERSE_ORDER,
DUPLEX_SORT,
BOOKLET_SORT,
@@ -10,4 +11,5 @@ public enum SortTypes {
REMOVE_FIRST,
REMOVE_LAST,
REMOVE_FIRST_AND_LAST,
DUPLICATE
}

View File

@@ -8,6 +8,7 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -25,7 +26,9 @@ public class PDFWithPageNums extends PDFFile {
description =
"The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the"
+ " format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a"
+ " constant (e.g., '2n+1', '3n', '6n-5')\"")
+ " constant (e.g., '2n+1', '3n', '6n-5')\"",
defaultValue = "all",
requiredMode = RequiredMode.NOT_REQUIRED)
private String pageNumbers;
@Hidden
@@ -41,9 +44,9 @@ public class PDFWithPageNums extends PDFFile {
}
@Hidden
public List<Integer> getPageNumbersList(PDDocument doc, boolean zeroCount) {
public List<Integer> getPageNumbersList(PDDocument doc, boolean oneBased) {
int pageCount = 0;
pageCount = doc.getNumberOfPages();
return GeneralUtils.parsePageList(pageNumbers, pageCount, zeroCount);
return GeneralUtils.parsePageList(pageNumbers, pageCount, oneBased);
}
}

View File

@@ -1,15 +0,0 @@
package stirling.software.SPDF.model.api.extract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper = true)
public class PDFFilePage extends PDFFile {
@Schema(description = "Number of chosen page", type = "number")
private int pageId;
}

View File

@@ -15,6 +15,8 @@ public class RearrangePagesRequest extends PDFWithPageNums {
implementation = SortTypes.class,
description =
"The custom mode for page rearrangement. Valid values are:\n"
+ "CUSTOM: Uses order defined in PageNums "
+ "DUPLICATE: Duplicate pages n times (if Page order defined as 4, then duplicates each page 4 times)"
+ "REVERSE_ORDER: Reverses the order of all pages.\n"
+ "DUPLEX_SORT: Sorts pages as if all fronts were scanned then all backs in reverse (1, n, 2, n-1, ...). "
+ "BOOKLET_SORT: Arranges pages for booklet printing (last, first, second, second last, ...).\n"

View File

@@ -1,6 +1,7 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -11,24 +12,49 @@ import stirling.software.SPDF.model.api.PDFWithPageNums;
public class AddPageNumbersRequest extends PDFWithPageNums {
@Schema(
description = "Custom margin: small/medium/large",
allowableValues = {"small", "medium", "large"})
description = "Custom margin: small/medium/large/x-large",
allowableValues = {"small", "medium", "large", "x-large"},
defaultValue = "medium",
requiredMode = RequiredMode.NOT_REQUIRED)
private String customMargin;
@Schema(
description = "Font size for page numbers",
minimum = "1",
requiredMode = RequiredMode.REQUIRED)
private float fontSize;
@Schema(
description = "Font type for page numbers",
allowableValues = {"helvetica", "courier", "times"},
requiredMode = RequiredMode.REQUIRED)
private String fontType;
@Schema(description = "Position: 1 of 9 positions", minimum = "1", maximum = "9")
@Schema(
description =
"Position: 1-9 representing positions on the page (1=top-left, 5=center, 9=bottom-right)",
minimum = "1",
maximum = "9",
requiredMode = RequiredMode.REQUIRED)
private int position;
@Schema(description = "Starting number", minimum = "1")
@Schema(
description = "Starting number for page numbering",
minimum = "1",
requiredMode = RequiredMode.REQUIRED)
private int startingNumber;
@Schema(description = "Which pages to number, default all")
@Schema(
description = "Which pages to number (e.g. '1,3-5,7' or 'all')",
defaultValue = "all",
requiredMode = RequiredMode.NOT_REQUIRED)
private String pagesToNumber;
@Schema(
description =
"Custom text: defaults to just number but can have things like \"Page {n} of {p}\"")
"Custom text pattern. Available variables: {n}=current page number, {total}=total pages, {filename}=original filename",
example = "Page {n} of {total}",
defaultValue = "{n}",
requiredMode = RequiredMode.NOT_REQUIRED)
private String customText;
}