CS3 JS Double Page Spread

I'm trying to see if pages have items on them before sending off the page using:
if(myDocument.pages[myPageName-1].pageItems.length==0){
This works well until I get a double page spread item.  The element sits on the left hand page and extends onto the right hand page but ID only reads the link as being on the left hand page not the right.
Is there a better way to check if pages are blank?
Cheers John.

InDesign assumes that a pageItem ‘belongs’ to a page if the geometric bounds of the page contains the center point of the pageItem bounding box. So you can have a pageitem located on page N that overlaps some other pages in the same spread. Actually the most relevant geometric container is the spread. To know if a page is really blank, you can traverse the parent spread page items collection and check if the bounds of one object intersects your target page.
Try this:
Page.prototype.hasPageItems = function()
     var sprd, pItems, b, ib;
     // check if the page contains a direct page item
     if( this.pageItems.length > 0 ) return true;
     // check if the page intersects a spread page item
     if( (sprd=this.parent).pageItems.length > 0 )
          b = this.bounds;
          pItems = sprd.pageItems;
          for( i=pItems.length-1 ; i>=0 ; --i )
               ib = pItems[i].geometricBounds;
               if( b[0]<=ib[2] && ib[0]<=b[2] &&
                    b[1]<=ib[3] && ib[1]<=b[3] )
                    return true;
     return false;
// sample test
var doc = app.activeDocument;
alert( doc.pages[2].hasPageItems() );
@+
Marc
http://www.indiscripts.com

Similar Messages

  • How do I create a double page spread in a booklet layout on InDesign with out splitting my design and putting them on two separate pages?

    I'll try my best to put this in the most simplest way,
    Im trying to create a magazine, but I'm finding it difficult to make a double page spread without splitting it in half and putting it on different pages?
    Is it possible to set the pages up so they are side by side, and then change them to the right order to print?

    Just set them up as letter size pages in reader order. If you are having it printed professionally, send it as a pdf with separate pages, and the printer will handle setting up the printer spreads. If you are printing it from an office printer, both InDesign and Acrobat have Print Booklet functions. Many office printers also have this capability built in.

  • Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts.    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly i

    Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts. 
    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly in this view.
    It's always the second search that is problematic.
    I've tried typing over and all it seems to do is confine the search to the the entries that have come up for the previous search.
    I've tried to use the x to clear the previous entry and then type the next search, same problem.  The only way seems to be to move from "All Contacts" to "Groups".  Then the searched name appears and I can return to All Contacts to see full details.
    Surely three key press' are not the way it's supposed to work?
    FYI
    Processor  2.7 GHz Intel Core i7
    Memory  8 GB 1333 MHz DDR3
    Graphics  Intel HD Graphics 3000 512 MB
    Software  Mac OS X Lion 10.7.3 (11D50d)
    Address book Version 6.1 (1083)
    MacBook Pro, Mac OS X (10.7.1), 8Mb RAM 2.7Ghz i7

    AddressBook experts are here:
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion#/?tagSet=1386

  • HT1040 I am just about to order a 92 page book in Aperture and have previewed the order and found that in the PFD file I get all the pages are now different. Double page spreads are now on 2 different pages when viewed in 2 up continuous mode in Adobe Rea

    I am just about to order quite an expensive 92 page large size  book in Aperture & have used the Preview button and on viewing the book in the PDF using the 2 up continuous viewing mode  I find that the page arrangement is all wrong with double page spreads now on separate pages and all my carefully designed pages in the wrong places. Will the book actually get printed like this? Regards,Keith

    How did you create the preview of the book? It will look exactly like shown, when you press "Buy Book", then "Preview Book". This will open the Preview of you book in the "Preview" application. Set this to "Two-page mode". Then you should be able to see your double page spreads correctly, like here:
    Regards
    Léonie

  • From single page to double page spreads when rotating

    We've seen some publications that display as a single page when the iPad is held in portrait mode but switch to double page spreads when the iPad is rotated to landscape mode.
    We've searched this forum - which has been very helpful so far - but can't seem to find how to enable this. Is it something fairly simple we've missed or has it been custom coded for the publications that use it? They seem to be pdf based as far as we can tell, or at least they are 'pinch & zoom'able and don't have any other interactivity, so they're quite basic. Nonetheless it is quite a nice way to display/read the publications.
    We're quite new to the whole Adobe DPS system but are keen to get up to speed with it. We see a lot of potential with these tools.
    Thanks

    Very simple... create 1 folio for each spread with 1 page in landscape orientation and 2 pages in portrait - and only allow horizontal navigation (we use DPS + WoodWing so terms might differ at bit). Adobe made a script for converting PDF to Folio - spread by spread. Use the script for creating the needed layouts.
    We have at least 15 apps working like that.
    /Peter

  • How do export a double page spread photo to epub and fill an ipad screen?

    I'm completely new to indesign. I'm using XP and Indesign CS6.  I'm testing my epub on the new IPad 3.
    I've published numerous books in print form with major publishing house in the US.  I need to quickly get a copy of the book in epub format for publication on the ipads. Maybe later for the nook, etc. Eventually I will want to design new ebooks from scratch. 
    We are scanning the book spreads [photos and text together a double page spread] and want to show those spreads on the ipad as a single horizontal image with no page gutter.  We've placed those jpg spreads in indesign as a double page spread. When we publish to epub it does not show as a double page spread.  It only shows up as a horizontal image on either the left or right side of a vertical book [gutter layout] view on the ipad. It never spreads out to fill the entire ipad screen.  What simple thing are we missing?
    Thanks so much
    Dwight

    "The" iPad does not exist as a target, so I'm assuming you mean you export to a regular ePub and are viewing it using iBooks.
    iBooks is page-agnostic. ePubs do not support the notion of "left-right" pages. In fact, iBooks is the only ePub viewer I am aware of that even tries to show "two" pages at a time.
    Re-design your document so each image appears on its own page.

  • I am making a book in iPhoto using a double page spread and blank layout. I can't find a way to minimize the picture. it is too big in all the themes. I seems like there must be a way to shrink it not just zoom to make it fit?

    I am making a book in iPhoto using a double page spread and blank layout. I can't find a way to minimize the picture. it is too big in all the themes. I seems like there must be a way to shrink it not just zoom to make it fit?

    Command (right) - click on the photo and select Fit to Frame in the contextual menu:
    Not all frames in a theme offer that feature but most do.  The spread layout doesn't.
    OT

  • In ibooks i want to open books to double page spread. How?

    My books, even in landscape mode, only show one page at a time.  I want to have double page spread.  How do I do that?
    Thanks, Tzipora

    Well, everyone, I found two apps that open pdf's in landscape and turn pages.  All that I want.
    One is called PerfectReader.   The other is Bookman.  That solves that problem.  Thanks for the help.
    Tzipora

  • Exporting PDFs and maintaining double-page spread format

    I've combined a large number of individual PDF files (created in InDesign) for print.  Now I would like to create an iBook with these pages.  I've created a PDF file for use on an iPad but how do I maintain the double-page spread format?  I can view this successfully in Acrobat but not in iBooks.  Can anyone help?
    Thanks
    F

    This is best addressed in either an iBooks forum on the Apple website or InDesign. For use in iBooks you might be best off using a format other than pdf.

  • Exporting a double page spread and the PDF ends up blank?

    I've created a double page spread as part of my university portfolio and wish to export this. Although when I export to a PDF the file is blank. I've tried changing everything and watching many videos but I can't seem to find the problem? I using CS6. I have changed the range to spreads also. HELP!

    AH! Willi has spotted the problem.
    You've created a new master spread in the Pages panel, and don the whole layout on the master page. Master pages are used for content that should be the same on multiple pages so you can create it once, then apply the master pages to the live document pages.
    Open the Pages panel and add two in the bottom section. The "quick and dirty" solution at this point would be to drag the Master B page onto them, but it would be better to learn how to do this the right way. Since you have content that crosses the page boundary, you will need to have your two pages arranged as a spread. You can do this by setting the start page to an even number in Numbering and Sections options, or you can turn off page shuffling from the Pages panel flyout menu and drag the two pages together. Then cut the content from the B master page, and Paste in Place on the document pages spread.
    This is basic InDesign usage, which makes me think you could use some training. Best beginners book is probably Sandee Cohen's Visual QuickStart Guide for InDesign.

  • Double page spread for photobooks

    Hi folks,
    anyone know if its possible to create a photobook (soft cover style) with one photo as a double page spread?

    That was done by a user in iPhoto 6 very successfully. Do a search in the iPhoto 6 book and print ordering forum. He posted screenshots of the result and they were pretty impressive.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Double page spread - but only using 1 and a half pages

    Hi there smart people who use Aperture.
    I'd like to create a double page spread in an Aperture book where the image only goes half way across the second page. Is this possible? I can't seem to enlarge an image so it crosses onto the second page, and I can't seem to reduce the size of an image that's inserted into a double page spread. Hope that makes sense and someone can help.
    Thanks,
    gtmonkey

    Hi again RB - thanks again for helping.
    I can't seem to open your page today, but I was able to see it last night and confirm that you can do what I'm trying to do.....lucky guy!
    I'm still using Aperture 2.1 - maybe that's why I can't resize those pages?
    However, I have discovered that if I drop a new image frame over the old one on the double page spread, I can play with that as much as I want. I can then delete the old image frame (the one that wouldn't resize) and get the result I want. That should do the trick.
    Thanks again for your help though....
    GT

  • Double page spread possible?

    Apple claim that it is possible to create a double page spread, ie one photo across two pages. I can find no way to achieve this and internet research basically says it cannot be done. Is there an easy way to do this?

    Léonie had it right the theme doesn't matter. You can put the full page template into any theme.
    Depends on the theme. Some of the stock themes support this (Art Collection and Journal do for example) and some don't.
    The only way to see which do is to open them in turen and look for the layout page like so:
    Message was edited by: Frank Caggiano

  • Is it possible to join two single pages in a pdf into one double page spread?

    Is it possible to take two single pages from separate pdf documents and combine them as one double page spread?
    If it is possible could someone describe how it is done please?

    The InDesign method Steve mentions is the best option. You can also place it in Illustrator as an import but you'll need to have the same fonts as the PDF file. This option will allow you to edit the files, pending what objects are editable. It will have a few quirks, and the text lines might be separate objects.
    I'd go InDesign, but just in case you don't have ID, you can use Illustrator, but be prepared for a little work.

  • What is the best way to do a double page spread for a magazine?

    I'm in the process of putting together a magazine and would like to do some double-page spreads in it, but my printer has requested that the magazine be sent to him as single pages.  If I set it up as 'facing pages' and then change it to single pages when I've finished, will this upset my double page layouts??

    Set it up as facing pages, then when you make the pdf DO NOT CLICK SPREADS.
    When  you click Spreads you are asking InDesign to produce a PDF where page 2-3 are joined, and 3-4 are joined etc.
    When you don't have Spreads selected then Indesign produces Single Page pdf.
    A single page is what is required by a printers with the pages running in reading order from page 1 - finish (for example).
    Do not attempt to impose the document yourself.
    Remember to include your crop marks and your bleed.
    Sidenote on crop marks and bleed:
    Crop marks are needed to trim the page to size when printed. As printers can't  print right to edge of a sheet, and that it's near impossible to trim a  sheet of paper right to the edge of a colour - the colour needs to  extend past the crop line, this is called  bleed.
    When you bleed the document, i.e., extend any item that is tucked right  against the foredge (the edges opposite the spine), then you need to  extend this object off the page into a "bleed" area.
    This allows for human error when trimming the paper, as each sheet is  not trimmed individually (that would take forever!) they are stacked on  top of each other and trimmed in stacks. It would be impossible to stack  all the sheets exactly even, and there is movement on the press, so  compensating for the movement and the fact they can never be stacked  exactly even - for this reason you need objects to extend past the edge  of the page.
    The crop marks tell the guillotine operator where to trim the sheet. Once they have  the measurements in their guillotine machine it's a simple matter of  rinse and repeat with as many stacks of paper there are.
    And printers can sometimes fold and trim a print job folding machine,  and since it's a machine and you have to account for mechanical errors  and human error, you need bleed too.
    Bleed is important - If you don't add bleed then the object stops at the  foredge of the paper. And if the blade trims/crops close to the object  but misses by a sliver - then you have a sliver of white on the printed  piece, which is highly undesirable.
    So you need crop marks so the printers know where exactly to cut the paper, and to cut into  the bleed so that you don't have slivers of white.
    And yes you need crop marks even if you don't have bleed, if you  don't have any bleed it's likely that the edges of the paper are just  white, so there are no markings where to cut to give the correct size  that you want. So crop marks need to be included no matter what.
    And the placement of crop marks is important. As I said earlier, crop marks are  for letting the guillotine operator know where to trim the page so that  it cuts into the bleed area. The bleed area to allow for mechanical,  physical and human error. And seen as the bleed can sometimes be  included in a final printed piece it is not desirable to have anything  other than bleed objects in the bleed area.
    For this reason you offset your crop marks to be outside the bleed area. As I'm in  Europe I work mainly in millimeters, so I would set my Bleed Area to be 3-5  mm (check with your printers for what bleed you should allow) and I would set my crop marks to Offset by 1 mm more than the Bleed (i.e., 4 - 6mm).
    This ensures that the crop marks do not encroach the bleed area. If your crop marks do  encroach the bleed area you run the risk of the crop marks appearing on a final printed  piece.
    So in Summary
    Make sure you have bleed where necessary on your document.
    Add the desired amount of bleed - in my case 3-5 mm.
    Offset the crop marks so they don't encroach the bleed area - in my case 4-6mm.
    (bleed depends on the printers requirements - then make sure you offset your crop marks to be outside the bleed area).
    Message was edited by: Eugene Tyson
    Correction to mm in Summary

Maybe you are looking for