Skip to content

Commit

Permalink
Merge pull request #460 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Dec 3, 2015
2 parents b7958b9 + eac35dd commit 8615bc1
Show file tree
Hide file tree
Showing 71 changed files with 3,661 additions and 720 deletions.
3 changes: 1 addition & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ module.exports = function (grunt) {
server: {
options: {
port: 8080,
base: "src/main/webapp/assets",
base: "/Users/phuonghqh/Documents/working/TechLooper/src/main/webapp/assets/",
keepalive: true
}
}
Expand Down Expand Up @@ -364,7 +364,6 @@ module.exports = function (grunt) {

grunt.registerTask("local", [
"clean:build",
//"template:staging",
"copy",
"bower-install-simple:build",
"includeSource:target",
Expand Down
71 changes: 42 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,30 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jasig.maven</groupId>
<artifactId>sass-maven-plugin</artifactId>
<version>${sass-maven-plugin.version}</version>
<executions>
<execution>
<id>Generate CSS files</id>
<goals>
<goal>update-stylesheets</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<configuration>
<resources>
<resource>
<source>
<directory>${project.basedir}/src/main/webapp/assets/sass</directory>
</source>
<destination>${project.basedir}/src/main/webapp/assets/css</destination>
</resource>
</resources>
</configuration>
</plugin>
<!--<plugin>-->
<!--<groupId>org.jasig.maven</groupId>-->
<!--<artifactId>sass-maven-plugin</artifactId>-->
<!--<version>${sass-maven-plugin.version}</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>Generate CSS files</id>-->
<!--<goals>-->
<!--<goal>update-stylesheets</goal>-->
<!--</goals>-->
<!--<phase>generate-sources</phase>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<resources>-->
<!--<resource>-->
<!--<source>-->
<!--<directory>${project.basedir}/src/main/webapp/assets/sass</directory>-->
<!--</source>-->
<!--<destination>${project.basedir}/src/main/webapp/assets/css</destination>-->
<!--</resource>-->
<!--</resources>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
Expand Down Expand Up @@ -493,11 +493,18 @@
<scope>provided</scope>
</dependency>

<!--<dependency>-->
<!--<groupId>com.itextpdf</groupId>-->
<!--<artifactId>itextpdf</artifactId>-->
<!--<version>5.5.7</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.8</version>
</dependency>

<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.5.8</version>
</dependency>


<!--<dependency>-->
<!--<groupId>org.jfree</groupId>-->
Expand Down Expand Up @@ -704,6 +711,12 @@
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-linkedin</artifactId>
<version>${spring-social-linkedin.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/techlooper/aspect/Main2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.techlooper.aspect;

import com.itextpdf.text.pdf.BaseFont;
import org.xhtmlrenderer.pdf.ITextRenderer;

import java.awt.*;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.reflect.Field;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;

/**
* Created by phuonghqh on 11/24/15.
*/
public class Main2 {

public static void main(String[] args) throws Exception {

String content = String.join("\n", Files.readAllLines(Paths.get("./src/main/webapp/assets/report.html")));

//Set PDF target output file
String outputFile = "firstdoc.pdf";

OutputStream os = new FileOutputStream(outputFile);

ITextRenderer renderer = new ITextRenderer();
renderer.getFontResolver().addFont("font/verdana.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
renderer.setDocumentFromString(content);
renderer.layout();
renderer.createPDF(os);

os.close();
}
}
Loading

0 comments on commit 8615bc1

Please sign in to comment.