InDesign documents consist of spreads, i.e. sets of pages that are located next to each other.
Books typically have two pages per spread but leaflets or other kinds of documents can have more.
The Pages panel within InDesign contains a thumbnail for each page and shows how the pages are organized into spreads:

It is quite easy to generate a similar, customized document representation using DocMaker 3.0. The API closely mimics the InDesign document structure,
so you can enumerate the spreads in the document and the pages in each spread.
Thumbnails for pages can be obtained with the GetThumbnailPath() method (use GetPreviewPath() when you need larger previews).
Use the SpreadOverviewIndex property to give you the spread column index for each page.
The following code shows how everything fits together:
| C# |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using Adam.Core;
using Adam.Core.Records;
using Adam.Core.Search;
using Adam.DocMaker.Core;
namespace DocMakerSamples
{
class SpreadVisualization
{
public static void Main()
{
Application application = new Application();
if (application.LogOn("username", "password") == LogOnStatus.LoggedOn)
{
Record record = new Record(application);
record.Load(new SearchExpression("File.Version.FileName = 'brandbook.indd'"));
using (Document document = Document.CreateFromFile(record.Files.Master))
{
// Pick a sensible size for the page thumbnails.
Image firstThumbnail = Image.FromFile(document.Pages.First().GetThumbnailPath());
int cellWidth = firstThumbnail.Width / 2;
int cellHeight = firstThumbnail.Height / 2;
// Add some padding space around the thumbnails.
const int padding = 5;
int paddedWidth = cellWidth + (2 * padding);
int paddedHeight = cellHeight + (2 * padding);
// Create an image to draw all the spreads on.
int columns = document.Spreads.SpreadOverviewColumns;
int rows = document.Spreads.Count;
Bitmap bitmap = new Bitmap(columns * paddedWidth, rows * paddedHeight);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
// Fill in the background color and draw a border around the canvas.
Pen borderPen = new Pen(Color.Black, 1);
graphics.FillRectangle(Brushes.LightGray, 0, 0, bitmap.Width, bitmap.Height);
graphics.DrawRectangle(borderPen, 0, 0, bitmap.Width - 1, bitmap.Height - 1);
// Enumerate the document spreads and all pages in each spread.
List<Spread> spreads = document.Spreads.ToList();
for (int spreadIndex = 0; spreadIndex < spreads.Count; ++spreadIndex)
{
foreach (Page page in spreads[spreadIndex].Pages)
{
// Position of the thumbnail depends on the spread's index and the page's SpreadOverviewIndex.
int cellX = (page.SpreadOverviewIndex * paddedWidth) + padding;
int cellY = (spreadIndex * paddedHeight) + padding;
Rectangle cellBox = new Rectangle(cellX, cellY, cellWidth, cellHeight);
// Draw the page's thumbnail with a border around it.
graphics.DrawImage(Image.FromFile(page.GetThumbnailPath()), cellBox);
graphics.DrawRectangle(borderPen, cellBox);
}
}
}
// Save the image to disk.
bitmap.Save(Path.Combine(Path.GetTempPath(), "Spreads.png"), System.Drawing.Imaging.ImageFormat.Png);
}
}
}
}
}
|
Below you see the image that is output when running the code. This already closely resembles the Pages panel shown above.
Of course this can be further finetuned or customized at will, e.g. by using the PageNumber and Side properties to add page numbers and page sides.
