[reportlab-users] Large images in PDF cause viewing error

Robin Becker robin at reportlab.com
Thu Jul 29 05:23:13 EDT 2010

On 28/07/2010 19:25, Brenner, Aaron L wrote:

> Hi all,


> I'm creating PDFs from jpegs using Reportlab Toolkit. The PDF documents are created by first down-sampling large TIFF files to 200ppi jpegs (using ImageMagick), and then using Reportlab to assemble them into PDF, adding a visible text annotation above each image. The size of each canvas object varies depending on the size of the source image, plus the space required for the text annotation.


> These PDFs all open fine when viewing with the Acrobat Reader application (9.3.2), but some of the PDFs return an error message and a blank first page when viewed through a web browser using the Acrobat PDF Plug-In. The errors all seem to occur when the first page image is rather large, e.g. over 50" in one dimension (that's calculated at 72 or 96ppi?). Errors are consistent with different browsers (presumably using the same plug-in, however).


> I've tried to investigate this problem online and am having trouble getting information. I suspect that the plug-in is trying to display the first page before it has completed loading. Is there a configuration option, or options, available when creating the PDF in Reportlab, that could address this behavior? I notice, for example, when viewing document properties in Acrobat that "Fast Web View" is not enabled. Adobe seems to recommend using Fast Web View for PDFs larger than 4MB [http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS58a04a822e3e50102bd615109794195ff-7f52.w.html] Is there a method to enable this in the reportlab toolkit?


> Any other thoughts or suggestions are appreciated.


> Example file that causes plug-in error (12.55MB) is here:

> http://digital.library.pitt.edu/u/ulsmanuscripts/pdf/31735051654782.pdf

Aaron, I've just tried using that URL in firefox, chrome & Win XP IE 8 and
although the download is clearly taking a long time I am seeing the images (they
appear to be plans of a building (Church?)).

My colleague tried this in windows 7 IE 8 and got a message saying there's an
error with that page, but the pictures did show up.

Another colleague was able to download and display in evince, but he wasn't
using a plugin.

It is possible that the large download is timing out for some folks and the
plugin is unable to reach completion of even the first page before the
connection disappears.


> Thanks,


> Aaron Brenner

> --

> Coordinator, Digital Research Library

> University Library System

> University of Pittsburgh

> 7500 Thomas Blvd., Room 306

> Pittsburgh, PA 15260


> Phone: 412.244.7526

> Fax: 412.244.7537


Robin Becker

More information about the reportlab-users mailing list