added support for floating content positions

This commit is contained in:
jomu
2016-05-19 23:45:53 +00:00
parent 36de01c8db
commit 8aa33a0262
6 changed files with 88 additions and 30 deletions

View File

@ -44,12 +44,6 @@ public class PDFDocumentTest {
.addLine("12345 Musterhausen");
doc.addContent(addressContent);
TextContent invoiceInfoInformation = new TextContent(doc, 40, 442, "Sehr geehrter Anzeigenkunde, ")
.addLine()
.addLine()
.addLine("Wir danken für den Auftrag und bitten um Erledigung der folgenden Anzeigenabrechnung");
doc.addContent(invoiceInfoInformation);
TextContent informationContent = new TextContent(doc, 400, 662);
informationContent.addLine("Anzeigenabrechnung", "bold");
informationContent.addLine("Veronika Mühlencord", "helv12");
@ -58,9 +52,8 @@ public class PDFDocumentTest {
informationContent.addLine();
informationContent.addLine("Hövelhof, den ${invoiceDate?date}", "bold");
doc.addContent(informationContent);
TableContent informationContent2 = new TableContent (doc, doc.getStandardFont(), 400, 580);
TableContent informationContent2 = new TableContent (doc, doc.getStandardFont());
List<String> headers = new ArrayList<>();
headers.add("Kunden-Nr");
headers.add("${customerNumber}");
@ -72,6 +65,17 @@ public class PDFDocumentTest {
informationContent2.addLine ("Ausgabe: ", "Dezember");
informationContent2.addLine ("Rechnungsdatum:", "${invoiceDate?date}");
doc.addContent(informationContent2);
TextContent invoiceInfoInformation = new TextContent(doc, 40, 442, "Sehr geehrter Anzeigenkunde, ")
.addLine()
.addLine()
.addLine("Wir danken für den Auftrag und bitten um Erledigung der folgenden Anzeigenabrechnung");
doc.addContent(invoiceInfoInformation);
TextContent test = new TextContent (doc)
.addLine("Das ist ein Test");
doc.addContent (test);
jsonString = gson.toJson(doc);
System.out.println(jsonString);