title: PDFrenderer setting scale to screen
body: <p>Im using the code below to render a pdf. This is in a try/catch and works well, showing the pdf. </p>
  
  <p>The problem is that the pdf file is too big for the screen. Does anyone know how to scale it down to fit please?</p>
  
  <p>Thank you.</p>
  
  <pre><code>        imageView = (ImageView) findViewById(R.id.imagePDF);
  
          int REQ_WIDTH = imageView.getWidth();
          int REQ_HEIGHT = imageView.getHeight();
  
          Display display = getWindowManager().getDefaultDisplay();
          Point size = new Point();
          display.getSize(size);
          int width12 = size.x;
          int height12 = size.y;
  
          Bitmap bitmap = Bitmap.createBitmap(width12, height12, Bitmap.Config.ARGB_4444);
  
          File file = new File("/sdcard/Download/sample.pdf");
  
  
          PdfRenderer renderer = new PdfRenderer(ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY));
  
          if (currentPage &lt; 0) {
              currentPage = 0;
          } else if (currentPage &gt; renderer.getPageCount()) {
              currentPage = renderer.getPageCount();
          }
  
          int pages;
  
          pages = renderer.getPageCount();
  
          Matrix m = imageView.getImageMatrix();
  
          Rect rect = new Rect(0, 0, width12, height12);
  
          renderer.openPage(currentPage).render(bitmap, rect, m, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
  
          imageView.setImageMatrix(m);
          imageView.setImageBitmap(bitmap);
          imageView.invalidate();
  </code></pre>