mbaeuerle / Briss-2.0

Briss 2.0 is intended to be a GUI Update for the Briss PDF cropping tool.
GNU General Public License v3.0
499 stars 48 forks source link

Broken PDF #34

Closed AnarchyCent closed 2 years ago

AnarchyCent commented 3 years ago

I would like to create a job on my Synology NAS which automatically processes the incoming PDF files. Unfortunately, I get a "broken" PDF that cannot open on Adobe Acrobat on my Windows. Java version: 11.0.12.7-1

uL8gxZ6cFQ

./Briss-2.0 -s "test.pdf" -d "test_cropped.pdf"
Clustering PDF: test.pdf
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.itextpdf.text.io.ByteBufferRandomAccessSource$1 (file:/volume1/Dateien/Test_PDFcrop/Briss-2.0/Briss-2.0/lib/itextpdf-5.5.10.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of com.itextpdf.text.io.ByteBufferRandomAccessSource$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Created 2 clusters.
Starting to render clusters......................Fontconfig error: Cannot load default config file
Exception in thread "Thread-0" java.lang.InternalError: java.lang.reflect.InvocationTargetException
        at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
        at java.desktop/java.awt.Font.getFont2D(Font.java:497)
        at java.desktop/java.awt.Font.getFontName(Font.java:1469)
        at java.desktop/java.awt.Font.getFontName(Font.java:1451)
        at org.jpedal.objects.acroforms.formData.SwingData.recalcFontSize(Unknown Source)
        at org.jpedal.objects.acroforms.formData.SwingData.scaleComponent(Unknown Source)
        at org.jpedal.objects.acroforms.formData.SwingData.setField(Unknown Source)
        at org.jpedal.objects.acroforms.formData.SwingData.completeField(Unknown Source)
        at org.jpedal.objects.acroforms.rendering.DefaultAcroRenderer.createField(Unknown Source)
        at org.jpedal.objects.acroforms.rendering.DefaultAcroRenderer.createDisplayComponentsForPage(Unknown Source)
        at org.jpedal.PDFtoImageConvertor.convert(Unknown Source)
        at org.jpedal.PdfDecoder.getPageAsImage(Unknown Source)
        at org.jpedal.PdfDecoder.getPageAsImage(Unknown Source)
        at at.laborg.briss.utils.ClusterRenderWorker.run(ClusterRenderWorker.java:42)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
        ... 15 more
Caused by: java.lang.NullPointerException
        at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
        at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
        at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
        at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
        at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:379)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:324)
        at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
        at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
        ... 20 more
finished!
Calculating crop rectangles.
Starting to crop files.
Cropping succesful. Cropped to:/volume1/Dateien/Test_PDFcrop/Briss-2.0/Briss-2.0/bin/test_cropped.pdf

Could you please help me on this?

cleydyr commented 3 years ago

Probably a JDK issue: https://github.com/adoptium/temurin-build/issues/693

cleydyr commented 3 years ago

Did you try to install fontconfig as suggested in the linked issue above, @AnarchyCent ? Hopefully it can solve the issue.

mbaeuerle commented 2 years ago

Seems to be a JDK issue as @cleydyr stated. The Github CI build works fine, maybe you could try the OpenJDK / Oracle JDK? Feel free to respond again if you still have issues. In the meantime I will close the issue for now.