0

I'm using GhostScriptSharp to generate images from PDF documents. It works for single pages, but what I'm after is getting it to generate one image from the whole document.

Here's my code:

GhostscriptWrapper.GenerateOutput(sourcePdfFilePath, destinationPngFilePath,
    new GhostscriptSettings
    {
        Device = GhostscriptDevices.pngalpha,
        Page = new GhostscriptPages
        {
            AllPages = true
        },
        Resolution = new Size
        {
            Height = 72,
            Width = 72
        },
        Size = new GhostscriptPageSize
        {
            Native = GhostscriptPageSizes.a4
        }
    }
);
Phil
  • 141
  • 2
  • 7

1 Answers1

0

You need to do 'imposition' or 'n-up'. There's no provision for this as standard, you can do it, but you need to do some PostScript programming, and since the input is PDF that's going to make it trickier. You might be better advised to use a tool intended to do PDF imposition.

BTW how do you plan to get one image from a (for example) 1000 page document ? If that seems extreme, I've seen PDF files with more than 64k pages in them....

KenS
  • 29,155
  • 3
  • 33
  • 48
  • Hi Ken, I know that the documents in this situation will be between 1 and 3 pages long, so it would never get too crazy. I'll have a look around for an alternative though. – Phil Jan 09 '17 at 17:33