Re: getting a page from a PDF with core
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <CAGNS0RuNMS92OrWk4MWSOUSvGuZ3hEzDoP2d1f+kFPgsUjrawQ@mail.gmail.com> |
Hi Bob, thank you very much for the help, it's working well. On 17 April 2016 at 17:37, Bob Friesenhahn <[email protected]> wrote: >> 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 You'll be astonished to hear that IM has deprecated these fields in favour of "scene" and "number_scenes". You need to set the string version of "scene" as well, I'm not sure why. Summary in case anyone else ever asks: GM needs image_info->subimage = page number, as an unsigned long; image_info->subrange = number of ranges, as an unsigned long; IM needs read->image_info->scene = page number, as a size_t; read->image_info->number_scenes = number of pages, as a size_t; char page[256]; snprintf( page, 256, "%zd", read->image_info->scene ); read->image_info->scenes = strdup( page ); John ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z