You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rupanu Ranjaneswar <ru...@yahoo.com> on 2007/04/18 07:47:58 UTC

Please help with ppt to txt code snippet...

Hello ,
        I urgently and immediately need to convert
some of my powerpoint files into txt files.I tried to
use hslf but it's giving problems for slides with
templates..Can anyone Please heilp with a code snippet
do it..For your reference i am pasting my code here.
<<--START CODE-->>
String str;
		
PowerPointExtractor ppe =
newPowerPointExtractor(filename);
		str=ppe.getText();
     
       FileWriter fw=new FileWriter("F:\\newppt.txt");
				
		fw.write(str);
		fw.close();
                ppe.close();  
<<--END CODE-->>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
 Hi rupanu

 just specify the path according to ext3 Filesystem's Linux plat form

 i just tried it on windows but i will try it on linux machine

 actually what is the problem while executing on Linux machine

 if there r any querys just mail me

 i'll try to solve that ont and one more thing where r u working now

 by c u dude

Re: Please help with ppt to txt code snippet...

Posted by Rupanu Ranjaneswar <ru...@yahoo.com>.
Thanks for your ardent help Rajeshwar,I really
appreciate it.
      Just wanted to ask what do I need to do to run
the same code in Linux environment, as it successfully
runs in windows.







 
--- Rajeshwar Mothe <ra...@gmail.com> wrote:

> Hi dudes & POI users & Mr.Rupanu Ranjaneswar
> 
>  try this code also
> 
>  its working fine yar
> 
>  by c u dudes
> 
>  have a good day
> 
> 
> 
> 
> 
> import java.io.*;
> import java.util.*;
> import
>
org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor;
> public class ppt2{
> 
>   public ppt2(){
> 
>   }
>   public static void main(String[] args){
> 
>     try{
> 
>       FileInputStream in = new
> FileInputStream("C:\\Log4J.ppt");
> 
> 
>      String str = "";
> 
>
org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor
>  ppe = new
>
org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor(in);
> 
>           Vector  v = new Vector();
>       FileWriter fw=new
> FileWriter("C:\\newppt.txt");
> 
> 
> 
>             v = ppe.getTextAsVector();
> 
> 
>           //Fetches the ALL the text of the
> powerpoint file, in a vector of
> strings, one per text record
> 
>     for (  Enumeration e = v.elements() ;
> e.hasMoreElements() ;) {
>         System.out.println(e.nextElement());
> 
>                str = str + e.nextElement() ;
>                fw.write(str);
>       }
> 
>                fw.close();
>                ppe.close();
> }
> 
>     catch (Throwable t){
>       t.printStackTrace();
>     }
>   }
> }
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
Hi dudes & POI users & Mr.Rupanu Ranjaneswar

 try this code also

 its working fine yar

 by c u dudes

 have a good day





import java.io.*;
import java.util.*;
import org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor;
public class ppt2{

  public ppt2(){

  }
  public static void main(String[] args){

    try{

      FileInputStream in = new FileInputStream("C:\\Log4J.ppt");


     String str = "";

org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor  ppe = new
org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor(in);

          Vector  v = new Vector();
      FileWriter fw=new FileWriter("C:\\newppt.txt");



            v = ppe.getTextAsVector();


          //Fetches the ALL the text of the powerpoint file, in a vector of
strings, one per text record

    for (  Enumeration e = v.elements() ; e.hasMoreElements() ;) {
        System.out.println(e.nextElement());

               str = str + e.nextElement() ;
               fw.write(str);
      }

               fw.close();
               ppe.close();
}

    catch (Throwable t){
      t.printStackTrace();
    }
  }
}

Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
Hi dear Rupanu Ranjaneswar

u can use this piece of code also if required

by dude have a nice day

import java.io.*;
import org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor;
public class ppt1{

  public ppt1(){

  }
  public static void main(String[] args){

    try{

      FileInputStream in = new FileInputStream("C:\\Log4J.ppt");


     String str;

org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor  ppe = new
org.apache.poi.hslf.extractor.QuickButCruddyTextExtractor(in);
               str=ppe.    getTextAsString();

     System.out.println(str);
      FileWriter fw=new FileWriter("C:\\log4jjkda.txt");

               fw.write(str);
               fw.close();
               ppe.close();
}

    catch (Throwable t){
      t.printStackTrace();
    }
  }
}

Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
java.lang.String
*getText<file:///C:/Documents%20and%20Settings/Induction/Desktop/rajeshwar/collection/docs/apidocs/org/apache/poi/hslf/extractor/PowerPointExtractor.html#getText%28boolean,%20boolean%29>
*(boolean getSlideText, boolean getNoteText)
  hi , Rupanu Ranjaneswar

  u can use above method for ur perfect requirement

 thanks by c u have agood day

Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
hi Rupanu Ranjaneswar


  this code is working

  dont fell tence ever we r POI users and its working perfectly

 if there are any querys mail me

 by c u have a nice day


import java.io.*;
import org.apache.poi.hslf.extractor.PowerPointExtractor;
public class ppt{

  public ppt(){

  }
  public static void main(String[] args){

    try{

      FileInputStream in = new FileInputStream("C:\\raju.ppt");


     String str;

PowerPointExtractor ppe = new PowerPointExtractor(in);
               str=ppe.getText();


      FileWriter fw=new FileWriter("C:\\newppt.txt");

               fw.write(str);
               fw.close();
               ppe.close();
}

    catch (Throwable t){
      t.printStackTrace();
    }
  }
}


On 4/18/07, Rupanu Ranjaneswar <ru...@yahoo.com> wrote:
>
> Hello ,
>         I urgently and immediately need to convert
> some of my powerpoint files into txt files.I tried to
> use hslf but it's giving problems for slides with
> templates..Can anyone Please heilp with a code snippet
> do it..For your reference i am pasting my code here.
> <<--START CODE-->>
> String str;
>
> PowerPointExtractor ppe =
> newPowerPointExtractor(filename);
>                 str=ppe.getText();
>
>        FileWriter fw=new FileWriter("F:\\newppt.txt");
>
>                 fw.write(str);
>                 fw.close();
>                 ppe.close();
> <<--END CODE-->>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>

Re: Please help with ppt to txt code snippet...

Posted by Rajeshwar Mothe <ra...@gmail.com>.
 hi rupanu

 just dend me the complete code that ur trying to convert it into text
format

 please paste that code snippet

 Best Regards

 Rajeshwar




On 4/18/07, Rupanu Ranjaneswar <ru...@yahoo.com> wrote:
>
> Hello ,
>        I urgently and immediately need to convert
> some of my powerpoint files into txt files.I tried to
> use hslf but it's giving problems for slides with
> templates..Can anyone Please heilp with a code snippet
> do it..For your reference i am pasting my code here.
> <<--START CODE-->>
> String str;
>
> PowerPointExtractor ppe =
> newPowerPointExtractor(filename);
>                str=ppe.getText();
>
>       FileWriter fw=new FileWriter("F:\\newppt.txt");
>
>                fw.write(str);
>                fw.close();
>                ppe.close();
> <<--END CODE-->>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>