Advertisement
Guest User

Untitled

a guest
Dec 18th, 2011
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. package andprac.ch1;
  2.  
  3. import java.io.FileOutputStream;
  4.  
  5. import android.app.Activity;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.widget.Toast;
  9.  
  10. import com.lowagie.text.Chunk;
  11. import com.lowagie.text.Document;
  12. import com.lowagie.text.pdf.PdfWriter;
  13.  
  14. public class ChunkActivity extends Activity {
  15. /** Called when the activity is first created. */
  16. @Override
  17. public void onCreate(Bundle savedInstanceState) {
  18. super.onCreate(savedInstanceState);
  19. setContentView(R.layout.main);
  20.  
  21. try{
  22.  
  23.  
  24. Document document=new Document();
  25. PdfWriter.getInstance(document,new FileOutputStream("a.pdf"));
  26. document.open();
  27. Chunk chunk=new Chunk("Welecome To RoseIndia.");
  28. chunk.setUnderline(+1f,-2f);
  29. document.add(chunk);
  30. FileOutputStream fOut = openFileOutput("a.pdf", MODE_WORLD_READABLE);
  31. PdfWriter.getInstance(document, fOut);
  32. document.close();
  33.  
  34. }
  35.  
  36. catch(Exception e){
  37.  
  38.  
  39.  
  40.  
  41. String err=e.toString();
  42.  
  43. Toast.makeText(this,err, Toast.LENGTH_SHORT).show();
  44. }
  45.  
  46. }
  47.  
  48. public void onClick(View v){
  49.  
  50.  
  51. //Toast.makeText(this,"f", Toast.LENGTH_SHORT).show();
  52.  
  53. }
  54.  
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement