CS3 JS flag which page has empty frame

I am trying to put together a script that will detect pages that have 2 types of elements.
1. blank graphic frames
2. graphic frames with images larger than the frame holding it.
I've created a simple 5 page doc and placed images on page 1 and 3. So the frist step is can I flag that page 1 and 3 have image on them.
This is what I have so far
var myDoc = app.activeDocument;
var myPages = myDoc.pages;
var myRecs = myDoc.rectangles;
for (var j = myPages.length - 1; j >= 0; j--) {
if(myPages[j].rectangles.length >= 1){
$.writeln("page "+j+" has a frame.");
And it returns the following in the console which is correct.
page 2 has a frame.
page 0 has a frame.
Is there a way to check if the frame has an image and if it image fits the frame or not?

I usually switch to spread coordinates to avoid those kinds of issues (although others swear by page coordinates). I use these two functions:
    function saveMeasures(doc, units) {
      var uPrefs = doc.viewPreferences;
      var uMeasures = {
        horiz:uPrefs.horizontalMeasurementUnits,
        vert:uPrefs.verticalMeasurementUnits,
        rule:uPrefs.rulerOrigin,
        zp:doc.zeroPoint
      doc.viewPreferences.properties = {
        horizontalMeasurementUnits:units,
        verticalMeasurementUnits:units,
        rulerOrigin:RulerOrigin.spreadOrigin,
      doc.zeroPoint = [0,0];
      return uMeasures;
    function restoreMeasures(doc, measures) {
      doc.viewPreferences.properties = {
        horizontalMeasurementUnits:measures.horiz,
        verticalMeasurementUnits:measures.vert,
        rulerOrigin:measures.rule
      doc.zeroPoint = measures.zp;
I call these like this--notice the code is inside a function; that makes it possible to use return to exit the script which in turn makes it possible to call the restore function as I exit, using the return in two different places:
  function splitElements(aDoc) {
    var curPage = app.activeWindow.activePage;
    var prevPage = aDoc.pages[curPage.documentOffset - 1];
    if (prevPage === aDoc.pages[-1]) {
      alert("Don't run this script on the first page of a document.");
      return;
    var uMeasures = saveMeasures(aDoc, MeasurementUnits.points);
    var oSized = getOsetElement(prevPage);
    if (oSized === null) return restoreMeasures(aDoc, uMeasures); // nothing to do
    splitElement(oSized, prevPage, curPage, aDoc);
    return restoreMeasures(aDoc, uMeasures);
This script needed to convert the measurement units to points because it needs to do calculations involving leading and stroke weights, both of which are provided in points.
Dave

Similar Messages

  • Win 7 Pro updates to Internet Explorer 11 every web page has blank frames and radio buttons. Updates show only IE11.

    This entry frame on your page has radio buttons, giving me some editing functions - Bold, Italic, Underline, Insert unordered List, Insert Ordered List, Insert Hyperlink, Remove Hyperlink, Insert HTML, etc... but
    I cannot see them.  Ever since updating Internet Explorer to ver 11, there is no going back to IE8.  Your Tech forum monitors keep rehashing the same links that do not answer this snafu.  Your Monitors suggest that the web sites are not running
    because they are not compatible with the newer versions of Internet Explorer - well, even Microsoft's websites?  When you create a new web interface, why would your coding team make it incompatible with your own company's sites? 
    The Monitors suggest our cards can't handle GPU and we should turn to software rendering.  My card is a GeForce GTX 50 TI and has, according to the manufacturer web site: "Microsoft®  DirectX® 11 Support
    DirectX 11 GPU with  Shader Model 5.0 support designed for ultra high performance in the new API’s  key graphics feature, GPU-accelerated tessellation."
    I have tried uninstalling and reinstalling IE and Microsoft must realize no customer wants to have the technical side string them along with pointless and futile misdirection to a garble of automatic chat responses that offer incomplete and unrelated fixes
    and then expect to gain points in the voting buttons that "this fixed my problem". 
    Microsoft: you are ignoring compatibility problems with your coding and pretending it is arises from hardware incompatibility or user stupidity.  Your code should be running seamlessly, should accommodate existing technologies, and be flexible enough
    to accept limitations of older hardware, older websites, and your monitors should march into Microsoft's development offices and demand answers ---- and fixes.  Has Microsoft gone into hiding when the latest technology show-piece isn't working for the
    rest of the world?  We do not exist in a research bubble.  We are here in the real world, with aging equipment and tight budgets, and we expect better from Microsoft.

    Hi ohernova,
    Sorry for the annoying issue you encountered and our develop team are trying our best to improve the performance of MS products, As I know, IE 11 was published after many technical tests, thus I suspect that it might be an individual case. I used to run
    IE 11 in my win7, and it works perfectly,    
    Here’re some test you may take into consideration:
    Make sure that you’ve installed all latest updates.
    Since your Monitors keeps suggesting that the web sites are not running because it’s a compatibility issue, I suggest you add one site to the compatibility view list for a test, (if you can find the settings in Tools>Compatibility view settings)
    Or click Win+F12, launch the F12 developer tool, click the last option, change the user agent string and document string to “10”, check whether the page can revert to normal.
    Regards
    Yolanda
    TechNet Community Support

  • Which page has a button to open a library tree javaapplet for download pdf files?

    i have got the page and download some pdf files like "PLSQL User Guide and Reference" for oracle 8.1.6. But i cannt find it from the download documentation page now. please help me, i wanna download some basic concepts pdf for oracle. thks

    This is not something that you can set in the code I provided. There's an app-wide setting that can be set (in principle) using code, but it's not a good idea to change it, because it applies to other documents as well.
    And regarding JS and CodeAcademy: It's always a good idea to try to learn more, but keep in mind that Acrobat JS is quite a niche thing, quite different from the kind of JS that is used in web-pages. You can find more information about it here:
    http://www.adobe.com/devnet/acrobat/javascript.html
    And here:
    http://acrobatusers.com/tutorials

  • TS1424 All of my books in iBooks have the following message:  "this page has the following errors:  error on line 1 at column 1 document is empty error on line 1 : encoding error..,...". Any advice?

    All of my books in iBooks have the following message:  "this page has the following errors:  error on line 1 at column 1 document is empty error on line 1 : encoding error..,...". Any advice?

    I have the same problem. I've tried to restart my Ipad and downloaded the book again several times but nothing has changed. There aren't any reviews on the book with that problem and I've got the latest version of iBook so I don't know what else I can do to get the book which I've paid for. Does anyone have another idea what I could do? (maybe one of the above might help you, Paul)
    Thanks

  • We are just about to purchase an iphoto book but received the message that we had one or more empty photo frames. We have gone over each page several times and found no empty frames. We cannot purchase the book because we cannot get beyond this message.

    We are just about to purchase an iphoto book but received the message that we had one or more empty photo frames. We have gone over each page several times and found no empty frames. We cannot purchase the book because we cannot get beyond this message. Any ideas on how to rectify this situation?

    So far every time this erros has occured it has been correct - the most difficult one to find is a full page photo layout behind a full page photo - this is hard to find - click here for a discussion on how to find it
    LN

  • The DNS server has encountered a critical error from the Active Directory. Check that the Active Directory is functioning properly. The extended error debug information (which may be empty) is "". The event data contains the error.

    got event ID 4015 and source DNS-Server-Service. please suggest how to fix this issue
    The DNS server has encountered a critical error from the Active Directory. Check that the Active Directory is functioning properly. The extended error debug information (which may be empty) is "". The event data contains the error.
    Raj

    Hi
     first run "ipconfig /flushdns" and then "ipconfig /registerdns" finally restart dns service and check the situation,also you can check dns logs computer management ->Event viewer->Custom Views->Server roles->DNS.

  • Keep getting error message saying ipod detected but could not be identified properly - I have tried all the steps on the support page twice and it still will not work!  I am running windows 8 (which it has worked with ok before) - struggling :(

    keep getting error message saying ipod detected but could not be identified properly - I have tried all the steps on the support page twice and it still will not work!  I am running windows 8 (which it has worked with ok before) - struggling
    I recently bought some new albums and can't play them on my ipod

    I just encountered the same problem on my 2 month old MBPro.  I found a work around by changing USB ports.  As for the actual cause or the reason why that worked, I dont know.  The USB port I was using works fine with my phone or other USB devices.

  • How download ML? Download page has all sorts of upgrade to ML but no ML download. Checked "Software Upgrades", which says i'm up to date although I'm on x.6.8?

    How do you download MLion?
    The support/download page has all sorts of upgrades TO ML, but not ML itself (unless I'm blind).
    Help me please.
    bardoc

    Unless you have already purchased Mountain Lion and are trying to re-download it, it is not available for download. The current version of OS X is Yosemite which is free. If you really want to buy Mountain Lion:
    Upgrading to Mountain Lion
    To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase a redemption code at the Online Apple Store: OS X Mountain Lion. Mountain Lion is $19.99 plus tax. Use the code to redeem a download of Mountain Lion from the App Store. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
         OS X Mountain Lion - System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later.
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model
                 Identifier 5,1 or later.
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later.
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later.
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later.
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later.
             7. Xserve (Early 2009) - Model Identifier 3,1 or later.
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
         Are my applications compatible?
             See App Compatibility Table - RoaringApps.

  • When I try to order a book in iPhoto it says I have empty frames on pages. But I don't. Any advice on how to correct this so I can order this book? Thanks.

    When I try to order a book in iPhoto it says I have empty frames on pages. But I don't. Any advice on how to correct this so I can order this book? Thanks.

    You do have one or more empty photo frames. Most often it will be a full page photo page missing behind a placed full page photo. To find it you need to go through you'd book and look behind each full page photo
    LN

  • Page has a custom page size message

    On the master pages, on a locked layer, we have a frame whose content is set to "Undefined" that is sized to exactly match the page size. This is so the page trim can easily be seen and measured in PDF and when printed and we've never had any trouble with it before.
    We have a file in which when we change the starting page number that frame goes out of position by 9 pts toward the outside of the pages. When we reapply a master to that page (even if its the SAME master) we get the message "Page ## has a custom page size. This page can retain its current size or be resized to match the new master."
    If we select "Keep current size" the outer frame to mark the page trim stays in the wrong position. If we select "Use master page size" that frame gets set correctly.
    I've checked the page size at all stages using both the page tool and the button on the pages pallet and it shows the page size to be exactly what the rest of the pages and the document are set to, so I don't understand why I'm getting this message.
    The first problem I was made aware of with this file is that when we ran our script to auto flow text the script was overriding the master items on to the page in the wrong position. Thinking it had something to do with the script command (which works correctly on other files) I posted this http://forums.adobe.com/message/5206889#5206889 to the scripting forum.
    Now that I've been made aware of this custom page size message I'm thinking this and the script not working correctly are related.
    Thanks for any insight anyone can offer.
    Ken

    I wondered whether my operator had accidentally changed the page size with the page tool selected and that the sizes showing in the dialog and on the tool bar were, maybe, rounded. When I saw your message I was hopeful that, maybe, the preflight would detect an incorrect page size.
    But, alas, it did not! It is showing on errors.
    Thinking that maybe InD was "seeing" the frame that was sitting outside the page as making the page larger I tried repositioning it and removing it before applying the master. But, I received the message again.
    Thanks for taking the time to respond!

  • I have created PDF from hardcopy by using my scanner. After I run OCR option for my PDF by using Acrobat Pro 9. But "Text-to-speech" functionality of the PDF says that an error message comes up that says the page is empty when I turns on the read out loud

    I have created PDF from hardcopy by using my scanner. After I run OCR option for my PDF by using Acrobat Pro 9. But "Text-to-speech" functionality of the PDF says that an error message comes up that says the page is empty when I turns on the read out loud option in Acrobat. Kindly help me to sortout this problems?

    So I tried generating the same PDFs on two other computers that have Acrobat 9 Pro.  Results were reproduced.  The verdict is:
    - complex PDF files (that is, containing cross-references, tables of contents, and bookmarks) generated by Acrobat 9.x Pro are roughly 2-5x larger than the identical file generated with Acrobat 8.x Pro.
    - different PDF conversion settings make a negligable difference (less than 10% rather than 70-80%).
    - using the "Reduce File Size" or "Optimize PDF" option cuts the file size roughly in half, almost always resulting in a "image downsampling mask" warning message, which requires acknowledgement (that is a problem for batch processing or automation).
    - adding an Acrobat watermark to the file cuts the file size roughly in half.
    - just using Save As to another filename has no effect on file size.
    - generating the PDF in Acrobat 9 with links but no PDF bookmarks still results in the inflated file size.
    - generating the PDF in Acrobat 9 without any links or bookmarks results in approximately the same file size as the Acrobat 8 PDF with full links and bookmarks.
    It appears that Acrobat 9's manner of adding links is what's bloating  the files, and in my case it's probably not related to images or image resolution/print quality.  It's a shame, because Acrobat 9 seems to have made some  improvements to the Review Tracker interface, and a few other bells and  whistles which I haven't really gotten around to exporing yet.  But  unless I find a way to keep my links and the PDF file sizes comparable to what I was  getting with Acrobat 8 Pro, it looks like I'm going to stay with Acrobat 8.

  • Empty frames?

    Hello, I try to order my photoalbum but keep getting this message: ' your album contains one or more pages with one or more frames without photo. Please change the lay-out of the pages or add photos to the frames before you can order the photobook'. I checked every page, but there are no empty frames. Sometimes I found some 'hidden' photos which I deleted. Eventually I even tried to make the whole photobook again. There are really no empty frames, but I still cannot order the photobook and keep getting the sames message. Who can point me in the right direction?

    Look for a page like those in this screenshot, i.e. a page that is using a photo for the background.  It can also have frames on the page.
    Click to view full size
    OT

  • To display an html page that contains frames, using servelt

    Hi all
    i am using a servlet which has to display a html page that contains frames.
    I would like to know whether it is possible to display a frame using servlets.
    If yes please tell me the how to do it?
    Thanks,
    Sudheer.

    Thanks Seth.
    I just tried that, but when I run it in preview mode (by simply hitting F12), it gives me an error because it can't  find the file in the temporary preview folder it creates (ie:
    C:\Users\Tom\AppData\Local\Temp\CP2840464090993Session\CPTrustFolder2840464091009\Captivat ePreviewLoader\
    I'm hoping to find a place to put it so that it works when running F12 and when running in regular 'published' mode
    I was thinking I could put it in the 'C:\Program Files\Adobe\Adobe Captivate 6 (32 Bit)\Templates\Publish' folder, but when I do that, it doesn't seem to gete copied to the .\CaptivatePreviewLoader folder when running F12

  • How to split one page into different frames in ADF?

    Hi,
    Can any one please guide me how to split a jspx into different frames.
    i.e., left frame contains <af:panelSideBar> which contains multiple <af:commandMenuItem> s. And whenver we click on the one <af:commandMenuItem>, it has to show the corresponing page inside center frame in this page itself. Is it possible in ADF? Which component we need to use?
    Can anyone guide me on this?
    Thanks in advance,
    Regards,
    Suresh Kethireddy

    You can use a combination of the ADF Faces 10.1.3 components like:
    af:panelPage
    af:panelSideBar
    af:panelHorizontal
    af:panelGroup
    to organize the screen layout, but it is not the interactive splitter that the 11g product provides.
    You can all all the 10.1.3 ADF Faces Components here:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/imageIndex.html

  • Knowing when a page has finished loading

    Hi all,
    I've  produced  a small project that has  a  few tabs, each tab contains an IFrame UI, which loads a BW report.
    I've been asked to  add an indicator that should tell when the reports are finished loading.
    I have two problems:
    1. How  do I know when the frame has finished loading the url? I know I can use the OnLoad tag in html, but how can I edit the HTML WebDynpro produce?
    2. What kind of indicator can I use? I thought of two options - Putting the "Progress Clock" which WebDynpro uses when calling an RFC, and for that I need to know if it's even possible  to call that clock.
    The 2nd option I thought  of is using the ProgressIndicator UI, and just divide the 100% to the number of tabs, and change the percent value when each tab  has  finished loading the URL.
    I appreciate any help  that  you  could provide.
    Yaniv

    Armin Reichert -> I've tried what you suggested about the portal integration (I send parameter to an URL Iview, which changes the url), and it works great!
    Thanks.
    Noufal Kareem -> Because I use an IFrame UI which loads a BW report, I don't have an indication (The WD don't know / care if the page inside the frame was loaded.)

Maybe you are looking for