mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 11:00:47 +02:00
feat: add annotation option to PDF to image (#4365)
## Summary - add optional flag to include PDF annotations when converting to images - expose annotation option via API model and UI checkbox - add translation for annotation option ## Testing - `./gradlew spotlessApply` - `./gradlew build` ------ https://chatgpt.com/codex/tasks/task_b_68b7fa1d5a1c83288342244a0ec85e9d
This commit is contained in:
+3
-1
@@ -66,6 +66,7 @@ public class ConvertImgPDFController {
|
||||
String colorType = request.getColorType();
|
||||
int dpi = request.getDpi();
|
||||
String pageNumbers = request.getPageNumbers();
|
||||
boolean includeAnnotations = Boolean.TRUE.equals(request.getIncludeAnnotations());
|
||||
Path tempFile = null;
|
||||
Path tempOutputDir = null;
|
||||
Path tempPdfPath = null;
|
||||
@@ -101,7 +102,8 @@ public class ConvertImgPDFController {
|
||||
colorTypeResult,
|
||||
singleImage,
|
||||
dpi,
|
||||
filename);
|
||||
filename,
|
||||
includeAnnotations);
|
||||
if (result == null || result.length == 0) {
|
||||
log.error("resultant bytes for {} is null, error converting ", filename);
|
||||
}
|
||||
|
||||
+5
@@ -39,4 +39,9 @@ public class ConvertToImageRequest extends PDFWithPageNums {
|
||||
defaultValue = "300",
|
||||
requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer dpi;
|
||||
|
||||
@Schema(
|
||||
description = "Include annotations such as comments in the output image(s)",
|
||||
defaultValue = "false")
|
||||
private Boolean includeAnnotations;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user