diff --git a/pdf/notes.txt b/pdf/notes.txt index 1f8969e48..889f17cd1 100644 --- a/pdf/notes.txt +++ b/pdf/notes.txt @@ -1,8 +1,9 @@ The majority of the work in this library is done by iText. http://www.lowagie.com/iText/ -The version bundled in this release is 2.1.4. - -The files in the library must be named itext.jar because they're specifically -included on the classpath as part of the build/platform/make.sh scripts. +The version bundled with previous releases was 2.1.4. After Processing 1.0.9, +the library was downgraded to iText 1.5.4., because later versions seem to +load slower, and don't seem to offer additional benefits. If the PDF library +gets worse, please post a bug and we'll go back to the 2.x release we were +using, or upgrade to the more recent 5.x series. diff --git a/pdf/src/processing/pdf/PGraphicsPDF.java b/pdf/src/processing/pdf/PGraphicsPDF.java index 90c706469..eba226f39 100644 --- a/pdf/src/processing/pdf/PGraphicsPDF.java +++ b/pdf/src/processing/pdf/PGraphicsPDF.java @@ -25,6 +25,8 @@ import java.util.*; import com.lowagie.text.*; import com.lowagie.text.pdf.*; +//import com.itextpdf.text.*; +//import com.itextpdf.text.pdf.*; import processing.core.*; @@ -67,6 +69,7 @@ public class PGraphicsPDF extends PGraphicsJava2D { public void beginDraw() { +// long t = System.currentTimeMillis(); if (document == null) { document = new Document(new Rectangle(width, height)); try { @@ -106,6 +109,7 @@ public class PGraphicsPDF extends PGraphicsJava2D { //System.out.println("done registering directories"); if (PApplet.platform == PApplet.MACOSX) { +// long t = System.currentTimeMillis(); try { String homeLibraryFonts = System.getProperty("user.home") + "/Library/Fonts"; @@ -117,6 +121,7 @@ public class PGraphicsPDF extends PGraphicsJava2D { // add the system font paths mapper.insertDirectory("/System/Library/Fonts"); mapper.insertDirectory("/Library/Fonts"); +// System.out.println("mapping " + (System.currentTimeMillis() - t)); } else if (PApplet.platform == PApplet.WINDOWS) { // how to get the windows fonts directory? @@ -154,6 +159,7 @@ public class PGraphicsPDF extends PGraphicsJava2D { g2 = content.createGraphics(width, height, mapper); // g2 = template.createGraphics(width, height, mapper); } +// System.out.println("beginDraw " + (System.currentTimeMillis() - t)); super.beginDraw(); }