Skip to main content
Robert at ID-Tasker
Legend
February 27, 2023
Question

Table inside Table with Images - Doubled number of AllPageItems ?? Bug ??

  • February 27, 2023
  • 3 replies
  • 2623 views

Is it another bug ?

 

When loading info from AllPageItems of the Document - I'm getting duplicates of ALL Rectangles and their Images - when Table is inside another Table.

 

And it's getting worse - every extra nesting - duplicates everything again - Table nside a Table inside another Table:

 

 

Everything is perfectly fine when there is no nesting - Table is just inside a Text.

 

 

Can someone please check if you have the same ?

 

This topic has been closed for replies.

3 replies

Community Expert
March 1, 2023

Hi Robert,

don't know if this issue will ever get fixed.

I can already see the same behavior with allPageItems and anchored objects in nested tables in InDesign CS6 version 8.1.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Robert at ID-Tasker
Legend
March 1, 2023

Great 😞 

 

But like I've said - not a big deal for my tool 🙂 but you guys using JS - need to remember about it 😞

 

Community Expert
February 28, 2023

@m1b said: "Again excellent! I've reproduced your findings and here's my slightly simplified steps:"

 

Hi Mark,

I followed your steps where you and I expected only three items in the document.

One text frame holding the table.

One rectangle inside the graphic cell.

The image inside that rectangle.

 

All in all with my test document it is working as expected:

app.documents[0].spreads[0].allPageItems.length returns 3

app.documents[0].allPageItems.length returns 3

 

My code:

var allPageItems = app.documents[0].allPageItems;
var allPageItemsLength = allPageItems.length;
var idArray = [];

for( var n=0; n<allPageItemsLength; n++ )
{
	idArray[n] = allPageItems[n].id +"\t"+ allPageItems[n].constructor.name;
};

alert( "List of Items" +"\r"+ idArray.join("\r") );

 

The result:

 

Attached my test document:

TestDoc-UWE-3-pageItems.indd

 

Mark, could you make your InDesign document available?

 

All my tests done with InDesign 2023 version 18.1 ( on macOS this time ) .

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Robert at ID-Tasker
Legend
February 28, 2023

Because when you've placed your image "directly" - Cell been converted to a Graphic Cell.

 

If you place your image as InLine - with text - so the Cell remains as a Text Cell - then you'll get duplicates.

 

Community Expert
February 28, 2023

Hi Robert,

thanks for the hint. Indeed if I anchor the image to an insertion point of the inner cell of the inner table two objects are doubled in the allPageItems array of the document:

 

 

Test document attached:

TestDoc-UWE-Table-ImageAnchored.indd

 

Regards,
Uwe Laubender
( Adobe Community Expert )

m1b
Community Expert
Community Expert
February 27, 2023

Hi @Robert at ID-Tasker, you really need to show us the exact steps to reproduce what you are seeing.

 

For example, here's what I did just now, manually:

1. new Indesign document, 1 page, no primary textframe

2. make text frame

3. insert new table (2 x 2) into textframe 0 at insertionPoint 0

4. convert cell 0 of table 0 to a graphic cell

5. place an image into cell 0 of table 0

6. insert new table (2 x 2) into cell 1 of table 0 at insertionPoint 0

7. convert cell 0 of table 1 to a graphic cell

8. place an image into cell 0 of table 1

9. run script:

var items = app.activeDocument.allPageItems;
for (var i = 0; i < items.length; i++)
    $.writeln(items[i].toSpecifier());

 

Result:

/document[@id=36]//text-frame[@id=220]
/document[@id=36]//rectangle[@id=252]
/document[@id=36]//image[@id=253]
/document[@id=36]//rectangle[@id=271]
/document[@id=36]//PDF[@id=272]

 

This is exactly the result I expected. I have probably misunderstood your case and, if so, please outline the exact steps (and make it as minimal as possible).

- Mark

Robert at ID-Tasker
Legend
February 27, 2023

Thanks for your reply @m1b

 

I'm not modifying nor creating anything - I'm just reading a structure of a document. 

 

Cells are not graphics - they have inline graphics with text - kind of icons with text. 

 

When the table is in the "normal" text - there is no problem. 

 

But when the table with those icons - is placed in another table - to simulate 3x column text - there are two more tables - ALL "icons" get duplicated - and if then manually nest this "Table inside Table" into another table - all icons are duplicated again.

 

My initial thought was that there is a problem with the original INDD file - so I've copied nested Table into a new document - icons not duplicated.

So then I've copied this 3x column table with nested Tables - icons duplicated. 

Then I've nested everything again... have not tried again 😉 but I'm sure it would get duplicated again... 1x, 2x, 4x... 

 

So it looks like a bug to me...

 

m1b
Community Expert
Community Expert
February 27, 2023

Robert, the point I'm making is that to describe a bug, you need to itemise the steps to (re)produce it. For example, we have no idea whether there is something malformed about your table that you are copying/pasting. Even if you share your example document, we don't know whether there is a corruption in it, or a weird process went into its creation.

So if you want to describe, and report, a bug, you must write the steps to reproduce it, starting from a known foundation, such as Indesign with no documents open. My example should give you a good guide.

 

Otherwise, there isn't much for us to do to help you. We can't follow what you did because we don't know *everything* about your document and we don't know how you derived your spreadsheet data—for all we know that could be the faulty part. See what I mean?

 

But more importantly, if you want help here, you simply have to do as much work as possible yourself. Make it as easy as possible for everyone else to help you. As it stands you have given us a vague, messy, impossible task, with no example files or code.

 

In contrast, if you have written out steps like I did then anyone reading this could follow along, with almost no room for error, and say: yes I got the same (presumably buggy) result and you could lodge a bug at indesign uservoice using your reproducable steps.

 

But if *you* cannot reproduce the bug, then there is nothing to do here. So far we have no evidence that you can reproduce the bug yourself, because you have not taken the effort to outline the steps to reproduce it.

 

I am saying this in the spirit of helping you learn how to lodge bugs, and get better help on the forum.

- Mark