Copy link to clipboard
Copied
In order to achieve what I think you want to achieve - you would've to pasteinto your table into a Rectangle then Anchor / InLine your Rectangle into another TextFrame.
Copy link to clipboard
Copied
> take a table which is inside a text frame and "pasteInto" the same text frame, so that the table clipped to the text frame dimensions.
This isn't very clear. Please explain in more detail, with a screenshot of the before and after situations of what you want to achieve.
As to pasteInto, in scripting you'd use duplicate() or move(), thay're more reliable, and you can maintain references. Much more robust than copying and pasting.
Copy link to clipboard
Copied
Sure. My situation is like so:
I have a blue swatch table which is inside a red swatch text frame:
The Layers show up like so:
What I am after, is to start from the above layout, and then clip the table to the bounds of the text frame like so while retaining the blue as the table Text Frame and the Red as the Text Frame.
Unfortunately the Layer window reports that the blue frame is now "graphics frame" instead of the Text Frame
Thanks
Copy link to clipboard
Copied
You can't clip a table like that. The only way to achieve that is what InDesign already does for you: convert the frame with the table to a graphic.
You could cover the extending part of the table with a text frame and give it the Paper fill and group the whole thing, that's the closest you'll get I think.
Copy link to clipboard
Copied
I tried those steps in InDesign and it works the exact same was the script does. I am purusing this approach based on the discussion at Solved: Re: Clipping of InDesign table - Adobe Community - 14920622
Might I have missed something?
Copy link to clipboard
Copied
That solution doesn't work for me.
Copy link to clipboard
Copied
You mean red frame is a graphic frame?
If you've a TextFrame - you can only Anchor / InLine other objects - as characters.
Copy link to clipboard
Copied
In order to achieve what I think you want to achieve - you would've to pasteinto your table into a Rectangle then Anchor / InLine your Rectangle into another TextFrame.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Ok. I tried "pasteInto" of my table into the Rectangle. The (erstwhile) Rectangle is now showing up as a <graphic frame>. How do I get this into the Rectangle as a Text Frame?
Copy link to clipboard
Copied
Ok. I tried "pasteInto" of my table into the Rectangle. The (erstwhile) Rectangle is now showing up as a <graphic frame>. How do I get this into the Rectangle as a Text Frame?
By @asaxena
As I said before - now, you need to Anchor / InLine this Rectangle in another TextFrame.
But what exactly is your end goal?
Copy link to clipboard
Copied
Ok. I tried "pasteInto" of my table into the Rectangle. The (erstwhile) Rectangle is now showing up as a <graphic frame>. How do I get this into the Rectangle as a Text Frame?
By @asaxena
As I said before - now, you need to Anchor / InLine this Rectangle in another TextFrame.
But what exactly is your end goal?
By @Robert at ID-Tasker
The use case is that only some of the (potentially numerous) columns of (potentially numerous) tables need to be be visible for publication. However, at present, all the columns of the tables are being paginated by our plugin. So, we need to be able to provide a way for the user to be able to hide/clip the unrequired columns on the document for purposes of publishing
Copy link to clipboard
Copied
No, matter what I try, I land up in having the Rectangle (after pasteInto of the table) as a graphic frame inline in the Text Frame. I am using the blue marker (with Shift) to drag the Rectange as inline anchored object in the Text Frame. Please suggest what I might be missing.
Thanks
Copy link to clipboard
Copied
You cannot clip a table and keep it as a text object. It's just impossible. As stated earlier (and in the link you provided) the only two ways are:
1. Convert to a graphic
2. Mask the parts you want to make invisible.
Note that the answer marked as correct in the other post claims only that part of the table will be visible after the paste. It doesn't say that the table remains a text object.
Masking the parts that stick out of the frame is very simple, by the way: you just place text frames (or rectangles (paper fill, no stroke) on top of the parts you want to hide. Easy to script too.
Copy link to clipboard
Copied
No, matter what I try, I land up in having the Rectangle (after pasteInto of the table) as a graphic frame inline in the Text Frame. I am using the blue marker (with Shift) to drag the Rectange as inline anchored object in the Text Frame. Please suggest what I might be missing.
Thanks
By @asaxena
And now resize your "graphic frame" - use it as a "clipping frame".