[poppler] Slow rendering of file with Type3 fonts

Brad Hards bradh at frogmouth.net
Sat Dec 22 15:22:47 PST 2007


On Wednesday 19 December 2007 09:54:33 pm Jiri Klement wrote:
> Hi,
G'day Jiri,

> I've investigated a bit more and here are the results. So far it seems
> that poppler code is correct. Problem is in pdf file, which declares
> much bigger FontBBox than it actualy needs.
>
> It can be made much faster by using bounding box specified by d1
> command instead of \FontBBox. But I'm not sure if caching of font
> glyphs is neccessary. When I disabled it (by commenting out
> SplashOutputDev::type3D1) the pdf file is shown instantly. Even in
> valgrind emulation it runs quite fast.
Thanks for this investigation. 

> I can try to write a patch, but I'm not sure which way use to fix this.
I'm not sure either - not familiar with this type of font handling at all 
(which I'm sure you remember from our work on XPS :-)

There are really two conceptual alternatives here:
1. Try to optimise this case, and risk breaking other files.
2. Live with this file (and others like it) being really slow.

The choice depends on how common this "fault" is in PDF files. We always want 
to go faster.

Also, Poppler tracks changes in the "upstream" XPdf code. So a patch that is 
fairly self-contained (perhaps introduces a few new methods, and some calls 
to them) is much more acceptable than a really invasive patch (especially one 
that re-arranges code).

I can only suggest that you have a go at the patch - whatever makes most sense 
to you - and post it to the poppler mailing list for wider review.

Brad


More information about the poppler mailing list