Changeset 153 for trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
- Timestamp:
- 02/29/08 15:07:04 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r145 r153 32 32 33 33 import org.apache.log4j.Logger; 34 import org.docx4j.fonts.Substituter; 34 35 import org.docx4j.jaxb.Context; 35 36 import org.docx4j.openpackaging.Base; … … 210 211 211 212 log.info("wordDocument created for PDF rendering!"); 212 213 214 213 214 /* 215 * We want to use plain old Xalan J, not xsltc 216 * 217 * Following is not necessary provided Xalan is on the classpath. 218 * ================================== 219 * 220 System.setProperty("javax.xml.transform.TransformerFactory", "FQCN"); 221 222 examples of FQCN: 223 224 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl 225 org.apache.xalan.xsltc.trax.TransformerFactoryImpl 226 227 228 */ 215 229 // Now transform this into XHTML 216 230 javax.xml.transform.TransformerFactory tfactory = javax.xml.transform.TransformerFactory.newInstance(); … … 228 242 // Use the template to create a transformer 229 243 javax.xml.transform.Transformer xformer = template.newTransformer(); 230 244 245 log.error(xformer.getClass().getName() ); 246 // com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl won't work 247 // with our extension function. 248 249 // Handle fonts - this is platform specific 250 // Algorithm - to be implemented: 251 // 1. Get a list of all the fonts in the document 252 java.util.Map fontsInUse = this.getMainDocumentPart().fontsInUse(); 253 254 // 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this) 255 // - do this in a general way, since docx4all needs this as well to display fonts 256 Substituter s = new Substituter(); 257 s.populateFontMappings(fontsInUse); 258 259 // 3. Ensure that the font names in the XHTML have been mapped to these matches 260 // possibly via an extension function in the XSLT 261 xformer.setParameter("substituterInstance", s); 262 263 231 264 //DEBUGGING 232 265 // use the identity transform if you want to send wordDocument; … … 275 308 // Now render the XHTML 276 309 org.xhtmlrenderer.pdf.ITextRenderer renderer = new org.xhtmlrenderer.pdf.ITextRenderer(); 277 278 // TODO: Handle fonts 279 // - this is platform specific 280 // Algorithm - to be implemented: 281 // 1. Get a list of all the fonts in the document 282 // 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this) 283 // - do this in a general way, since docx4all needs this as well to display fonts 284 // 3. Ensure that the font names in the XHTML have been mapped to these matches 285 // possibly via an extension function in the XSLT 310 286 311 // 4. Use addFont code like that below as necessary for the fonts 287 312
Note: See TracChangeset
for help on using the changeset viewer.
