How about using Data Merge with empty fields?
Can't use data merge.
Creating 300 pages takes almost forever. Is there anyway to speed this up?
Page firstPage = doc.Pages;
for(int i=0; i < 300; i++)
Why not? Again, don't use Data Merge for your data. Just use it to create all the pages.
Basically, in my template I have 3 pages.
First page is TOC page.
Second and Third page are course pages containing the "xml structure" for xml import.
When I data merge it, I want it to "duplicate" those second and third pages for each xml node.
I created a sample csv file containing the records:
Then I set the data source to the csv file....so how do I know tell the data merge to just create the course pages?
Alternatively, I can do this to duplicate the pages which seems VERY fast. HOWEVER, how do I set the geomtric bounds and the xml structure? Each of those page items has an xml element associated with it.
for (int i = 0; i < 300; i++)
Page newPage = doc.Pages.Add(idLocationOptions.idAtEnd, Type.Missing);
foreach(dynamic a in leftPage.AllPageItems)
I'd probably do it something like this:
doc.documentPreferences.pagesPerDocument = 303;
//group the page items
//loop thorugh the addedPages
//ungroup as necessary...
FWIW, I avoid InDesign XML like the plague. I've had too many bad experiences with it. I use standard InDesign objects and I process xml using scripting and E4X instead.
I tried this:
Document a = OpenCourseTemplate();
a.DocumentPreferences.PagesPerDocument = 303;
Page page = doc.Pages;
Group g = doc.Groups; //The grouped textframes on page 1
for(int i=3; i < doc.Pages.Count; i++)
Page a= doc.Pages[i];
doc.Save(Utility.MergedFolder + "\\test_size.indd");
It doesn't work because g.Duplicate(aa, Type.Missing); throws a return argument has an invalid type exception.
Any idea why it doesn't work?
doc.DocumentPreferences.PagesPerDocument works perfectly!
The only problem is that I need these blank pages created BETWEEN page 1 and 2. Is there any options I can specify for this to happen?
There are not so many questions here that it is helpful for you to ask your tangential questions in a new thread. I would venture to say that it probably will make it harder for you to get answers if you do that.
p.s.: you could try moving page 2 to page 52.