Hello,

I'm trying to load a schematic xml and this works fine, until the point
where a second page with text output should be created. The Text is always
on different positions and sometimes turned around.

How can I specify a diffrebt transformation on a second PDF page:


private SchematicCanvas schem;

            FileOutputStream fos = new FileOutputStream(f);
            int width = 842;    // A4 in 72dpi
            int height = 595;
            
            pdf2D = new PDFDocumentGraphics2D( false, fos, width, height );
            Rectangle rb = schem.cont.getBounds();
   
            
            pdf2D.setGraphicContext(new GraphicContext());            
            
            double scale = (double)width / rb.width;
            double scale2 = (double)height / rb.height;
            double x0 = rb.x;
            double y1 = rb.y + rb.height;
            
            if (scale2 < scale) scale = scale2;
            scale *= 0.9;
            x0 -= (width / scale - rb.width) / 2.;
            y1 += (height / scale - rb.height) / 2.;
   
                     
            AffineTransform Tx = new AffineTransform( scale, 0, 0, scale,
                  -x0*scale* 300. / 72., y1*scale* 300. / 72.);
            
            pdf2D.setTransform(Tx);
            
            pdf2D.drawRect(rb.x, rb.y, rb.width, rb.height);            
                     
                        
            schem.cont.paint(pdf2D, null);
            
            
            pdf2D.nextPage();
            
                        
            pdf2D.setGraphicContext(new GraphicContext());
            pdf2D.setColor(Color.blue);
            
            AffineTransform old = pdf2D.getTransform();               
            
            AffineTransform Tx2 = new AffineTransform(new values);
            pdf2D.setTransform(Tx2);
            
            
            pdf2D.drawString("Hello World", 0, 0);
            
                        
            pdf2D.setTransform(old);

-- 
View this message in context: 
http://www.nabble.com/AffineTransform-on-2nd-page-tp21583607p21583607.html
Sent from the FOP - Users mailing list archive at Nabble.com.

Reply via email to