diff --git a/module/app/it/innove/play/pdf/PdfGenerator.java b/module/app/it/innove/play/pdf/PdfGenerator.java index 3bf3c7e..28ab095 100644 --- a/module/app/it/innove/play/pdf/PdfGenerator.java +++ b/module/app/it/innove/play/pdf/PdfGenerator.java @@ -16,7 +16,7 @@ import org.w3c.dom.Document; import org.xhtmlrenderer.pdf.ITextRenderer; -import com.lowagie.text.pdf.BaseFont; +import com.itextpdf.text.pdf.BaseFont; import play.Logger; import play.Play; @@ -35,13 +35,13 @@ public PdfGenerator() { } public void loadTemporaryFonts(List fontsToLoad) { - defaultFonts = new ArrayList(); + defaultFonts = new ArrayList<>(); addTemporaryFonts(fontsToLoad); } public void addTemporaryFonts(List fontsToLoad) { if (defaultFonts == null) - defaultFonts = new ArrayList(); + defaultFonts = new ArrayList<>(); for (String font : fontsToLoad) { try { InputStream fin = Play.application().resourceAsStream(font); @@ -57,13 +57,13 @@ public void addTemporaryFonts(List fontsToLoad) { } public void loadLocalFonts(List fontsToLoad) { - defaultFonts = new ArrayList(); + defaultFonts = new ArrayList<>(); addLocalFonts(fontsToLoad); } public void addLocalFonts(List fontsToLoad) { if (defaultFonts == null) - defaultFonts = new ArrayList(); + defaultFonts = new ArrayList<>(); for (String font : fontsToLoad) defaultFonts.add(font); } diff --git a/module/app/it/innove/play/pdf/PdfUserAgent.java b/module/app/it/innove/play/pdf/PdfUserAgent.java index 96bb297..a368027 100644 --- a/module/app/it/innove/play/pdf/PdfUserAgent.java +++ b/module/app/it/innove/play/pdf/PdfUserAgent.java @@ -7,6 +7,7 @@ import java.net.MalformedURLException; import java.net.URL; +import com.itextpdf.text.Image; import org.xhtmlrenderer.pdf.ITextFSImage; import org.xhtmlrenderer.pdf.ITextOutputDevice; import org.xhtmlrenderer.pdf.ITextUserAgent; @@ -18,7 +19,7 @@ import play.api.Play; import scala.Option; -import com.lowagie.text.Image; + public class PdfUserAgent extends ITextUserAgent { diff --git a/module/build.sbt b/module/build.sbt index 9a16653..4bb9bdf 100644 --- a/module/build.sbt +++ b/module/build.sbt @@ -2,7 +2,7 @@ name := "play2-pdf" organization := "it.innove" -version := "1.5.3" +version := "1.6.0" lazy val root = (project in file(".")).enablePlugins(PlayJava) @@ -12,7 +12,7 @@ crossPaths := false libraryDependencies ++= Seq( "commons-io" % "commons-io" % "2.4", - "org.xhtmlrenderer" % "flying-saucer-pdf" % "9.1.5", + "org.xhtmlrenderer" % "flying-saucer-pdf-itext5" % "9.1.5", "nu.validator.htmlparser" % "htmlparser" % "1.4" )