title: PDF rendering with white lines on top/bottom, left/right edges
body: <p>I'm using the (excellent) <a href="https://github.com/vfr/Reader" rel="nofollow noreferrer">vfr-reader</a> in several iOS applications. It works like a charm, but I'm having problems with the rendering of some PDF files.</p>
  
  <p>In VFR-Reader, I'm seeing white lines at the top and bottom, and/or left and right edges, which is very annoying with full-page photos. </p>
  
  <p>They appear in the rendered page and the page thumbnails in the ThumbsViewController:</p>
  
  <p><img src="https://i.stack.imgur.com/41dB0.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/qjmMw.jpg" alt="Page Thumbnails with White Lines on Left and Right Edge"></p>
  
  <p>The white lines become (a little) bigger when zooming in:</p>
  
  <p>(bottom edge, though difficult to see against the white page background) </p>
  
  <p><img src="https://i.stack.imgur.com/wozFY.jpg" alt="zoomed in"></p>
  
  <p>and I can change their color by modifying</p>
  
  <pre><code>CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White
  </code></pre>
  
  <p>in ReaderContentPage.m / drawLayer.</p>
  
  <p>I naively tried to set the RGBFillColor to black, but then all text pages (usually on white background) in the PDF would appear all black as well.</p>
  
  <p>I assume the problem lies in some aspect ratio/PDF page dimensions, that for some reason do not perfectly fill the drawing area, so the white background color "bleeds" out.</p>
  
  <p>The PDFs themselves seem fine, they render perfectly (without white lines) in Safari and GoodReader. </p>
  
  <p>I'd appreciate any hint how to fix this, or the general direction I should be investigating.</p>