[poppler] [PATCH] GLib method to read a PDF from memory

Jeff Muizelaar jeff at infidigm.net
Thu Dec 28 13:27:12 PST 2006


On Wed, Dec 20, 2006 at 04:05:49PM -0800, Brad Taylor wrote:
> > Is there any reason the GlobalParams and password stuff can't be moved
> > into the common function?
> 
> With GlobalParams, I didn't know enough about the internals to safely
> say that running those lines _after_ the creating a new PDFDoc wouldn't
> screw anything up.  Say the word and I'll add it, but I just wanted to
> make sure that I was reading this all correctly.
> 
> As far as the password, I don't see how this can be moved to the common
> function, since its required when new_from_file and new_from_data each
> construct their own PDFDoc objects.

Yeah, I guess both of these are hard to move. It might be interesting to
see a common pre-function. e.g. Don't know whether it is worth it or not
though.

new_from_data() {
	pre();
	construct pdf doc;
	new_from_pdf_doc();
}

> 
> > Also, I don't see any reason for the start parameter. I'd imagine most
> > users would pass in zero. If the user wants to start at a different
> > place, I think it makes sense for them to do the pointer addition
> > themselves.
> 
> The only reason that I added that parameter is that MemStream required
> it, so I figured it might be useful to someone.

I think api cleanliness is more important. If someone can construct a
usecase for it, or any other justification then maybe we could keep it,
otherwise it should go.

-Jeff


More information about the poppler mailing list