Save each page as PDF naming mod

I had an issue I needed help with a while back, now I need to mod the script.
Here's the original post
Peter Kahrel, ""Save each page as PDF" naming mod?" #1, 16 Jan 2008 8:00 am
I have a 456 page document that was made from a data merge. It has a background image, a foreground image and a job number/description.
I need to save each page out as a jpg and name the file with the contents of the "jobnumber" text box. Previously Peter Kahrel helped me out tremendously with a little function that looked at the job number (which was always PNXX-xxxx) and swapped it out with the real job number.
Now the contents of the jobnumber field isn't structured, i.e., "AvocadoSwirl_V", or "BurntSienna_G".
Is there a way to set a script label for the "jobnumber" text box and just name the output file whatever is in there?
Here is the existing script:
var destinationFolder = Folder.selectDialog ("Choose a Folder");
var myPDFExportPreset = app.pdfExportPresets.item("WebVidOverlay");
doc = app.activeDocument;
doc.sections.everyItem().includeSectionPrefix = false;
app.findTextPreferences = null;
app.findTextPreferences.findWhat = 'pnxx^9^9^9^9';
found = doc.findText();
for (i = 0; i < found.length; i++ )
f = File (destinationFolder + "/" + found[i].contents + '.pdf');
app.pdfExportPreferences.pageRange = found[i].parentTextFrames[0].parent.name;
doc.exportFile (ExportFormat.pdfType, f, false, myPDFExportPreset);
As always, Thanks a million,
Randy

>Does that sound do-able?
Most things are doable, provided that your information is precise: first you say that pages may or may not have a text frame labelled "jobnumber" and that that frame may or may not have text in it (your post can be read like that anyway). Now you say that every page has a text frame labelled "jobnumber" and that that frame can be filled with either of three text strings. Or maybe all three strings? You say
>then I should be able save each file with the names "Avocado.jpg", "Burnt Sienna.jpg" and "pnga-0431.jpg" respectively.
Or do you mean "save each file with the names "Avocado.jpg", "Burnt Sienna.jpg" _OR_ "pnga-0431.jpg" respectively."? The way you phrased it, it looks as if you want to save three files from a page. But your example shows that you meant "or", not "and".
But anyway, the last two lines of your example appear to make clear what you want. The attached script exports each page of the active document to JPG, using the contents of the text frame labelled "jobnumber" on that page. The script assumes that each page has such a text frame and that there is something in it, and that whatever is in it provides a legal file name. It doesn't do any error checking/catching at all.
Peter
app.jpegExportPreferences.resolution = 300;
app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
app.activeDocument.sections.everyItem().includeSectionPrefix = false;
path = app.activeDocument.filePath + '/';
p = app.activeDocument.pages.everyItem().getElements();
for (i = 0; i < p.length; i++)
  jpg_name = p[i].textFrames.item ('jobnumber').contents + '.jpg';
  app.jpegExportPreferences.pageString = p[i].name;
  app.activeDocument.exportFile (ExportFormat.jpg, File (path + jpg_name));

Similar Messages

  • Save Web page into PDF in Windows 7 32 bit for Adobe 7

    When security under Internet options in Internet Explorer runs with "Enable Protected Mode" checked, can not save web page into PDF. The version of Adobe is 7.
    Nazir

    Are you saying you cannot print to the Adobe PDF printer or what. You have to be more complete in your description since AA7 will not fully work in Win7. You will have to use workarounds, but knowing what steps you are using is important to giving any help. Just saying save does not help. Of course, you might be able to use the MS plugin for creating PDFs as an alternative if you only have AA7. One thing that you find with AA7 is that PDF Maker will likely not work and also the printer will have to be a print to file, followed with a use of Distiller to complete the PDF creation. The AA7 version of AcroTray that does a lot of the work in the background should not be expected to work with Win 7, thus the need for workarounds.

  • Save each page of a multi-page document as a separate file using spawned file names with javascript

    Hello
    We are currently changing our hard-copy personnel files and converting them to pdf files.  We have scanned the entire file into one multi-page document.
    I am wanting to save each page (or groups of pages) as separate files.
    In order to facilitate this, I have duplicated field names--such as FirstName, LastName, EmpNo on each page.  This information should be static for the entire file.
    However--I also need information that will change for each individual "page" or document--such as TypeOfDoc, Date, etc.  I have used the Spawn fields using the overlay method on each of the pages in the document.  Then I went in and filled in the information for each page of the document--such as TypeOfDoc, DateOfDoc.
    Now I want to save each page of the document as a separate file using the field names as the file name.
    I first created an action that would split all the pages into separate files and save them into a folder.
    Then I want to save each file as a specific file name based on the information in the fields.
    My problem is obtaining the name of the spawned field name.  The rest of the field names I am not having a problem with.
    This is what I have so far to name the file.
    // Get the field value
    var oPage = this.pageNum;
    var fn = getField("P" + oPage + ".TEMPLATE.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
    // Specify the folder
    var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
    // Determine the full path
    var fp = fldr + fn +".pdf";
    // Save the file
    myTrustedSpecialTaskFunc(this, fp);
    This code is also accompanied with folder level scripts.
    My problem is obtaining the name of the spawned fields using javascript.  Each document has several pages--so I would like to obtain the field name through script.
    I receive the following error.
    TypeError: getField("P" + oPage + ".TEMPLATE.DATE") is null
    I think this is due to the fact that I have extracted all the pages as individual files.
    If I were to do the above, but not extract the pages first--I do not know how to just save one page at a time.
    Please help.  This is a massive project, and if we have to save each file individually, it will take a lot of time.
    I am a beginner, so any assistance is appreciated.
    Thank you

    I am not understanding exactly where to put the curly brackets.  I have tried two different ways, and still get the same error.
    This is one way
    var oPage = this.pageNum;
    // Specify the folder
    var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
    // Determine the full path
    var fp = fldr + fn +".pdf";
    for (var i = 0; i < this.numPages; i++) 
    var fn = getField("P" + oPage + ".template.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
    {this.extractPages({  
    nStart: i,  
    cPath : fldr + fn + ".pdf"
    The other is this
    var oPage = this.pageNum;
    // Specify the folder
    var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
    // Determine the full path
    var fp = fldr + fn +".pdf";
    for (var i = 0; i < this.numPages; i++) 
    var fn = getField("P" + oPage + ".template.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
    this.extractPages({  
    nStart: i,  
    cPath : fldr + fn + ".pdf"
    Thank you for your help.

  • After mail merge in inDesign how do I save each page as a separate PDF

    Hi
    I have done a mail merge to get data on a form, now I need to split the doc so that each page is in a separate PDF doc. How do I do that?
    Thank you for any assistance that can be given.
    Regards,
    Andre

    http://indesignsecrets.com/split-up-data-merged-pdf-files-into-smaller-files.php

  • Portfolio pdf- why is text in different sizes on each page of pdf?

    Even though i have saved my images with text (always  font size 12) as the same size (eg. 10in x 10in at 100ppi),  each time i save the images as a pdf the pdf then has all different size text from image to image-  a complete mess as a portfolio.
    Also when i then changed the size of the image and saved it as a copy, both images and text stay the same size!  though both the ppi and scale differ in each images....
    How do i change this? any tips appreciated!

    You can't write directly in PDF from Output Module, only add a header or
    footer text but that will repeat itself each page.
    You could try so in an app like Word or if you have Pages or other design
    application it would be possible to make your own layout and text and from
    there save as PDF.
    You can also try in PS, just create a template frame (new file) big enough
    to paste the images in and with space around including more at the bottom
    where you add the text you want. On the frame put a text layer and the file
    layer for the image by either drag and drop or copy paste. Resize the image
    till it fits in the frame
    You cans resize the image on the template layer to fit in the frame as you
    like and save as new files.
    Now you have same sized frame with same ppi and font size.
    With this files selected in Bridge in the order you want choose Output
    Module with option for paper size, landscape or portrait, background color.
    Choose 1 column and 1 row including auto space, deselect filename and
    extension and also deselect header and footer if thy are not so already
    (unless you want some text and page numbers)
    I created the images in photoshop and then  i use the bridge adobe output
    module- the pdf is a multiple page document with one image per page which
    has text written beneath the image -
    as in  the image is saved with a frame with title/text.
    Is there a way of writing individual text directly onto each pdf page
    instead of the image? perhaps this will solve the issue of differing text
    sizes....?

  • I use iMac desktop. I can't save web pages as PDF file by using Firefox, but by Safari is fine.

    I'm using Mac OS X 10.6.4. Today, I tried to save my email content as a PDF file. However, I only got a PDF file that have partial content of email. Then I adjust the printer setting and did it again, then I only got a blank PDF file. There was nothing inside. Then I tried to save email as a PDF file by using Safari browser. And I got a complete and sucessful PDF file. I usually save web pages or web mail, online receipt as PDF file by use Firefox. But since I have updated to the new version, there were many problems with my Firefox. I tried to restore all my application and made Firefox in the old 3.6.3 version which I used to have no problem. But now still not working.

    I solved it for myself: it was my HP smart-web printer crap that was a plug in and add on for firefox that somehow automatically got installed when I upgraded to 5. I disabled both in the add-ons manager, and voila, printing is working.
    It seems there are many things, like this and the Google toolbar, that were screwed by the oddly fast update to 5. Looks like Mozilla didn't give anybody any notice! Must've been some really bad security hole.

  • I use iMac desktop. I can't save web pages to PDF file by using Firefox, but by Safari is fine.

    I'm using Mac OS X 10.6.4. Today, I tried to save my email content as a PDF file. However, I only got a PDF file that have partial content of email. Then I adjust the printer setting and did it again, then I only got a blank PDF file. There was nothing inside. Then I tried to save email as a PDF file by using Safari browser. And I got a complete and sucessful PDF file. I usually save web pages or web mail, online receipt as PDF file by use Firefox. But since I have updated to the new version, there were many problems with my Firefox. I tried to restore all my application and made Firefox in the old 3.6.3 version which I used to have no problem. But now still not working.
    ''Duplicate post, continue [https://support.mozilla.com/en-US/questions/746583 here]''

    hello jlzibell, please go through the troubleshooting steps described at [[Websites say cookies are blocked - Unblock them]].

  • How to repeat table header on each page of PDF using Coldfusion

    Hi all,
    Can anybody help me in resolving this issue. The details are mentioned below.
    I am generating PDF using <cfdocument> tag of Cold Fusion.
    I have a header and footer to be displayed on each page. I am rendering data in a table.
    If rows in the table exceed a page , and continue on the next page , I want the table headers to be repeated on each of the page.
    Example :
    Currently this is happening:
    Page Header
    Sr No
    Name
    Occupation
    1
    A
    A
    2
    B
    B
    3
    C
    C
    Page Footer : Page No 1
    Page Header
    4
    A
    A
    5
    B
    B
    6
    C
    C
    Page Footer : Page No 2
    What I want is :
    Page Header
    Sr No
    Name
    Occupation
    1
    A
    A
    2
    B
    B
    3
    C
    C
    Page Footer : Page No 1
    Page header
    Sr No
    Name
    Occupation
    4
    A
    A
    5
    B
    B
    6
    C
    C
    Page Footer : Page No 2

    Hi Dan ,
    Thanks for your inputs.
    This way wont work beacause , am displaying other text and table both, and the table will be diplayed based on some conditions. If the conditions are true , table will be diplayed , else not.
    I missed to illustrate text in the example. The scenario is something like this :
    Page Header
    Text .........
    Table [Displayed conditionaly]
    Page Footer
    Please suggest me some way to do this.

  • Why first & last lines in each page in pdf is exported to WORD as a Header/footer?

    Similarly, when exporting a pdf file to Excel, the first and last lines in each page of the PDF do not get exported to EXCEL?

    Hi Michael,
    Installation of PDF Action is done based on this link-
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1109054
    MII Version - 12.0.7 Build(20)
    version 1.4.5. of
    the third-party iText.jar and iTextAsian.jar, from
    http://www.lowagie.com/iText/download.html
    Thanks,
    Soumen

  • Export / save a page as pdf / rtf / doc format

    hi all,
    i've created a page that looks similar to a resume format. i used different pl/sql regions and used the htp.p package to create the page like in html format. now i need to have an option to export / save the page as rdf or doc or rtf format. is it possible to do this?
    thanks.
    allen

    Have a look at this excel-export, http://htmldb.oracle.com/pls/otn/f?p=31517:108:1573041583318845:::RP,:: by Denes Kubicek.
    Maybe that can inspire you for you needs. I don't think pdf-export is possible this way though.
    Good luck.
    /Daniel

  • Is it possible to export/save Muse pages as PDF files?

    As a Web Design / New Media student, the curriculum at my school teaches a combination of Illustrator, Fireworks, and Acrobat Pro for design, wireframing, and prototyping new websites. Muse seems capable of streamlining the process, but is it possible to export the file in PDF format for sharing (assignment submission; offline viewing)? Maybe after publishing, one can convert the wepage to a PDF?
    Any suggestions are appreciated!

    Not natively, but you can always screenshot your Design or Layout page and convert that JPG or TIFF to PDF, but Muse does not export pages in that way.

  • Suddenly, I can't save Safari web pages as PDFs. ???

    I often download website documents to my Mac Pro by choosing the "Save as PDF" option in the Print dialog box. Suddenly, that option is "grayed-out" and unavailable. There's a Save as Postcript option which ultimately fails, and I can print the document on paper, which is not an acceptable alternative.
    This problem appeared after I downloaded the latest System 10.4.9 update, but I can't say whether that's the cause.
    I can still save Safari pages as PDF files on my G4 Power Book, also running 10.4.9, but not on the Mac Pro. Both computers have Adobe CS2's PDF capabilities in addition to Apple's Preview software.
    Any ideas? (Previous posts on similar problems did not have an answer.)
    2.66 GHz Mac Pro & 1.5Gz PowerBookG4   Mac OS X (10.4.8)   Airport network, firewire external drives (5x160GB)

    Hello David:
    Hard to tell what happened.
    I would do a couple of things:
    Clear the Safari cache.
    Trash the preference file (com.apple.safari.plist) and restart.
    If that does not help, you could (depending on how important the function is to you) run an archive and install:
    http://docs.info.apple.com/article.html?artnum=107120
    Barry

  • How do I save or export my web pages as PDF files?

    I'm trying to save or export web pages from my Firefox that I'm using on Windows Vista as PDF files. There isn't an option for this nor any information in your help files on this. Thanks for your time and I look forward to a response.
    == This happened ==
    Just once or twice
    == I tried to save a page as PDF today, June 29, 2010

    Actually, you should right-click on the collection and choose the command Export This Collection As Catalog (and check the box next to Include Negatives). This will create a new catalog and you can move this and the photos thus created to the 2nd computer and then in Lightroom on the 2nd computer use File->Import from Another catalog

  • How can I take a file that has individual letters in it and save each one as a seperate file?

    I have a file that has 55 letters to individuals in it and I want to save each page as a seperate file by the name of the person.  Can I do this?

    The built-in Extract command will do it, but if you want each letter named using a specific name you would need a script.

  • Display sub header from second group in each page without page break

    Hi All,. I need to show the sub header in each page in pdf output using rtf. I have two grouping region and category. I have used start:body and end:body concept to repeat the header in each page. The region is repeating in each page but I also want the category to repeat in each page without having page break. Any suggestions. Thanks, Sushil

    You could added the category value to the header row and set the table properties for row to repeat on each page.. I have sent a reply to your email. Take a look to see if the output is per expectations.
    Thanks,
    Bipuser

Maybe you are looking for

  • External display on 2011 21" iMac won't sleep

    I have a Samsung SyncMaster 213T attached to my iMac12,1 through a MiniDP->DVI Adapter attached to the Thunderbolt Port on the back of the mac. Now I have the problem that the display won't get to sleep together with the iMac's one. This feature work

  • Microsoft access 2007 barcode active x control

    Recently we purchase MS office  2010  professional which is downgraded to 2007 . we are using the microsoft access for our application . we need to get the report in barcode ( code 39 ) . so we tried to activate the activex control option and active

  • Problem emailing pictures via iPhoto

    when I try to email pictures via iPhoto, they just move to normal mail and I can't choose the nice templates promised in iPhoto 11. I do have the latest iPhot version

  • 'Upgraded' email is a big step back!

    I used to be able to set up an icon on my Firefox taskbar to take me straight into BT's Yahoo webmail, but not now, oh no, I'm just presented with a BT login screen EVERY time. Progress, not for me, that's for sure. Is there a workaround or should I

  • Slow context creation

    I seem to be having a problem with connection times progressively getting           slower as machines are added to the cluster.           For instance, at one machine my login time is ~.5 secs, at two machines           login time has increased to ~