Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to OpenPDF 2.0.0. #636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreasrosdal
Copy link

@andreasrosdal andreasrosdal commented Feb 19, 2024

Update to OpenPDF 2.0.0:

#635
https://github.com/LibrePDF/OpenPDF/releases/tag/2.0.0

Requires Java 17 or later.

@henricook
Copy link

Thank you for this @andreasrosdal - it was simple like you said 😂

Misconfigured search in my IDE meant that I couldn't find the dependency so had been scratching my head for ages

@Rapster
Copy link

Rapster commented Feb 21, 2024

@andreasrosdal There are two files that need to be updated after openpdf upgrade. Here is a preview:

Subject: [PATCH] fix compil
---
Index: thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java	(revision 56be6b35b1439868d3ddf570202ec4cfb0b1e374)
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java	(revision abc91269f1ce3249ea7d3a20e19c7686931ba493)
@@ -249,9 +249,9 @@
 
             Chunk lastChunk = (Chunk) elements.get( elements.size() - 1 );
             String localDestination = null;
-            if ( lastChunk.getAttributes() != null )
+            if ( lastChunk.getChunkAttributes() != null )
             {
-                localDestination = (String) lastChunk.getAttributes().get( Chunk.LOCALDESTINATION );
+                localDestination = (String) lastChunk.getChunkAttributes().get( Chunk.LOCALDESTINATION );
             }
             if ( localDestination != null )
             {
Index: thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java
--- a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java	(revision 56be6b35b1439868d3ddf570202ec4cfb0b1e374)
+++ b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java	(revision abc91269f1ce3249ea7d3a20e19c7686931ba493)
@@ -184,38 +184,38 @@
     }
 
     @Override
-    public void addCell( Image image )
+    public PdfPCell addCell( Image image )
     {
         this.empty = false;
-        super.addCell( image );
+        return super.addCell( image );
     }
 
     @Override
-    public void addCell( PdfPCell cell )
+    public PdfPCell addCell( PdfPCell cell )
     {
         this.empty = false;
-        super.addCell( cell );
+        return super.addCell( cell );
     }
 
     @Override
-    public void addCell( PdfPTable table )
+    public PdfPCell addCell( PdfPTable table )
     {
         this.empty = false;
-        super.addCell( table );
+        return super.addCell( table );
     }
 
     @Override
-    public void addCell( Phrase phrase )
+    public PdfPCell addCell( Phrase phrase )
     {
         this.empty = false;
-        super.addCell( phrase );
+        return super.addCell( phrase );
     }
 
     @Override
-    public void addCell( String text )
+    public PdfPCell addCell( String text )
     {
         this.empty = false;
-        super.addCell( text );
+        return super.addCell( text );
     }
 
     public boolean isEmpty()

@Rapster
Copy link

Rapster commented Feb 26, 2024

As of now, xdocreport requires java 1.7 and openpdf requires java 17. Is there any reason (dependencies for instance?) to stay on java 1.7 for now @opensagres ?

@angelozerr
Copy link
Member

@andreasrosdal There are two files that need to be updated after openpdf upgrade. Here is a preview:

could you add you change in this PR please.

@angelozerr
Copy link
Member

As of now, xdocreport requires java 1.7 and openpdf requires java 17. Is there any reason (dependencies for instance?) to stay on java 1.7 for now https://github.com/opensagres ?

The main idea is consume XDocReport with any old Java version. I think it is very shame to upgrade to java 17 if XDocReport doesn't use it. If we could consume openpdf without upgrading to Java 17 it should be very nice.

@andreasrosdal
Copy link
Author

andreasrosdal commented Feb 29, 2024

I hope the maintainers of xdocreport can take over this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants