Changeset 1567 for trunk/docx4j/src/main/java/org/docx4j/openpackaging
- Timestamp:
- 06/25/11 11:45:55 (11 months ago)
- Location:
- trunk/docx4j/src/main/java/org/docx4j/openpackaging
- Files:
-
- 2 edited
-
packages/WordprocessingMLPackage.java (modified) (1 diff)
-
parts/DrawingML/CreateDocxWithSmartArt.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r1536 r1567 408 408 // Create a basic sectPr using our Page model 409 409 PageDimensions page = new PageDimensions(); 410 page.setPgSize(sz, landscape); 411 410 412 SectPr sectPr = factory.createSectPr(); 411 413 body.setSectPr(sectPr); 412 sectPr.setPgSz( PageDimensions.createPgSize(sz, landscape) );413 sectPr.setPgMar( page.createPgMar());414 sectPr.setPgSz( page.getPgSz() ); 415 sectPr.setPgMar( page.getPgMar() ); 414 416 415 417 // Put the content in the part -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/DrawingML/CreateDocxWithSmartArt.java
r1544 r1567 67 67 MarginsWellKnown margins, 68 68 Document xml) throws Exception { 69 70 // TODO: pass in page size and orientation, 71 // and scale the SmartArt to fill the page. 72 69 73 70 // Make a basic docx 74 71 WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage(sz, landscape); … … 97 94 98 95 // Occupy entire page, less margins 99 PgSz pgSz = PageDimensions.createPgSize(sz, landscape );100 96 PageDimensions pd = new PageDimensions(); 97 pd.setPgSize(sz, landscape ); 98 PgSz pgSz = pd.getPgSz(); 101 99 pd.setMargins(margins); 102 String cx = ""+UnitsOfMeasurement.twipToEMU(pgSz.getW().intValue() - (pd.getMarginLeft()+pd.getMarginRight() ) ); //"5486400"; 103 String cy = ""+UnitsOfMeasurement.twipToEMU(pgSz.getH().intValue() - (pd.getMarginTop()+pd.getMarginBottom() )); //"3200400"; 100 String cx = ""+UnitsOfMeasurement.twipToEMU(pgSz.getW().intValue() 101 - (pd.getPgMar().getLeft().intValue()+pd.getPgMar().getRight().intValue() ) ); //"5486400"; 102 String cy = ""+UnitsOfMeasurement.twipToEMU(pgSz.getH().intValue() 103 - (pd.getPgMar().getTop().intValue()+pd.getPgMar().getBottom().intValue() )); //"3200400"; 104 104 105 105 // Now use it in the docx
Note: See TracChangeset
for help on using the changeset viewer.
