out of memory exception while reading large pdf files
<p>Following is my code.It reads the pdf file .It works fine with smaller pdf files but when i try to open large files it gives out of memory exception.can anyone help.</p>

<pre><code>    public void nextPage() {
            try {
                if (i &lt;= numberOfPages) {
                    s = extractor.getTextFromPage(i);

                    s = s.replaceAll("\\\\", " ");
                    tv.setText(s);
                    tv2.setText("Page no." + i);

                } else if (i &gt; numberOfPages) {
                    Toast.makeText(PDFView.this, "Already at last page",
                            Toast.LENGTH_SHORT).show();
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }


public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pdf_view);
        tv = (TextView) findViewById(R.id.TextView01);
        tv2 = (TextView) findViewById(R.id.TextView02);
        Bundle extras = getIntent().getExtras();

        fileName = extras.getString("fileName");

        System.out.println("@@@@!!!" + fileName);

        try {
            reader = new PdfReader(fileName);
            numberOfPages = reader.getNumberOfPages();
            System.out.println("This document contains:" + numberOfPages);
            extractor = new PdfTextExtractor(reader);
            nextPage();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
</code></pre>
