0

How can I make InDesign render a region of a page, as it would be rendered when exporting the whole file?

I know I can render a PageItem using the exportFile function, but this will ignore any other PageItems sharing the same region.

My current solution is to make a new document the size of the region of interest, with a copy of each PageItem whose coordinates fall into that region. It’s very inelegant, and it seems it cannot be done without the user seeing windows meaningless to them come and go.

Another approach I can think of is to export the whole spread containing the region, then crop the resulting file using something like ImageMagick. But I’d still prefer to be able to render only the region I need, if possible.

  • A possible approach would be to load the indd file as an asset , reframe to the specific area and export the page item. – Loic May 28 '18 at 16:16
  • @Loic Interesting, but is it possible to reframe and render the asset without placing it (which I assume would mean opening a new document)? – Philippe-André Lorin May 28 '18 at 16:33
  • Well I guess you could temporarly change page bounds to make it frame the content you are after. Or duplicate contents and place it inside a container. No matter what you will need a physical object to output. – Loic May 29 '18 at 11:36

2 Answers2

1

You can open the InDesing document without showing its UI as well. app.open(filepath, false); and while closing the doc, simple use doc.close(SaveOptions.NO); You anyways don't need to save that doc on disk. This will let you have the document open without showing its UI at all.

0

I did something like this recently. Here are my steps:

  • duplicate all spread items and group them
  • make a frame with a proper size/position
  • cut and paste the group into this frame
  • export the frame as PNG

If you need another region on this spread you don't need to repeat all the steps, you can change size and position of the frame and to export it again.

There is a limitation: master page items will be omitted.

Yuri Khristich
  • 13,448
  • 2
  • 8
  • 23