Re: [GM-help] getting a page from a PDF with core
Swiss army knife of image processing
Brought to you by:
bfriesen
|
From: Bob F. <bfr...@si...> - 2016-04-17 16:38:05
|
On Sun, 17 Apr 2016, jc...@gm... wrote: > Hi all, > > I'd like to open a PDF (or some other multi-page image type) with Core > and get a specific page. I can append a [number] to the filename, of > course, but I'd like to be able to do this with a memory buffer as > well, where no filename is around, and it would "feel" better to do it > with an int rather than setting a string. > > I found the ->scene member, which seems to be what Wand uses, but I > can't get it to work. This test program seems to always render the > whole PDF and then pick out page zero: What you are wanting is 'subimage' and 'subrange' in ImageInfo. These need to be specified in the image_info struct which is passed to ReadImage. subimage - Starting image scene ID to select subrange - Span of image scene IDs (from starting scene) to select I can't answer if ImageMagick still supports this interface. In GraphicsMagick, the rather obtuse SetImageInfo() function sets these values based on what it finds in the image->filename field. Bob -- Bob Friesenhahn bfr...@si..., http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ |