Need a script to output the first page as a resized jpg

Does anyone know of a script where I can output the front cover/first page of an indesign document as a tiny jpeg thumbnail?  Easy enough to do manually but a script would save so much time.

Try this,
var doc = app.activeDocument; 
    w = doc.documentPreferences.pageWidth;
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.pixels;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.pixels;
app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
app.jpegExportPreferences.exportResolution = 300/w*72;
app.jpegExportPreferences.pageString = doc.pages[0].name; 
doc.exportFile(ExportFormat.JPG, new File(doc.fullName.toString().replace(/\.indd$/i,".jpg")), false);
Regards,
Chinna

Similar Messages

  • Extracting the first page from all pdf's in a folder and save them to a new file

    Hi,
    As Bridge apparantly is unable to create a decent-looking PDF from a bunch of other PDF's, we're looking for alternative solutions. The problem is, that I haven't done much scripting in Acrobat.
    Pseudocode:
    Select Folder where PDF files are stored
    Create list of PDF files
    Get first page from each and add it to temporary new PDF
    Save temporary new PDF in high quality
    Would that be possible in Acrobat? And where would I start? I can't even find a Scripting Guide for Acrobat (like the ones for Illustrator and InDesign).. and there seems to be no sample scripts included either :-(
    Thanks,
    Thomas

    This can be done using a combination of an Action and a script. The script in the Action will collect the paths of the files you want to process and the folder-level script will extract the first page from each file and generate a new PDF from it. You don't need a plugin for this task, so you don't really need the SDK.
    The Acrobat JavaScript Reference can be found here: http://www.adobe.com/devnet/acrobat/javascript.html

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • I need a 3-inch top margin on the first page of my letter and a 1-inch top margin on subsequent pages. How can I do this?

    This is so easy in Word but I have spent 2 hours trying to figure it out in Pages. To print on my boss' stationary I need a 3-inch margin on the first page and a 1-inch top margin on the subsequent pages. When I change the top margin on page 2 in Inspector, it changes the top margin on page 1 to 1-inch as well. In Word this is an intuitive, 2-step process.

    Hi Dan,
    Don't confuse "intuitive" with "what I'm used to."
    Pages has "Document" margins, which apply to all pages of the document, and "Layout" margins, which may be set to provide additional margin space in a layout.
    Start by setting the Document margins to 1" all around. This is the default setting for the (word processor) Blank templates. You can check it (and adjust it if necessary) in the Inspector. Open an Inspector window (View > Show Inspector). Choose the Document Inspector (first button).
    Switch to the Layout Inspector (second button). Remember that you already have a 1 inch top margin, so to produce a 3 inch margin before the beginning of this layout, you'll need to set a 2 inch Layout margin "Before" the layout.
    Hmmm... Depending what you're defining as 'steps' for the process in word, and considering that the document margins in Numbers are preset to 1" all around, this appears to be a 1-step process in Numbers:
    Step 1: Set the "Before" Layout margin to 2 inches.
    Done.
    Regards,
    Barry

  • I need a section to display at the bottom of the first page of my report

    My report displays a number of records, but at the bottom of the first page of the report, I need a section (a remittance slip) that would only appear at the bottom of the first page.
    I've tried using a page footer with conditional suppression.  This is fine for the first page, but in subsequent pages, the footer space is reserved, so the records in my details section only go 2/3's of the page.  "Reserve minimum page footer" seems pretty useless.
    I've looked into using a details section that uses "Print at bottom of page".  But since my report contains groupings, this messes up my report structure and leaves a lot of extra space as well.
    I can't guarantee that a group footer section will always be on the first page, since it is found at the end of each group.
    Any suggestions?  Anything I'm missing?
    Thank you.

    hello plynch,
    i would use the method that Abhilash suggested.
    " I guess if we have a section (other than the Page Footer, perhaps another Details section) that is always suppressed except when the record count reaches x numbers and have it printed at the bottom, this could be achieved"
    if you
    1) create a new formula for every section that counts the height of the section...
    whileprintingrecords;
    numbervar lines:= lines + .2 
    //use the above for a details section that is .2 inches in height
    whileprintingrecords;
    numbervar lines:= lines + 2.2
    //use the above for a group header section that is 2.2 inches in height
    2) do the above for every section (yes it's painful but it works) and you'll see how the sections add to the running total
    3) create a new details section that is conditionally suppressed if the page is not equal to 1 and if the running total count is not within a certain height range
    4) make this new details section the height that you want the remittance slip and also have a New Page After forced for the section conditional on it being page 1
    the above takes a bit of finicky work but if it's worth getting rid of the blank space...
    cheers,
    jamie

  • I need a script to invert the page order of selected pages for cs5.

    Hello,
    I am a graphic designer and i am trying to create a easier way to make multiple page folders, By using the multiple page size feature in inDesign CS5. But my problem is that i can create the front side of the folder easier than before, the backside is my problem I need to inverse the page order manual, this creates a lot of mistakes and errors along the way. Thats why I need a script to invert the page order of the pages I select. I hope to hear from someone soon.
    My best regards,
    Gijs van Roij

    In /gateprd/ARCHIVE/*.arc
    This is the script to remove the archives after it has been backup by the netbackup policy named Archive. This policy removes the archives that have been backed up.
    /home/oracle/dba/scripts> more rmovarch.sh
    #!/bin/ksh
    # compress /gateprd/ARCHIVE/*.arc
    find /gateprd/ARCHIVE/*.arc -type f ! -exec echo {} > /home/oracl
    e/dba/lists/ARCHIVElist \;
    if test $(cat /home/oracle/dba/lists/ARCHIVElist|wc -l) -gt 0
    then
    echo "Hay archives. Se corre script de borrar"
    /home/oracle/dba/scripts/ARCHIVE_BACKUP.sh ARCHIVE
    else
    echo "No archives!!"
    fi

  • Creating a library and need the thumbnail to be the first page

    Hi all
    I have a large library of pdf files on a corporate network. When I open up the directory the view shows the generic .pdf thumnail for each document. I am looking for some way to have the view instead show the first page of the pdf which is typically a cover page. Any elegant ideas out there?
    Thanks!
    D

    In VISTA in get the 1st page in Win Explorer is I select the icon view. That sounds like what you want.

  • I need to secure a pdf so it cannot be edited, except for the first page.  Is this possible?

    Can you secure all but one page of a pdf?  I would like the first page to be able to be edited, but the rest of the document to be protected from editing, is this possible?  If so, how?
    c

    What do you mean by editing PDF? If you have a PDF form and want to make some form fields, in your case pages other than the first page, non-editable, you can lock the form fields on all pages other than first. You can write a JavaScript that does that, include it in the original PDF form and activate it at some point in time (like when a certain button is clicked, or certain form field gets focus). If you mean other ways of editing, like changing text on a page, you cannot protect only part of the document from that.

  • How to display PDF in slideshow, without returning to the first page or stall/halt on the last page?

    Hi,
    I want to display PDF's with multiple pages as a slideshow.
    This is possible with a default Adobe Reader and have this working for ONE pdf file.
    But I want do display multiple PDF's as a slideshow, the one after the other.
    In Adobe Reader you can define to return to the first page again or it automatically 'stalls/halts' at the last page.
    But I want Adobe Reader to close after the last page is displayed so it continues (in a simple DOS-script) with a second, third, etc. PDF to be displayed.
    Is this possible?
    What kind of simple DOS-script kan be used or an other reader/utility?
    Thanks in advance!
    Gunther

    Hi Bernd,
    I was looking for ways to script this kind of solution.
    But do not have good results.  There are tools to combine pdf's into one large pdf - but mostly to be selected by hand.
    We need it in a scriptable way to automate.
    Additionally, we want to be able to combine different types of documents to rotate as a slide show (so not only PDF's but also pictures or other output).
    If you or someone else have such scripts, it will be highly appreciated.
    Regards

  • No data found in report csv or pdf output on first page load

    No data found in report csv output on first page load. Report shows up on page, but no data found in csv or pdf output. I always need to submit the page and then it shows data in downloads. The page contains a form (read-only) with a report that references 4 page items by using something like the following:
    and b.employee_no = v('P5_EMPLOYEE_NO')
    and c.fisc_year_pk = v('P5_FISC_YEAR_PK')
    and b.job_class = v('P5_JOB_CLASS')
    and b.organization = v('P5_ORGANIZATION')
    Again, report in the page shows up except there is no data in downloads. Can anyone help me solve this problem? I'm running Oracle APEX 4.2.1 in Oracle database 11gR2.
    Thanks.

    Sounds like a classic session state issue.
    You need to populate you page items using page rendering computations to ensure they're set to session state.
    Or if the download is triggered from a button press, you need to ensure those page items are submitted to session state, perhaps via a PL/SQL action.
    Scott

  • Extracting the first page of multiple PDFs & saving them as jpegs.

    Dear all,
    First post - hope its in the right place.
    I work in Publishing, and I have been given the following task - I have about 400 ebooks, all in pdf format, and my task is to extract the cover from every one of them (which is the first page of every pdf) and export them all as separate jpeg files (file names can remain exactly the same - ie, the name of the pdf book will be the same as the jpeg file). So I will end up with 400 ebooks and 400 jpegs of their covers.
    Anyone have any idea how to do this ?
    i have Windows and acrobat 8
    I have looked at batch processing in acrobat, but the option to extract the first page of multiple pdf files is not one of the options. there is an option to create your own script which im guessing is my best bet ? (hence why i have posted my question here)  Though I don't have the first clue about this. Have done some google searches, and some people have created similar things, but I cant seem to get them to work.
    Any advice greatly appreciated.
    Cheers,
    Rich

    ok, i have found a set of acrobat batch sequence and come across the following :
    Batch sequence name: Extract Pages to Folder.sequ. Task: For each file from the selected files, extract each of its pages and save the extracted pages to a particular folder.
    Example 2.10 Insert navigation icons
    /* Extract Pages to Folder */
    // A regular expression to acquire the base name of the file.
    var re = /.*\/|\.pdf$/ig;
    var filename = this.path.replace(re,"");
    try
      for ( var i = 0; i < this.numPages; i++ )
      this.extractPages
      nStart: i,
      cPath: "/C/temp/myDocs/"+filename+"_"+i+".pdf" // change this });
    catch (e)
       console.println("Batch Aborted: " + e )
    looks like i need something like this, but tried the above earlier, and couldnt get it to work (prob cause I didnt replace the words exactly correctly). I am guessing that i am entering this in the correct place though (ie - create new sequence, and got into the script editor box)

  • Including image in SharePoint survey answer and hiding elements only work on the first page

    Hi All,
    I would like to add some text/remove some text etc on a sharepoint survey page.
       Which i have done using jquery/jscript.
    But unfortunately it only works on the first page.
    Any ideas how i can get it to work on all the pages?
    See a sample here on how you can add the scripts:
        http://sharepointkings.blogspot.com.au/2011/05/include-image-in-sharepoint-survey.html
    Cheers

    Hi Patrick, does the first page use the same ASPX file as the other pages? If not, you will need to add your jquery/jscript to the other page as well.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Unable to hide the first page in the form

    Hi ,
    I am trying to design a dynamic form that has three pages. The form is being used in a LiveCycle process and during the process initiation, only the second page should be visible and the first and third pages should be hidden. I am trying to hide the first and the third pages using JavaScript. I noticed that the third page is being hidden but the first page gets displayed as an empty page. Based on this behavior here are couple of questions I need guidance with
    Can we hide the first page within a form? If so why am I seeing this inconsistent behavior when hiding the first and third pages?
    If the first page can not be hidden then is there a workaround to achieve my goal of re-arranging the pages so that I can add content to the first page dynamically and shift the previous content on the first page to the second page?
    Any suggestions will be appreciated.
    Thanks,
    Samanthapudi

    Hi,
    You've originally said.
    in the first page i don't want data in main window...
    yet using a command node to trigger the next page means you have to include a (presumably) empty main window in the first page.
    Your main window has to contain some output (a table usually) and it's contents are the same on every page (only it's height can change).  So, you can't have a blank main window on page 1 and a main window with data on pages 2 and 3.
    Remove the main window from page 1, set page2 as the next page for page 1.
    As for how to trigger page 3 you'll need to provide more detail on what the condition is.  Do you want multiple copies of page 2 to hold all of the main window data, or just one?  Do you want one copy of page 2 then the rest of the data on multiple copies of page 3.  Be specific.
    Regards,
    Nick

  • Help Needed: InDesign Scripting: PDF Multiple Files and Pages Import

    I am looking for a script to merge two PDFs in InDesign CS3 (Mac or PC);
    with an interesting twist for print production.
    We have one PDF that is 408 pages. The second PDF is only one page.
    What we need to accomplish is importing the 408-page PDF file into InDesign,
    then inserting the second 1-page 408 times PDF AFTER every page of the first
    file.
    This will make a 816-page file, where every other page is the "generic" PDF.
    I've used PDFplacer.jsx and it does a great job of bringing in a PDF to
    InDesign. I'm hoping that there is another script to bring in the second
    1-page PDF and have it place this PDF after every page of the file.
    Does anyone know of a script that will accomplish this task?
    I'd also consider having this same scenario done in Acrobat, and then
    sending this new 816 page file to print, if there is any benefit to creating
    the file this way.
    Any help and suggestions would be greatly appreciated.
    Jim Lukens-Gable
    JHL4 at PSU.EDU

    Thanks, Robin,
    I am really a novice at scripting . . . would you be able to modify the script and then send it to me/post it here?
    Thank you!
    Jim L-G

  • How can I print only the first page of multiple PDF files at once in my PC?

    That is, without having to open each file individually.
    Thanks!

    Create an Action with the following JS command:
    this.print({bUI: false, nStart: 0});
    This will cause the first page of all the files you process with this Action to be sent to your default printer.
    If you need to specify more complex parameters, you'll need to use a more complex code...

Maybe you are looking for