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

Updated to openPDF 2.0.2 #662

Merged
merged 7 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XDocReport is working with Java 8 , why you need Java 17?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 17 is required for OpenPDF 2.0.0 or later. The build for this pull request fails with java 8. If we want to upgrade openpdf, I don't think there is another way than to upgrade the minimum java requirement for XDocReport. Of course I'm not sure if losing java 8 support is acceptable for this project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if losing java 8 support is acceptable for this project.

No sorry, there are so many people who are using XDocReport with old Java version. We need to keep it.

@pascalleclercq do you know if we could build only the module of OpenPDF 2.0.0 with Java 17?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The maven compiler plugin is still set to version 1.7. So if we compile with java 17, XDocReport should still be compatible with java 8, unless you use the openpdf modules of course, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the changes that would be needed to run the tests with jdk17.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but the people staying on Java 8 just have to use the old Version of those libraries. For those who keep up to date there should be a release for OpenPDF 2.
You also could make separate Releases for Java 8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but the people staying on Java 8 just have to use the old Version of those libraries.

You speak about PDF converter, but XDocReport provides another feature like report generation.

distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@
*/
package fr.opensagres.odfdom.converter.pdf.internal.stylable;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;

import com.lowagie.text.Chunk;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;

import fr.opensagres.odfdom.converter.core.utils.ODFUtils;
import fr.opensagres.odfdom.converter.pdf.internal.styles.Style;
import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleBreak;
Expand All @@ -42,6 +37,10 @@
import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTextProperties;
import fr.opensagres.xdocreport.openpdf.extension.ExtendedParagraph;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;

/**
* fixes for paragraph pdf conversion by Leszek Piotrowicz <[email protected]>
*/
Expand Down Expand Up @@ -249,9 +248,9 @@ private void postProcessBookmarks()

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 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,7 @@
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>1.3.18</version>
<exclusions>
<exclusion>
<artifactId>bcmail-jdk14</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
<exclusion>
<artifactId>bcprov-jdk14</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
<exclusion>
<artifactId>bctsp-jdk14</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bctsp-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcmail-jdk14</artifactId>
</exclusion>
</exclusions>
<version>2.0.2</version>
</dependency>
<dependency>
<artifactId>bcmail-jdk14</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,38 +184,38 @@ boolean rowSpanAbove( int currRow, int currCol )
}

@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()
Expand Down
Loading