Skip to content

Commit

Permalink
Updated to Play 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosinigaglia committed Oct 25, 2017
1 parent 280a555 commit 504d027
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
9 changes: 7 additions & 2 deletions module/app/it/innove/play/pdf/PdfGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@

import com.itextpdf.text.pdf.BaseFont;

import play.Environment;
import play.Logger;
import play.Play;
import play.twirl.api.Html;
import play.mvc.Result;
import play.mvc.Results;

import javax.inject.Inject;
import javax.inject.Singleton;

@Singleton
public class PdfGenerator {

private List<String> defaultFonts = null;

@Inject
Environment environment;

public PdfGenerator() {

}
Expand All @@ -44,7 +49,7 @@ public void addTemporaryFonts(List<String> fontsToLoad) {
defaultFonts = new ArrayList<>();
for (String font : fontsToLoad) {
try {
InputStream fin = Play.application().resourceAsStream(font);
InputStream fin = environment.resourceAsStream(font);
final File tempFile = File.createTempFile("tmp_" + FilenameUtils.getBaseName(font), "." + FilenameUtils.getExtension(font));
tempFile.deleteOnExit();
FileOutputStream out = new FileOutputStream(tempFile);
Expand Down
6 changes: 3 additions & 3 deletions module/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name := "play2-pdf"

organization := "it.innove"

version := "1.6.0"
version := "1.7.0"

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.6"
scalaVersion := "2.12.3"

crossPaths := false

libraryDependencies ++= Seq(
"commons-io" % "commons-io" % "2.4",
"org.xhtmlrenderer" % "flying-saucer-pdf-itext5" % "9.1.5",
"org.xhtmlrenderer" % "flying-saucer-pdf-itext5" % "9.1.7",
"nu.validator.htmlparser" % "htmlparser" % "1.4"
)

Expand Down
2 changes: 1 addition & 1 deletion module/project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=0.13.11
sbt.version=0.13.15

2 changes: 1 addition & 1 deletion module/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.4")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.6")
4 changes: 2 additions & 2 deletions samples/pdf-sample/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.8"
scalaVersion := "2.12.3"

libraryDependencies ++= Seq(
javaJdbc,
javaWs,
guice,
"it.innove" % "play2-pdf" % "1.6.0",
"it.innove" % "play2-pdf" % "1.7.0",
"com.squareup.okhttp3" % "okhttp" % "3.5.0"
)

Expand Down

0 comments on commit 504d027

Please sign in to comment.