Replacement / Alternative to dhorions?
I see others have posted that this project is now effectively dead and won't integrate with PdfBox v3.x.
Does anyone know of a replacement that is both maintained and can be used with PdfBox?
Thanks Graham
I am personally no longer able to spend the needed time on it. @gmseed would you like to take over the development?
@dhorions @gmseed I would like to help.
I was able to build this project with pdfbox 3.0.3. I hope you can publish one more build.
Here are the changes I made:
README.md
@@ -75,7 +75,7 @@ BaseTable table = new BaseTable(yStart, yStartNewPage, bottomMargin, tableWidth,
//Create Header row
Row<PDPage> headerRow = table.createRow(15f);
Cell<PDPage> cell = headerRow.createCell(100, "Awesome Facts About Belgium");
-cell.setFont(PDType1Font.HELVETICA_BOLD);
+cell.setFont(new PDType1Font(Standard14Fonts.FontName.HELVETICA_BOLD));
cell.setFillColor(Color.BLACK);
table.addHeaderRow(headerRow);
List<String[]> facts = getFacts();
pom.xml
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
- <version>3.0.0</version>
+ <version>3.0.3</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -90,8 +90,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source>1.7</source>
- <target>1.7</target>
+ <source>21</source>
+ <target>21</target>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
</compilerArguments>
/src/test/java/be/quodlibet/boxable/DataTableTest.java
@@ -2,7 +2,7 @@ package be.quodlibet.boxable;
import be.quodlibet.boxable.datatable.DataTable;
import be.quodlibet.boxable.datatable.UpdateCellProperty;
-import com.google.common.io.Files;
+//import com.google.common.io.Files;
import java.awt.Color;
import java.io.File;
import java.io.IOException;
/src/test/java/be/quodlibet/boxable/TableTest.java
@@ -114,7 +114,7 @@ public class TableTest {
}
} else if(fact[i].equalsIgnoreCase("Google")) {
cell = row.createCell((100 / 9f), fact[i]);
- cell.setFont(PDType1Font.HELVETICA_OBLIQUE);
+ cell.setFont(new PDType1Font(Standard14Fonts.FontName.HELVETICA_OBLIQUE));
cell.setFontSize(6);
cell.setUrl(new URL("https://www.google.de"));
} else {
@@ -1209,11 +1209,11 @@ public class TableTest {
// draw page title
PageContentStreamOptimized cos = new PageContentStreamOptimized(new PDPageContentStream(doc, page));
- PDStreamUtils.write(cos, "Welcome to your first borderless table", PDType1Font.HELVETICA_BOLD, 14, 15, yStart,
+ PDStreamUtils.write(cos, "Welcome to your first borderless table", new PDType1Font(Standard14Fonts.FontName.HELVETICA_BOLD), 14, 15, yStart,
Color.BLACK);
cos.close();
- yStart -= FontUtils.getHeight(PDType1Font.HELVETICA_BOLD, 14) + 15;
+ yStart -= FontUtils.getHeight(new PDType1Font(Standard14Fonts.FontName.HELVETICA_BOLD), 14) + 15;
BaseTable table = new BaseTable(yStart, yStartNewPage, bottomMargin, tableWidth, margin, doc, page, drawLines,
drawContent);
I would be willing to pick up the project, if you are still looking for someone @dhorions
Hey I have started a Project for building tables in PDF documents. Please do have a look at it here : GitHub . Maven Repository link