These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Batch print first page to image not working in Acrobat 8 PRO

Vincenze
Registered: Sep 12 2010
Posts: 5
Answered

Hi Folks,

I've spent this morning trying to work out why this built in function isn't doing what it is suppose to do. I need to print the first page of a bunch of pdfs to images. The script says that's what it does but it always prints all the pages.

I've been racking my brains (based on what I've read so far it seems this should work), I've changed parameter values, added start 0 end 1. When I make b.silent false the print box even says 1 page...
but it doesn't work for me. Any ideas?

/* Print 1st Page */
/* This sequence prints the first page of
each document selected to the default printer.
*/
this.print
({
bUI: false,
nStart: 0,
bSilent: true,
bShrinkToFit: true
});

Thanks in advance,
Phil.

ps Thread moved from here:
http://acrobatusers.com/forums/aucbb/viewtopic.php?id=2934

My Product Information:
Acrobat Pro 8.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You need to specify the nEnd parameter, as mentioned in that other thread. Set it to the same as nStart. For more information on the doc.print method, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.511.php
Vincenze
Registered: Sep 12 2010
Posts: 5
I've tried that previously (and just did it again to be sure), and it didn't work. It still prints all the pages.

I tried setting both nStart and nEnd to 0 and 1.

It also says in that doco that it should just print one page if nEnd isn't specified.

I'm wondering if it could be specific to the computer I am using or version of acrobat, I'll try it on another machine.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Vincenze wrote:
It also says in that doco that it should just print one page if nEnd isn't specified.
So it does, sorry about that.

You mentioned that you want to print to images. What do you mean by that, exactly? Are you printing to paper or trying to create an image file of some sort? If the latter, what printer are you printing to?

FWIW, the code you posted works for me as intended both from the JavaScript console and in a batch sequence in Acrobat Pro 9. It even comes with a canned sequence that has that exact code.
Vincenze
Registered: Sep 12 2010
Posts: 5
Ok, I have downloaded Adobe Acrobsat 9 Pro, ran it again, it still prints all the pages to jpg.

/* Print 1st Page */
/* This sequence prints the first page of
each document selected to the default printer.
*/
this.print
({
bUI: false,
nStart: 0,
bSilent: true,
bShrinkToFit: true
});

Tried with nEnd:0, no difference.
Vincenze
Registered: Sep 12 2010
Posts: 5
I've just contacted support and low and behold they don't support the trial of version 9. So they expect me to purchase something I can't get to work and then they will help me get it to work. Sorry, and a bit of a rant but that is absurd.

It's quite possible I'm doing something wrong, but I have tried so many variations and I still can't get it to work. I really need this as I have 150 documents and the thought of manually ripping out the first pages is not a good one.

Weird since it works for George Johnson, any ideas George?

ps I just exported it to jpg under the options in the edit process.

Thanks for being patient,
V.
Vincenze
Registered: Sep 12 2010
Posts: 5
Downloaded this and did it manually:
http://www.tracker-software.com/product/pdf-xchange-viewer/download

Took me all day but I'm done.

Thanks for any feedback,
V.

CLOSED--
ask2sachin
Registered: Jan 19 2011
Posts: 2
Hey guys....just put below mentioned javascript in the script tab, and specify the page numbers....enjoy


this.extractPages(0, 0, "New.pdf");
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
The script description says it prints the firs page only.

> /* Print 1st Page */
> /* This sequence prints the first page of
> each document selected to the default printer.
> */No mention of "image".

If you want the 1st page printed as an image PDF, yo need to add the "bPrintAsImage" parameter with a value of 'true'.

If you want to extract the first page as a graphic image, then you need to extract the first page to a PDF and then convert the extracted PDF to an image file using the 'saveAs' method to conver the PDF file to a specified image file.

George Kaiser

ask2sachin
Registered: Jan 19 2011
Posts: 2
I tried so many script in adobe acrobat as well as tried the same
one which is included but its not workable at all....
but this script is workable...check it out

this.extractPages(0, 0, "New.pdf");