CS3/CS4 - Preview of page item = Crash in rare cases

Hi,
I'm wondering about how the to draw a preview of a page item, in the most correct way. Currently im using the SnapshotUtils like:
SnapshotUtils ex(somePageItemRef,scaling,scaling);
And then:
AGMImageRecord* fpCurAGMImage = (AGMImageRecord*)ex.CreateAGMImageAccessor()->GetAGMImageRecord();
to obtain an AGMImageRecord that I can draw onto an IGraphicsPort:
PMMatrix theMatrix;    // No transform
gPort->image(fpCurAGMImage, theMatrix, 0);
However, one customer(PPC Mac 10.4 CS4) had a crash in this code, as seen from the partial stack trace below:
Thread 0 Crashed:
0   AdobeAGM                            0x01417418 AGMTerminate + 4143764
1   AdobeAGM                            0x012b645c AGMTerminate + 2697944
2   AdobeAGM                            0x012bc3e8 AGMTerminate + 2722404
3   AdobeAGM                            0x012be210 AGMTerminate + 2730124
4   AdobeAGM                            0x0120b8d4 AGMTerminate + 1998672
5   AdobeAGM                            0x01030150 AGMTerminate + 51148
6   ...adobe.InDesign.AppFramework      0x114f48c8 GetPlugIn + 118040
7   ...adobe.InDesign.AppFramework      0x114f4b30 GetPlugIn + 118656
8   com.adobe.InDesign.MyPlugin              0x0e405778
MyCustomView::Draw (IViewPort*, __HIShape*) + 1560
I can see in the documentation that the GetAGMImageRecord function should not be called any more as of InDesign 3.0, however I cannot figure out another way of obtaining an object that i can draw onto the IGraphicsPort? Is there a more preferred solution?
I Hope somebody can help on this one
Thanks!
Kind regards Toke

Hi Toke,
I do not have any experience with this sort of stuff ;-(
However have you noticed the sdk sample transparencyeffect which still uses GetAGMImageRecord even with CS4. Maybe the sample code sheds some light on your problem.
Best,
Peter Schülke

Similar Messages

  • [AS CS3] Bug? All Page Items - grouped items w labels

    Can anyone confirm this behaviour for me. I would classify it as a bug, but maybe the logic for it not being a bug escapes me.
    The command "all page items" is supposed to return a (flat) list of every page object, right? I would suspect that I should be able to address any object in the list. But I can only seem to address an object when it's inside of a group.
    I am trying to get the text of a text frame that has a label. It may or may not be inside a group. I can certainly do a try/error block to try a script statement for objects in a group or not in a group. But I think that "all page items" should be able to handle it directly.
    Here's a test script: ------
    tell application "Adobe InDesign CS3"
    tell document 1
    get label of all page items
    set myUngrouped to contents of text frame "some label" --only works when objects ungrouped, this is expected
    set myText to (get contents of text frame "some label" of all page items)
    --both statements work ONLY when objects grouped
    set myText to (get contents of every page item of all page items whose label is "some label")
    end tell
    end tell
    Steps:
    Make a new document.
    Draw a text frame. Type some text into it.
    Label the frame "some label".
    Draw another empty graphic or text frame.
    Run script
    -->result is, myText statements error out. Why is this?
    Now group all items on page.
    Run script.
    -->result is, myUngrouped can't continue. This is expected.
    Comment out myUngrouped statement
    Run script.
    -->result is, myText statements work OK.

    On 19/8/08 1:14 AM, "SuperMacGuy" <[email protected]> wrote:<br /><br />> set myText to (get contents of every page item of all page items whose label<br />> is "some label") <br /><br />The syntax is a bit tricky. The key is that all page items returns a list,<br />so what you want is certain items -- not page items -- from that list. So:<br /><br />set myText to (every item of all page items whose label is "some label")<br /><br /><br />-- <br />Shane Stanley <[email protected]>

  • [CS3 JS] Getting a page item by its script label

    I have a text frame on a master page with its script label set. In my script, I am trying to get a reference to the text frame with this:
    var doc = app.activeDocument;
    var spread = doc.masterSpreads[0];
    var tabFrame = spread.allPageItems.item("TabLeft");
    I get the error "spread.allPageItems.item is not a function"
    Any help will be appreciated. Thanks.
    Rick

    Hi Rick,
    spread.allPageItems returns a flattened array of all of the page items in the spread, at any level of the hierarchy (i.e., inside groups and other page items). Is that what you want? Sadly, allPageItems does not benefit from the special case where we use the label as a name, so you'll have to iterate if that's what you want.
    As Peter says (thanks, Peter!), spread.pageItems.item("label") gives you all of the page items whose label matches the string, but it does so in sort of a weird way--you'll always get a page item object. If no page items match, you get an invalid page item; if one matched, you get a single page item, and if multiple page items matched, you get a page item object that actually contains multiple page items. It can take a little testing to figure out exactly what it is that was returned.
    Thanks,
    Ole

  • Report row highlight based on a page item

    Is there a way to highlight a report row based on the value of a page item?
    In my case I have a report where the application user requests data in a detail report using a column link in the master report. This loads an id number from my report into a page item (say :P8_ID for example). If this item is null, I want the report rows to all render normally (nothing is selected or the detail report has been closed). If there is an id in that field then I want the row containing the information about that item to highlight (its column link has been clicked selected it to bring up a detail report).
    At first glance, this looks similar to Vikas solution (Change the Report row color when clicked but I am trying to make the connection between what has already been done and where I need to be.

    After looking back, I discovered my value was being set after the report rendered. When I re-organized my calculations and the rest, it worked.

  • [AS][CS3] duplicate page items in a specific position on another doc

    Hello,
    I need to copy or duplicate page items of the active page of doc 1 in a specific position of the active page of doc 2.
    I can duplicate the page items of doc 1 into the doc 2 (with the code below) but can't find a way to duplicate them in a specific position: they are always duplicated in the same position on the active page of doc 2.
    The current working code (simplified) is:
    tell application "Adobe InDesign CS3"
    tell document 1
    tell layout window 1
    set pageitemlist to every page item of active page
    end tell
    end tell
    duplicate pageitemlist to the active page of layout window 1 of document 2
    end tell
    Thanks for your help!

    -- This works in CS4:
    tell application "Adobe InDesign CS4"
    tell document 1
    tell page 2
    set d to duplicate page item "textframe1" -- the text frame labeled "textframe1"
    -- FYI, d has a class of list:
    -- "text frame id 328 of page id 237 of spread id 232 of document "Untitled-2" of application "Adobe InDesign CS4""
    end tell
    move d to page 4 -- moves to 0,0 on pg4
    end tell
    end tell

  • CS3, CS4 and CS5 Crash on Click.

    Hey, cant find anywhere better to ask this question.
    running 2.8gz 4gb ram intel imac on latest snow leopard.
    have all 3 trials of indesign cs3.cs4.c5 installed.
    however as soon as the splash screen has cleared, we get to the new document screen.
    we can pick the document settings then the page appears white as standard.
    then you click ANYWHERE within indesign and instant freeze and have to force quit.
    all drivers n software are up to date and have cleared the prefrences.
    any more ideas guys?
    cheers
    x

    What I think is interesting here is that despite the goofiness of it all, Owen actually looked at the crash report (even though there wasn't one!) and we got some data out of it. I can't remember the last time I suggested somebody look at the crash report where it actually ended up being useful (mostly, I think, because people don't bother to do it). And I definiely can't remember the last time somebody ran "Sample Process" and got out the data that ended up being useful. For clarity that useful data was:
    Call graph:
        2424 Thread_76485   DispatchQueue_1: com.apple.main-thread  (serial)
          2424 start
            2424 main
              2424 GetPlugIn
                2424 0x32753e78
                  2424 GetPlugIn
                    2424 GetPlugIn
                      2424 GetPlugIn
                        2424 TIN_DisposeFont
                          2424 SINGDLLAccess_EnumerateLocations
                            2424 SINGDLLAccess_EnumerateLocations
                              2424  SINGLIB::CatalogOperationContext::CatalogOperationContext(boost::shared_ptr<SINGLIB::Cont ext>)
                                2424 SINGLIB::SystemLock::Acquire()
                                  2424 sem_wait
        2424 Thread_76532   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
    Now, I'm not really sure what this tells us. I think it's saying if we made it easier for most users to provide this information (better descriptions of how to get it, maybe with some screenshots, etc. And whatever the Windows equivalent is, which is I think Quite Possibly A Lot Tougher), then perhaps we'd make some progress in more of these cases.
    Of course, the hard part is what to do. I mean, I didn't know what SING and TIN were, though a minute of of googling made it clear that they were about fonts. But certainly other people did.
    Oh yeah, Owen: you should go through the thread and award points to the helpful answers. Those of us with non-stratospheric post counts still occasionally smile at the idea of getting useless points to acknowledge our depth of service to the community. Or something.

  • [CS3 Server] Page items copy problem

    I'm trying to copy page items from one document to other. I use kCopyCmdBoss command.
    Command processes successfully but extra pages are generated in destination document and InDesign fails after opening it.
    What could be a problem?
    Thanks in advance.

    -- This works in CS4:
    tell application "Adobe InDesign CS4"
    tell document 1
    tell page 2
    set d to duplicate page item "textframe1" -- the text frame labeled "textframe1"
    -- FYI, d has a class of list:
    -- "text frame id 328 of page id 237 of spread id 232 of document "Untitled-2" of application "Adobe InDesign CS4""
    end tell
    move d to page 4 -- moves to 0,0 on pg4
    end tell
    end tell

  • All copies illustrator crash, cs2 cs3 cs4 Leopard 10.5.8 powermac 1.8 dual

    I crashes every time i open it. it suddenly started happening. i could get just past  the opening pane at first allowing me to choose what kind of document to open print rgb etc, the it stopped doing that. i get the opening pane the it crashes, it aslo happens in past copies cs2 cs3 cs4 non of my illustrator copies will open

    It could be an issue with your font caches.  Go get fontnuke and try deleting all your system and application font caches.
    It doesn't sound like a preference issue if it's affecting all the other versions.  Do you have the suite installed?  Is Photoshop working properly?

  • Just updated to Firefox 3.6.9, I'm building a site and the Dreamweaver CS3 Preview feature no longer works in previewing my pages. Any fixes available?

    Just updated to Firefox 3.6.9 this morning. I'm building a site using Dreamweaver CS3 for a class and the Preview feature was working fine before the update. I can preview my pages in other browsers successfully, but now if I choose Firefox, no window opens.
    I have a Macbook Pro, OS X.

    Sorry, Mozilla did a security fix that broke Dreamweaver with Firefox. Virtually no other programs were broken with that fix, and considering the age of Dreamweaver (~5 years since it was last updated) they decided not to back-out that security fix for one old, elderly program. This problem was discussed at length back in January and February after Firefox 3.6 was first released.

  • Align page items (AS) (CS3)

    Scripting Gurus,
    Is there some simple AS syntax to align selected page items on a page?
    Dictionary seems to imply that, saying:
    align distribute items page item : The page items to align or distribute.
    align option left edges/top edges/right edges/bottom edges/horizontal centers/vertical centers : The type of alignment to apply.
    I attempted this:
    tell page items in selection
    set vertical alignment to top edges
    end tell
    Thanks!
    Joe

    Its kinda of crazy but here ya go, I wish the AppleScript Dictionary listed  examples ...esp. when the syntax is wacky.
    select a bunch of images, or have the object references in a list(I just use selection to make it easier):
    tell application "Adobe InDesign CS3"
        tell active document
            set myimages to selection
            align align distribute items myimages align option left edges
        end tell
    The text in the red is where you put those paramaters listed in the dictionary.
    ~Mike

  • [JS CS3] disappearing page items

    Now this is strange: I've written a script that does some imposition of a an image on a single sheet (page) and puts some special printers marks along the side. Now there's (as far as i am aware of) one instance where all the page items get placed on the page, but when you save, close and reopen the document, half of them are gone!
    When you drag the page items before saving they disappear right from under your cursor! I've tried putting a lot of save commands during the script, hoping that that would nail those items down, but with no luck.
    Has anybody had a similar experience and found a solution?
    Thanks,
    james

    Hi,
    You should send your script then we could have a try on our side.
    Loic

  • Preview mode Dreamweaver CS3/CS4 not compatible with Firefox 3.6.8

    I found a post about this issue, which was marked 'solved', but it isn't! To use Firebug, I had to upgrade Firefox and since I did, I can't use the 'preview' function in Dreamweaver (It works only once, when Firefox is closed, but I don't like to close and re-open Firefox every time I want to preview a page). Downgrading is not an option, as I can't use Firebug and I really not think Adobe has to solve a problem caused by Firebox, as suggested in the previous post.
    == This happened ==
    Every time Firefox opened

    There is a fix available for Dreamweaver, so it works in Firefox 3.6+ versions:
    http://solutions.marketingmedley.com/
    There is a $5.00 fee for that Dreamweaver fix. That website and the fix are not associated with Mozilla in any manner. Support for that fix is provided by that that website via email.

  • CS3: Rotated page item: How can I get the top-right point

    Hi
    I have a rotated page item. Now I should have the top-right and the bottom left point. If I get the rectangle of this page item I only have the top-left and the bottom-right point. And I can read the rotation angle.
    - How can I get the missing points?
    Thanks
    Hans

    Algorithmically speaking (ie, this is NOT real code), isn't it just something like:
    if page.rotationAngle == 90 then
    origTopLeft = (newBottomRight.Y, newTopLeft.X);
    else if page.rotationAngle == -90 then
    origTopLeft = (newTopLeft.Y, newBottomRight.X);
    else if page.rotationAngle == 180 then
    origTopLeft = newBottomRight;
    else
    origTopLeft = newTopLeft;

  • [JS][CS4] Remove all hidden page items?

    Hello,
    I'm trying to remove all hidden page items regardless of how many sublayers they are burried in. Is this possible? I wrote a snippet here that seems to only partly work. It removes all hidden page items unless two hidden items exist right after each other in the stacking order. Why would this be happening? Any suggestions?
    for (i=0; i<doc.pageItems.length; i++){
              if (doc.pageItems[i].hidden == true){
                   doc.pageItems[i].remove();
    I'm new to scripting so any help is greatly appreciated.
    Thanks!
    Lindsay

    What happens if you go from back to front? I think something like this
    #target illustrator
    var idoc = app.activeDocument;
    for (i = idoc.pageItems.length-1; i>=0; i--){
              if (idoc.pageItems[i].hidden == true){
                   idoc.pageItems[i].remove();
    Worked on a trial

  • [CS3] Stroke Type of an page item?

    Hello!
    Does anybody know how to get the stroke type of an page item?
    There are so many possibilities.
    Thanks,
    Alois Blaimer

    Hello!<br /><br />I have found somenthing:<br /><br />          // Inspect dash.<br />          InterfacePtr<IDashedAttributeValues> dashedAttributeValues(static_cast<IDashedAttributeValues*>(descriptor->QueryAttribute(kDa shedAttributeValuesBoss, IDashedAttributeValues::kDefaultIID)));<br />          if (dashedAttributeValues != nil) {<br />               SNIPLOG(" dashedAttributeValues");<br />               for (int32 i = 0; i < dashedAttributeValues->NumValues(); i++) {<br />                    SNIPLOG("  [%d] %f", i, ::ToDouble(dashedAttributeValues->GetValue(i)));<br />               }<br />          }<br /><br />But the problem is, it always returns "12". I change the stroke style and it always returns "12".<br /><br />What's wrong with the code?<br /><br />Thanks,<br />Alois Blaimer

Maybe you are looking for