I know only Javascript and would like to convert a large numbers of scanned documents into layers to mount on white a4 canvas

I have got more than 400 scanned documents of A4 size. But they are not of uniform size. Luckily they are all of 300 dpi.They were created on a scanner. When opened in photoshop they contain random patches that are transparencies, although there seems to be no difficulty viewing themon adobe reader.
My laptop had "Gb RAM and does not accept CS4 I have Photoshop CS3. My javascript and photoshop are both limited to basic skills.
I would like to mount each document on a white A4 sized photoshop background of300dpi, as a layer, flatten it out and save as the desired page.
As this is rather time-consuming, I would like to have a script that will perform this task, on a single file.
I would like to manually run this script on each file.
If possible I would additionally like to  put the individual pages in a folder and run the script repetetively on all files in the folder.
Any suggestions or held will be gratefully appreciated
thanks, peter

This has now been modified for single page PDF's.....
#target Photoshop
app.bringToFront;
function main(){
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder == null) return;
var startRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
var pdfOpenOptions = new PDFOpenOptions();
pdfOpenOptions.antialias = false;
pdfOpenOptions.suppressWarnings = true;
pdfOpenOptions.usePageNumber = true;
pdfOpenOptions.mode = OpenDocumentMode.RGB;
pdfOpenOptions.page = 1;
var fileList = inFolder.getFiles(/\.(pdf)$/i);
var FillColour = new SolidColor;
FillColour.rgb.hexValue = 'ffffff';
app.backgroundColor= FillColour;
var outfolder = new Folder(decodeURI(inFolder) + "/Edited");
if (outfolder.exists == false) outfolder.create();
for(var a = 0 ;a < fileList.length; a++){
if(fileList[a] instanceof File){
var file= open(fileList[a],pdfOpenOptions);
var doc = activeDocument;
doc.flatten();
var docname = fileList[a].name.match(/(.*)\.[^\.]+$/)[1];
if(doc.resolution != 300) doc.resizeImage(undefined,undefined,300,ResampleMethod.NONE );
if(doc.width.value > doc.height.value){
app.activeDocument.resizeCanvas(3508, 2480, AnchorPosition.MIDDLECENTER);
}else{
  app.activeDocument.resizeCanvas(2480, 3508, AnchorPosition.MIDDLECENTER);
var saveFile = new File(decodeURI(outfolder) + "/" + docname + ".jpg");
SaveJPEG(saveFile, 8);
activeDocument.close(SaveOptions.DONOTSAVECHANGES) ;
app.preferences.rulerUnits = startRulerUnits;
main();
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality; //1-12
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);

Similar Messages

  • Hi Can anyone please tell me from where I cn download the Photoshop CS6 program I purchased a download (media less) some 2 years ago and all has been OK up to know but I am know having issues and would like to uninstall and reinstall. I have the revelant

    Hi Can anyone please tell me from where I can download the Photoshop CS6 program I purchased a download (media less) some 2 years ago and all has been OK up to know but I am know having issues and would like to uninstall and reinstall. I have the relevant codes and activation keys but would need to be sure I can obtain the program again before I start. Thank you

    Make sure you are dealing with the correct product for the serial number.  If the serial number is for a full creative suite then you need to get the suite, not the individual application, and vice versa.
    Unrelated to that, in case it helps, here is a link to another site.  You can download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • I have been sent a .pages document and would like to extract the photos included in the document as jpegs (need to edit on photoshop and put back in), is this possible? can't figure out how to do it.

    I have been sent a .pages document and would like to extract the photos included in the document as jpegs (need to edit on photoshop and put back in), is this possible? can't figure out how to do it.

    I'm going to answer my own question:
    Easy steps
    Locate the document in the Finder.
    Control/Right-Click on its icon.
    Select Show Package Contents
    All images and embedded objects appear in ‘Data’ folder
    From this blog
    http://vernonchan.com/2013/10/how-to-extract-images-from-apple-pages-5-0-documen t/

  • I have a Canon 6d and would like to convert my raw ( CR2) photo's into dng files. Adobe DNG converter 8.4 doesn't recognise the CR2 files. How can i solve this?

    i have a Canon 6d and would like to convert my raw ( CR2) photo's into dng files. Adobe DNG converter 8.4 doesn't recognise the CR2 files. How can i solve this?

    It is possible that you are not following instructions correctly in the DNG converter. The DNG converter interface asks for the FOLDER that contains your raw images. Choose the folder, but don't open it. After you have chosen the folder, click on the Convert button. The DNG conversion process should start.  Does that help you?

  • I have two FormCentral accounts and would like to move a large number of my forms from one account to the other without having to recreate them.  Is there an easy way to do this?

    I do know that I can Export either the design Form OR the Responses then Import them into my other account but I don't see a way to export the entire Form WITH the Responses.
    Thanks!

    Hi
    Please see this FAQ on how to export/import your forms from one account to another account:
    https://forums.adobe.com/docs/DOC-1390
    Thanks,
    Lucia

  • While using comcast email, my fonts got smaller and would like to make it larger?

    I was moving my mouse while using my email, all of a sudden the screen zoomed out, and then again; making the fonts very small to read. This did not change any other web site, just comcast email. If I use internet explorer, for my comcast email, I have no problem.

    I was moving my mouse while using my email, all of a sudden the screen zoomed out, and then again; making the fonts very small to read. This did not change any other web site, just comcast email. If I use internet explorer, for my comcast email, I have no problem.

  • I have some old slide photo and would like to put them on a disc. How do I do it?

    I have some old slide photos and would like to convert them to a slideshow how do I do it?

    Well...you have some choices. You can take the slides to a photo/camera shop and they can transfer them to a DVD. Or...you can purchase a slide veiwer like I did and while viewing slide, take its picture with a steady mounted digital camera. Then you can load them into you computer and make the slide show and then burn them to a DVD.
    Kinda complicated but it worked for me. My slide viewer was only $29 and blew the slide up to 8"x8".
    There may be a few folks on this forum who will suggest less complicated methods. I hope so.
    Luck...virg

  • I'm a beginner and would like to know which Photoshop to use (so many options). The only edits I care about being able to do are: whitening teeth, smoothing complexions/taking away blemishes.  Does any photoshop have these options? I haven't been able to

    I'm a beginner and would like to know which Photoshop to use (so many options). The only edits I care about being able to do are: whitening teeth, smoothing complexions/taking away blemishes.  Does any photoshop have these options? I haven't been able to find the teeth whitening one anywhere. Also, I don't want it to lessen the high quality if my photos.  Thank you so much!!

    Hi Erika,
    I came to Lightroom quite recently (in the last month!)  from Photoshop Elements 11. I like the organization features in LR better, but for adjustments such as the ones that you mentioned I would leave LR and go back to Photoshop Elements 11, primarily because that is what I know. I don't use the subscription service, mainly because I already owned and installed the boxed version of Photoshop Elements 11 and adding it to a subscription service with Lightroom seemed redundant. I am sure someone in the community will (or has) comment(ed) that it is possible to whiten teeth and cure blemishes within LR, but I haven't figured out how to do that yet. Check out the TV Adobe free tutorials, particularly Julianne Kost's tutorials. She has a good presentation style and you might find the LR answer that you need with detailed instructions.

  • Where are the actual Aperture files located? Only in the application? I am transitioning to Lightroom and would like to only move some of the files. Advice appreciated. Also anyone know how to transfer in with edits?

    Where are the actual Aperture files located? Only in the application? I am transitioning to Lightroom and would like to only move some of the files. Advice appreciated. Also anyone know how to transfer in with edits? Using iMac, OS X, most recent Aperture and Lightroom 5.7 with plugin for Aperture.

    Define "the Aperture files".
    Read this concise guide.
    The files you imported into an Aperture Library can be exported (at any time, and repeatedly) using the command "File ▹ Export ▹ Originals".  Your Originals are never altered.  What went in is what comes out.
    Adjustments and changes to the metadata that you made since creating an Image in Aperture by importing a file are saved to a text file.  This file is combined, on-the-fly, with the Original to create the Image that you see in Aperture.  There is no file saved to disk that is the full-size Image.  Thumbnails are saved, and Previews are saved.  These are JPG files, almost always smaller than the Original.  They are not substitutes for the Image for the use you have.
    When you need a file of an Image to use in another program, you export the Image from Aperture.  "Export" means "Make me a file of this Image according to these file specs I'm providing".  The way to get files of your adjusted Images is simple:  create them by exporting.  Specify "Original size", and use a loss-less image-file format (e.g. TIFF 16-bit) if you want to retain as much visual information as possible.
    Search the Web for information about transitioning from Aperture to Lightroom.  Note that I say "transitioning".  You cannot move a database from one format to another without significant changes, and likely some loss of information.  Adobe provides a tool and some instructions.  I strongly recommend working out the process step-by-step, and then proceeding with first a few Images, then a bushel-ful, and stopping to use the first few, the the bushel-ful, before committing your entire collection to the process.
    As always, never use any computer file without having a back-up.
    We have seen mixed reports here of the success of the LR tool that creates a LR database from your Aperture database.
    If you want to carefully define the process, and test and refine it, use the excellent process-development, analysis, and execution program inShort.
    Sadly, there is not and can never be a good, thorough re-positioning of the digital assets in your Aperture Library to become digital assets in a LR database.  Just as a metaphor for any user contemplating transitioning to another digital asset manager:  that would be like digging up a house in one country, planting it in a hole in another country, and expecting to be able to use the toilet and the sinks, turn on the lights, cook dinner, and sleep soundly.
    HTH,
    Kirby.

  • We are getting ready to purchase the new iMac 27" and would like to know which is best for watching streaming video, the fusion drive or the more expensive flash drive only

    We are getting ready to purchase the new imac 27" and would like to know which is the best configuration for watching streaming video, the fusion drive or the more expensive flash drive.  We will have a fast fiberoptic internet connection.

    the harddisk speed mean nothing when it comes to streaming video from the internet
    even the fastests internet using fiberoptics is still much slower then the slowests harddisk you can buy

  • I have an unlocked iphone 4s bought from apple. Will be in London and Paris and would like to know if how I can purchase a data plan while on vacaqtion

    I have an unlocked iphone 4s bought from apple. Will be in London and Paris and would like to know if how I can purchase a data plan while on vacaqtion

    Can I still use the phone in Boston when I move there?
    Only on a supported GSM carrier.
    Will there be networks I cant use?
    Yes. CDMA networks.
    As I understand it the 4S supports GSM and CDMA networks worldwide.
    No, you've misunderstood. The GSM iPhone you can buy in Ireland supports GSM networks only i.e. AT&T

  • I have a late 2008 Mac Book Pro and would like to upgrade to 8G, any suggestions on a brand?  I can only find Ramjet or Cruical for the upgrade and there is a $30 difference in price.

    I ahve a late 2008 Mac Book Pro and would like to upgrade the memory to 8g.  I can only find 2 options Crucial and Ramjet.  There is a $40 difference in the cost.  Does anyone know if one is better than the other?

    I have gotten my RAM from either Crucial or Macsales. They are both excellent.

  • I found someone's ipod touch at a walmart in my area, and would like to know how to find this person? There is a passcode lock on it.

    I found someone's ipod touch at a walmart in my area, and would like to know if there is any way to locate this person? The ipod is locked.

    The only other thing you can do is to take the iPod to a place with unsecured wi-fi (like a starbucks) or temporarily turn off the security on your own wi-fi router (be sure that all your wi-fi devices are turned off when do this).  On the off chance that the owner has activiated the iCloud Find My iPod service s/he could send you a message on how to contact him.  Most people forget to set this up, so a contact is unlikely; but it is possible.

  • I Am from Brasil and december last year i bought a non contract iphone in usa but it still locked, now apple is sending non contract unlocked iphone, next week i am going to usa and would like to know if it is possible to pay and unlock my iphone in usa

    I Am from Brasil and december last year i bought a non contract iphone in usa but it still locked, now apple is sending non contract unlocked iphone, next week i am going to usa and would like to know if it is possible to pay and unlock my iphone in usa

    A no-contract sales price does not mean unlocked.
    Apple is now selling an officially unlocked iPhone in the U.S. which has nothing whatsoever to do with AT&T unlocking iPhones. It is up to the carrier and the carrier only to officially unlock an iPhone that was sold as carrier locked with the carrier - in this case sold as carrier locked with AT&T. This may change one day, but at the present time AT&T does not unlock an iPhone for any reason or under any circumstances.

  • I have an Ipad 2 and would like to know how faceTime works

    I have an Ipad 2 and would like to know how faceTime works on this device?

    open app and sign in or open settings and sign in.   only works between apple devises with ios 5 or newer or the latest version of snow leopard.  advantages over skype is much more reliable.

Maybe you are looking for

  • Migrating JHeadstart 10.1.2 Application to 10.1.3 doesn't work in JDev1013

    Just for your information: Migrating JHeadstart 10.1.2 Application to 10.1.3.3.0, JHS version 10.1.3.2.52 didn't work. I used the release notes but got stuck at step no. five. The function "Edit Application Definition" was greyed out. Actually, it di

  • Not able to access the Lynksys WRT54GL router

    Hi, This is Vijay here. Few months back i had upgraded my Lynksys router with Coova AP firmware. Everything was working fine. I had configured the AAA server on CoovaAP and was able to access the internet.I had configured the user name and password a

  • Dbms_lob.erase

    Hi all I am using dbms_lob.erase to delete part of data in my Clob My question is does dbms_lob.erase also free up the space allocated by previous content of my clob? If not is there someway to do it? After .erase i want to populate clob with differe

  • Hide parents in a parent-child hierarchy with dynamic rights

    Hi all, I'm facing the following issue with dynamic rights on a parent-child hierarchy: scenario: - a cube with a company parent-child hierarcy - dynamic security on through a role on dimension data based on a list with user (login names) and their d

  • File transfer via socket problem (with source code)

    I have a problem with this simple client/server filetransfer program. When I run it, only half the file is transfered via the net? Can someone point out to me why this is happening? Client: import java.net.*; import java.io.*;      public class Clien