  | 
    
 
  
    
    
      
        
          
         Author | 
        
         Topic: Adobe Illustrator Export Class  (Read 11057 times) | 
       
     
     | 
   
 
  
    
    
      
        
        
          
            
            mrrudge 
 
        
      
             | 
            
            
            
              
                
                Re: Adobe Illustrator Export Class 
                « Reply #30 on: Jan 18th, 2005, 12:45am » | 
                
                
 
                 | 
               
             
             
            
            Hi,      I'm pulling my hair out a little trying to get the AIExport Class to output any text at all?      Does anyone have a simple working example?      This, is what i'm doing wrong somehow:      ___________________________________________      AIExport ai;   BFont metaBold;      void setup(){     size( 500, 500 );     ai = new AIExport( this, 5 );     metaBold = loadFont("Meta-Bold.vlw.gz");   };      void loop(){     ai.run();     colorMode( RGB, 255 );     background( 128 );     ai.setLayer( 1 );     ai.setLineWeight( 1 );       ai.ai_textFont( metaBold, 48 );     ai.ai_textSize( 20 );       ai.ai_textMode(ALIGN_RIGHT);     ai.ai_text( "hello", 50, 50 );   };      void keyPressed(){    if( key=='e' ) ai.exportOneFrame();   };      ___________________________________________      Which gives me ( When I hit 'e' to export ):         AIExport: Starting default export. Exporting the next frame.         Error while running applet.      java.lang.IllegalArgumentException: Cannot format given Object as a Number       at java.text.NumberFormat.format(NumberFormat.java:219)    at java.text.Format.format(Format.java:133)    at AIExport.ai_text(AIExport.java:532)    at Temporary_4903_7978.loop(Temporary_4903_7978.java:19)    at BApplet.nextFrame(BApplet.java:434)    at BApplet.run(BApplet.java:369)    at java.lang.Thread.run(Thread.java:536)         If anyone could shed any light on this I'd be most grateful, cheers!      B.      edit. just tidied the error message to take less space                    
            
             | 
           
            
            
            
              
                | « Last Edit: Jan 18th, 2005, 12:47am by mrrudge » | 
                  | 
               
             
            
             | 
           
         
         | 
       
     
     | 
   
 
  
    
    
      
        
        
          
            
            pacesetter 
 
     
      
             | 
            
            
            
              
                
                Re: Adobe Illustrator Export Class 
                « Reply #31 on: Jan 28th, 2005, 5:12pm » | 
                
                
 
                 | 
               
             
             
            
            I have the same problem with ai_bezier();   if I try to call exportOneFrame(); on a few beziers, I get this error:         Error while running applet.   java.lang.IllegalArgumentException: Cannot format given Object as a Number         at java.text.NumberFormat.format(NumberFormat.java:219)         at java.text.Format.format(Format.java:133)         at AIExport.ai_bezier(AIExport.java:716)         at Temporary_7824_3405.lijn(Temporary_7824_3405.java:197)         at Temporary_7824_3405.maakLijnen(Temporary_7824_3405.java:207)         at Temporary_7824_3405.loop(Temporary_7824_3405.java:9          at BApplet.nextFrame(BApplet.java:434)         at BApplet.run(BApplet.java:369)         at java.lang.Thread.run(Thread.java:536)         the strange thing is: if I replace the ai_bezier() with a ai_line command, it works  just fine. 
            
             | 
           
            
            
            
              
                | « Last Edit: Jan 28th, 2005, 5:13pm by pacesetter » | 
                  | 
               
             
            
             | 
           
         
         | 
       
     
     | 
   
 
  
    
    
      
        
        
          
            
            pacesetter 
 
     
      
             | 
            
            
            
              
                
                Re: Adobe Illustrator Export Class 
                « Reply #32 on: Feb 1st, 2005, 3:37pm » | 
                
                
 
                 | 
               
             
             
            
            I already fixed the problem with the ai_bezier() myself. In the AIExport.java file it sais on line 716-717:     addLine(nf.format(bApplet.screenX(ax1, ay1, 0)) + " "+ nf.format(reflectedScreenY(ax1, ay1, 0) + " m"));      while it should be:     addLine(nf.format(bApplet.screenX(ax1, ay1, 0)) + " "+ nf.format(reflectedScreenY(ax1, ay1, 0)) + " m");      I think it's the same problem with your error,mrrudge.   you should change line 533:      + nf.format(reflectedScreenY(x, y, 0) + " L"));      to:      + nf.format(reflectedScreenY(x, y, 0)) + " L");      cheers,   tim. 
            
             | 
           
            | 
            
            
            
             | 
           
         
         | 
       
     
     | 
   
 
  
    
    
      
        
        
          
            
            deltasounds 
 
     
      
             | 
            
            
            
              
                
                Re: Adobe Illustrator Export Class, ai_rect 
                « Reply #33 on: Apr 19th, 2005, 1:33am » | 
                
                
 
                 | 
               
             
             
            
            I am having trouble with the ai_rect function...      The rectangles render to the Processing output window, but not to the exported ai file.  As a debugging strategy, I replaced ai_rect with the ai_ellipse function, and it rendered the ellipses perfectly.        I don't seem to be making a syntax error as the the render to the Processing window is just as expected.  Is there a problem with the exporter for the ai_rect function?      One of the example programs I have tried is an adaptation of awmartin's example, as follows (everything renders but the rectangles).  Any advice much appreciated....Thanks!         The code I tested:         AIExport ai;      void setup(){     size( 500, 500 );     ai = new AIExport( this, 5 );     ai.setContinuousRecordingFrameRate( 2 );     ai.ai_rectMode(CORNER);   }      void loop(){     ai.run();     colorMode( RGB, 255 );     background( 255 );        ai.setLayer( 1 );     ai.setLineWeight( 0.25 );     ai.ai_stroke(255, 102, 0);      ai.ai_line(85, 20, 10, 10);      ai.ai_line(90, 90, mouseX, mouseY);      ai.ai_rect(100,100,200,200);          ai.setLayer( 2 );     ai.setLineWeight( 1 );     ai.ai_stroke(0, 0, 0);      ai.ai_bezier(85, 20, 10, 10, 90, 90, mouseX, mouseY);     ai.ai_rect(100,100,200,200);     ai.ai_noStroke();          colorMode(HSB, 100);      for(int i=0; i<100; i+=10) {        for(int j=0; j<100; j+=10) {     ai.ai_stroke(i, j, 100);     ai.ai_point(i, j);    ai.ai_ellipse(i,j,5,5);      ai.ai_rect(i+1,j+1,7,7);        }      }    }      void keyPressed(){    if( key=='e' ) ai.exportOneFrame();    if( key=='s' ) ai.takeSnapShot();    if( key=='d' ) ai.dumpSnapShots();    if( key=='r' ) ai.toggleContinuousRecording();   } 
            
             | 
           
            | 
            
            
            
             | 
           
         
         | 
       
     
     | 
   
 
 
 |