Skip to content

Commit

Permalink
Fix for update flying saucer to 9.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosinigaglia committed May 11, 2017
1 parent 6dbeab8 commit 2345969
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions module/app/it/innove/play/pdf/PdfGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,13 +35,13 @@ public PdfGenerator() {
}

public void loadTemporaryFonts(List<String> fontsToLoad) {
defaultFonts = new ArrayList<String>();
defaultFonts = new ArrayList<>();
addTemporaryFonts(fontsToLoad);
}

public void addTemporaryFonts(List<String> fontsToLoad) {
if (defaultFonts == null)
defaultFonts = new ArrayList<String>();
defaultFonts = new ArrayList<>();
for (String font : fontsToLoad) {
try {
InputStream fin = Play.application().resourceAsStream(font);
Expand All @@ -57,13 +57,13 @@ public void addTemporaryFonts(List<String> fontsToLoad) {
}

public void loadLocalFonts(List<String> fontsToLoad) {
defaultFonts = new ArrayList<String>();
defaultFonts = new ArrayList<>();
addLocalFonts(fontsToLoad);
}

public void addLocalFonts(List<String> fontsToLoad) {
if (defaultFonts == null)
defaultFonts = new ArrayList<String>();
defaultFonts = new ArrayList<>();
for (String font : fontsToLoad)
defaultFonts.add(font);
}
Expand Down
3 changes: 2 additions & 1 deletion module/app/it/innove/play/pdf/PdfUserAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,7 +19,7 @@
import play.api.Play;
import scala.Option;

import com.lowagie.text.Image;


public class PdfUserAgent extends ITextUserAgent {

Expand Down
4 changes: 2 additions & 2 deletions module/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"
)

Expand Down

0 comments on commit 2345969

Please sign in to comment.