1 31 package org.pdfbox.util.operator; 32 33 import java.util.List ; 34 import org.pdfbox.cos.COSNumber; 35 import org.pdfbox.util.Matrix; 36 import org.pdfbox.util.PDFOperator; 37 38 47 48 public class SetMatrix extends OperatorProcessor 49 { 50 51 56 public void process(PDFOperator operator, List arguments) 57 { 58 COSNumber a = (COSNumber)arguments.get( 0 ); 60 COSNumber b = (COSNumber)arguments.get( 1 ); 61 COSNumber c = (COSNumber)arguments.get( 2 ); 62 COSNumber d = (COSNumber)arguments.get( 3 ); 63 COSNumber e = (COSNumber)arguments.get( 4 ); 64 COSNumber f = (COSNumber)arguments.get( 5 ); 65 66 Matrix textMatrix = new Matrix(); 67 textMatrix.setValue( 0, 0, a.floatValue() ); 68 textMatrix.setValue( 0, 1, b.floatValue() ); 69 textMatrix.setValue( 1, 0, c.floatValue() ); 70 textMatrix.setValue( 1, 1, d.floatValue() ); 71 textMatrix.setValue( 2, 0, e.floatValue() ); 72 textMatrix.setValue( 2, 1, f.floatValue() ); 73 context.setTextMatrix( textMatrix ); 74 context.setTextLineMatrix( textMatrix.copy() ); 75 } 76 } 77 | Popular Tags |