Changeset 1167
- Timestamp:
- 07/15/10 12:29:34 (19 months ago)
- Location:
- trunk/docx4j
- Files:
-
- 12 added
- 4 edited
- 2 moved
-
build.xml (modified) (2 diffs)
-
pom.xml (modified) (3 diffs)
-
src/docx4j-extras/PdfViaHtml (added)
-
src/docx4j-extras/PdfViaHtml/org (added)
-
src/docx4j-extras/PdfViaHtml/org/docx4j (added)
-
src/docx4j-extras/PdfViaHtml/org/docx4j/convert (added)
-
src/docx4j-extras/PdfViaHtml/org/docx4j/convert/out (added)
-
src/docx4j-extras/PdfViaHtml/org/docx4j/convert/out/pdf (added)
-
src/docx4j-extras/PdfViaHtml/org/docx4j/convert/out/pdf/viaHTML (moved) (moved from trunk/docx4j/src/main/java/org/docx4j/convert/out/pdf/viaHTML)
-
src/docx4j-extras/PdfViaIText (added)
-
src/docx4j-extras/PdfViaIText/org (added)
-
src/docx4j-extras/PdfViaIText/org/docx4j (added)
-
src/docx4j-extras/PdfViaIText/org/docx4j/convert (added)
-
src/docx4j-extras/PdfViaIText/org/docx4j/convert/out (added)
-
src/docx4j-extras/PdfViaIText/org/docx4j/convert/out/pdf (added)
-
src/docx4j-extras/PdfViaIText/org/docx4j/convert/out/pdf/viaIText (moved) (moved from trunk/docx4j/src/main/java/org/docx4j/convert/out/pdf/viaIText)
-
src/main/java/org/docx4j/fonts/PhysicalFonts.java (modified) (3 diffs)
-
src/main/java/org/docx4j/samples/CreatePdf.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/build.xml
r1142 r1167 31 31 <!-- <pathelement location="${m2Repository}/com/topologi/diffx/0.61/diffx-0.61.jar"/> 32 32 --> 33 34 <!-- Uncomment for the PDF conversion via HTML or iText, which 35 may be found in docx4j-extras. 36 37 If you are planning to use that, you'll also want to uncomment 38 the BaseFont stuff in PhysicalFonts. 39 33 40 <pathelement location="${m2Repository}/com/lowagie/itext-unsigned/2.0.8/itext-unsigned-2.0.8.jar"/> 34 <!--35 <pathelement location="${m2Repository}/com/lowagie/itext/2.0.8/itext-2.0.8.jar"/>36 41 --> 37 <!--Explicit Exclusions from iText: 38 <pathelement location="${m2Repository}/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar"/> 39 <pathelement location="${m2Repository}/bouncycastle/bcprov-jdk14/138/bcprov-jdk14-138.jar"/> 40 --> 42 41 43 <pathelement location="${m2Repository}/xalan/xalan-patched/2.7.0/xalan-patched-2.7.0.jar"/> 42 44 <pathelement location="${m2Repository}/pdf-renderer/pdf-renderer/0.2009.0324/pdf-renderer-0.2009.0324.jar"/> … … 162 164 <javadoc access="public" author="false" 163 165 destdir="javadoc" 164 doctitle="docx4j 2. 3.0"166 doctitle="docx4j 2.4.0" 165 167 nodeprecated="false" 166 168 nodeprecatedlist="false" -
trunk/docx4j/pom.xml
r1145 r1167 232 232 --> 233 233 234 <!-- We need SVN build, not v1.3.1,235 in order to run headless.236 Replace with public copy once there237 is something newer than v1.3.1 -->238 234 <dependency> 239 235 <groupId>org.apache.xmlgraphics</groupId> 240 236 <artifactId>xmlgraphics-commons</artifactId> 241 237 <version>1.3.757686</version> 238 <!-- Not in maven yet as of 2010 07 15 239 <version>1.4</version> 240 --> 242 241 </dependency> 243 242 … … 253 252 <version>3.4.0</version> 254 253 </dependency> 255 254 255 <!-- Uncomment for the PDF conversion via HTML or iText, which 256 may be found in docx4j-extras. 257 258 If you are planning to use that, you'll also want to uncomment 259 the BaseFont stuff in PhysicalFonts. 260 256 261 <dependency> 257 262 <groupId>com.lowagie</groupId> … … 269 274 </exclusions> 270 275 </dependency> 276 --> 271 277 <dependency> 272 278 <groupId>xalan</groupId> -
trunk/docx4j/src/main/java/org/docx4j/fonts/PhysicalFonts.java
r991 r1167 20 20 import org.docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart; 21 21 22 import com.lowagie.text.pdf.BaseFont;22 //import com.lowagie.text.pdf.BaseFont; 23 23 24 24 /** … … 272 272 273 273 log.debug(".. found"); 274 275 // We're only interested if this font supports UTF-8 encoding 276 // since otherwise iText can't use it (at least on a 277 // UTF8 encoded XHTML document) 278 try { 279 BaseFont bf = BaseFont.createFont(afm, 280 BaseFont.IDENTITY_H, 281 BaseFont.NOT_EMBEDDED); 282 } catch (java.io.UnsupportedEncodingException uee) { 283 log.error(afm + " does not support UTF encoding, so ignoring"); 284 continue; 285 } catch (Exception e) { 286 log.error(e); 287 continue; 288 } 274 275 // Uncomment if you want to use the iText stuff in docx4j-extras 276 // // We're only interested if this font supports UTF-8 encoding 277 // // since otherwise iText can't use it (at least on a 278 // // UTF8 encoded XHTML document) 279 // try { 280 // BaseFont bf = BaseFont.createFont(afm, 281 // BaseFont.IDENTITY_H, 282 // BaseFont.NOT_EMBEDDED); 283 // } catch (java.io.UnsupportedEncodingException uee) { 284 // log.error(afm + " does not support UTF encoding, so ignoring"); 285 // continue; 286 // } catch (Exception e) { 287 // log.error(e); 288 // continue; 289 // } 289 290 pf = new PhysicalFont(triplet.getName(),fontInfo); 290 291 … … 298 299 if (f.exists()) { 299 300 log.debug(".. found"); 300 // We're only interested if this font supports UTF-8 encoding 301 try { 302 BaseFont bf = BaseFont.createFont(pfm, 303 BaseFont.IDENTITY_H, 304 BaseFont.NOT_EMBEDDED); 305 } catch (java.io.UnsupportedEncodingException uee) { 306 log.error(pfm + " does not support UTF encoding, so ignoring"); 307 continue; 308 } catch (Exception e) { 309 log.error(e); 310 continue; 311 } 301 302 // Uncomment if you want to use the iText stuff in docx4j-extras 303 // // We're only interested if this font supports UTF-8 encoding 304 // try { 305 // BaseFont bf = BaseFont.createFont(pfm, 306 // BaseFont.IDENTITY_H, 307 // BaseFont.NOT_EMBEDDED); 308 // } catch (java.io.UnsupportedEncodingException uee) { 309 // log.error(pfm + " does not support UTF encoding, so ignoring"); 310 // continue; 311 // } catch (Exception e) { 312 // log.error(e); 313 // continue; 314 // } 312 315 pf = new PhysicalFont(triplet.getName(), fontInfo); 313 316 } else { -
trunk/docx4j/src/main/java/org/docx4j/samples/CreatePdf.java
r1144 r1167 51 51 boolean save = true; 52 52 53 // String inputfilepath = System.getProperty("user.dir") + "/sample-docs/sample-docx.xml"; 54 // String inputfilepath = System.getProperty("user.dir") 55 // + "/sample-docs/test-docs/header-footer/header_first.xml"; 53 String inputfilepath = System.getProperty("user.dir") + "/sample-docs/sample-docx.xml"; 56 54 //String inputfilepath = System.getProperty("user.dir") + "/docs/Docx4j_GettingStarted.xml"; 57 // String inputfilepath = System.getProperty("user.dir")58 // + "/sample-docs/test-docs/endnotes.xml";59 String inputfilepath = "C:\\Users\\jharrop\\workspace\\docx4j\\tmp\\TestDocmToPDFConversion.docm";60 55 61 56 WordprocessingMLPackage wordMLPackage; … … 97 92 fontMapper.getFontMappings().put("Algerian", font); 98 93 99 100 /* Choose which of the three methods you want to use... 101 * 102 * .. viaHTML uses the old docX2HTML.xslt and xhtmlrenderer, 103 * and supports numbering, images, 104 * and tables, but is pretty hard to understand 105 * 106 * It is a trivial change to instead use 107 * HTMLExporterNG, but that should produce 108 * the same output as viaXSLFO, so we don't 109 * do that. 110 * 111 * .. viaXSLFO uses docx2fo.xslt and FOP. It is 112 * coming along, with support for 113 * headers/footers, images and tables 114 * 115 * .. viaItext - for developers who don't like xslt 116 * at all! Or want to use iText's features.. 117 * Displays images, but as at 2009 03 19. 118 * doesn't try to scale them. 119 * 120 * Fonts should work pretty well via any of these 121 * methods! 122 */ 94 // As of docx4j 2.5.0, only viaXSLFO is supported. 95 // The viaIText and viaHTML source code can be found in src/docx4j-extras directory 96 123 97 org.docx4j.convert.out.pdf.PdfConversion c 124 98 // = new org.docx4j.convert.out.pdf.viaHTML.Conversion(wordMLPackage);
Note: See TracChangeset
for help on using the changeset viewer.
