Skip to content

Commit

Permalink
[MNT-24238] Added new options (pdfFont, pdfFontSize) to textToPdf tra…
Browse files Browse the repository at this point in the history
…nsformer (#885) (#929)

* [MNT-23960] Added new options (pdfFont, pdfFontSize) to textToPdf transformer (#885)

* [MNT-23960] Added options (pdfFont, pdfFontSize) and NotoSans fonts to textToPdf transformer

* [MNT-23960] Added 'MISC_PDFBOX_DEFAULT_FONT' and 'transform.core.misc.pdfbox.defaultFont' configuration to core-aio and misc T-Engines

* [MNT-23960] Added NotoSans fonts to core-aio and misc T-Engine images

* [MNT-23960] Improved logging: added messages, using placeholders

* [MNT-23960] Added DEFAULT_FONT constant (NotoSans-Regular)

* [MNT-23960] Splitted getFont(PDDocument, String) code into 3 methods. Added Javadoc.

* [MNT-23960] Return TransformCheckResult on transformTextAndCheck methods. Added assertion to testUTF8WithBOM test.

(cherry picked from commit b9bcc3c)

* [MNT-24238] Removed jakarta.annotation.PostConstruct import
  • Loading branch information
tiagosalvado10 authored Feb 16, 2024
1 parent 5040c81 commit 65ac8f9
Show file tree
Hide file tree
Showing 16 changed files with 556 additions and 52 deletions.
4 changes: 3 additions & 1 deletion docs/external-engine-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The following externalized T-engines properties are available:
| ACTIVEMQ_PASSWORD | ActiveMQ Password. | admin |
| FILE_STORE_URL | T-Engine Port. | http://localhost:8099/alfresco/api/-default-/private/sfs/versions/1/file |
| TRANSFORM_ENGINE_REQUEST_QUEUE | T-Engine queue used for async requests. | org.alfresco.transform.engine.misc.acs |
| MISC_PDFBOX_DEFAULT_FONT | Default font used by PdfBox | NotoSans-Regular |

## Libreoffice
| Property | Description | Default value |
Expand Down Expand Up @@ -96,4 +97,5 @@ The following externalized T-engines properties are available:
| IMAGEMAGICK_DYN | Path to Imagemagick DYLD. | /usr/lib64/ImageMagick-7.0.10/lib |
| IMAGEMAGICK_EXE | Path to Imagemagick EXE. | /usr/bin/convert |
| IMAGEMAGICK_CODERS | Path to Imagemagick custom coders. | |
| IMAGEMAGICK_CONFIG | Path to Imagemagick custom config. | |
| IMAGEMAGICK_CONFIG | Path to Imagemagick custom config. | |
| MISC_PDFBOX_DEFAULT_FONT | Default font used by PdfBox | NotoSans-Regular |
1 change: 1 addition & 0 deletions engines/aio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ADD target/generated-resources/licenses /licenses
ADD target/generated-resources/licenses.xml /licenses/
ADD target/generated-sources/license/THIRD-PARTY.txt /licenses/
COPY target/classes/licenses/3rd-party/ /
COPY target/classes/fonts/NotoSans /usr/local/share/fonts/NotoSans

RUN groupadd -g ${GROUPID} ${GROUPNAME} && \
useradd -u ${USERID} -G ${GROUPNAME} ${AIOUSERNAME} && \
Expand Down
3 changes: 3 additions & 0 deletions engines/aio/src/main/resources/application-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ transform:
exifTool:
windowsOS: 'exiftool -args -G1 -sep "|||" #{"$"}{INPUT}'
unixOS: 'env FOO=#{"$"}{OUTPUT} exiftool -args -G1 -sep "|||" #{"$"}{INPUT}'
misc:
pdfBox:
defaultFont: ${MISC_PDFBOX_DEFAULT_FONT:NotoSans-Regular}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public void optionListTest()
"startPage",
"targetEncoding",
"thumbnail",
"width"
"width",
"pdfFont",
"pdfFontSize"
),
getOptionNames(controller.transformConfig(0).getBody().getTransformOptions()));
}
Expand Down
1 change: 1 addition & 0 deletions engines/misc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ADD target/generated-resources/licenses /licenses
ADD target/generated-resources/licenses.xml /licenses/
ADD target/generated-sources/license/THIRD-PARTY.txt /licenses/
COPY target/classes/licenses/3rd-party/ /
COPY target/classes/fonts/NotoSans /usr/local/share/fonts/NotoSans

RUN groupadd -g ${GROUPID} ${GROUPNAME} && \
useradd -u ${USERID} -G ${GROUPNAME} ${MISCUSERNAME} && \
Expand Down
1 change: 1 addition & 0 deletions engines/misc/LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
* commons-compress, PDFBox and poi-ooxml are from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0 or the
[Apache 2.0.txt](src/main/resources/licenses/3rd-party/Apache%202.0.txt)
file placed in the root directory of the docker image.
* NotoSans https://openfontlicense.org/open-font-license-official-text/
Loading

0 comments on commit 65ac8f9

Please sign in to comment.