Multi-page PDF to PNG

Hi All,

I'm using the following code (JScript) to convert a PDF to PNG, however I haven't been able to work out how to deal with multi-page PDFs.

```

// File Formats in PDF Creator: 0=PDF, 1=PNG, 2=JPG, 3=BMP, 4=PCX, 5=TIFF, 6=PS, 7= EPS, 8=ASCII
var pdfCreator = new ActiveXObject("PDFCreator.clsPDFCreator");
pdfCreator.cStart("/NoProcessingAtStartup");
pdfCreator.cConvertFile(
    "C:\\PDF2PNG\\1.pdf",
    "C:\\PDF2PNG\\1.png",
    1
);
pdfCreator.cClose();

<p>&quot;1.pdf&quot; actually contains 3 pages, however the output from the cConvertFile() call is a single PNG which only contains page 1. Can anybody explain to me how to dump the other 2 pages to PNG also?</p><p>Cheers,</p><p>Chris.</p>

Hi All,

As always, after playing with it a little longer I worked it out. If you set the following option to 1 (true) then you get an image file per page.

```

pdfCreator.cOption("OnePagePerFile") = 1;

</p><p>This is what my code now looks like:</p>

// File Formats in PDF Creator: 0=PDF, 1=PNG, 2=JPG, 3=BMP, 4=PCX, 5=TIFF, 6=PS, 7= EPS, 8=ASCII
var pdfCreator = new ActiveXObject("PDFCreator.clsPDFCreator");
pdfCreator.cStart("/NoProcessingAtStartup");

// NEW LINE ADDED BELOW
pdfCreator.cOption("OnePagePerFile") = 1;
// -----

pdfCreator.cConvertFile(
"C:\\PDF2PNG\\1.pdf",
"C:\\PDF2PNG\\1.png",
1
);
pdfCreator.cClose();

<p>Cheers,</p><p>Chris.</p>