From 636652daee46a9cf9836746135e3f9678db796ec Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 7 May 2012 11:30:05 +0100 Subject: Switch to reading content streams on the fly during interpretation. Previously, before interpreting a pages content stream we would load it entirely into a buffer. Then we would interpret that buffer. This has a cost in memory use. Here, we update the code to read from a stream on the fly. This has required changes in various different parts of the code. Firstly, we have removed all use of the FILE lock - as stream reads can now safely be interrupted by resource (or object) reads from elsewhere in the file, the file lock becomes a very hard thing to maintain, and doesn't actually benefit us at all. The choices were to either use a recursive lock, or to remove it entirely; I opted for the latter. The file lock enum value remains as a placeholder for future use in extendable data streams. Secondly, we add a new 'concat' filter that concatenates a series of streams together into one, optionally putting whitespace between each stream (as the pdf parser requires this). Finally, we change page/xobject/pattern content streams to work on the fly, but we leave type3 glyphs using buffers (as presumably these will be run repeatedly). --- pdf/pdf_outline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pdf/pdf_outline.c') diff --git a/pdf/pdf_outline.c b/pdf/pdf_outline.c index d4bea75a..e88d613d 100644 --- a/pdf/pdf_outline.c +++ b/pdf/pdf_outline.c @@ -65,7 +65,7 @@ pdf_load_outline(pdf_document *xref) obj = pdf_dict_gets(root, "Outlines"); first = pdf_dict_gets(obj, "First"); if (first) - return pdf_load_outline_imp(xref, first); + return pdf_load_outline_imp(xref, first); return NULL; } -- cgit v1.2.3