When I run the following C#.net code, I end up with an in design document with blank gray pages. Any ideas of what I could be doing wrong? I am using a trial version of IndesignServer CS5.
string iddFilePath = @”c:test.indd”;
string pdfFilePath = @”c:test.pdf”;
var myApp = (InDesignServer.Application)(System.Runtime.InteropServices.Marshal.BindToMoniker(configName));
var myDoc = myApp.Documents.Add();
var myPage = (InDesignServer.Page)(myDoc.Pages.FirstItem());
myApp.PDFPlacePreferences.PDFCrop = idPDFCrop.idCropMedia;
int counter = 1;
int firstPage = -1;
while (true)
{
if (counter > 1)
myDoc.Pages.Add();
myApp.PDFPlacePreferences.PageNumber = counter;
var pdfPage = myDoc.Pages[-1].Place(pdfFilePath, new int[] { 0, 0 });
pdfPage = pdfPage.Item[1];
if (counter == 1)
{
firstPage = pdfPage.PDFAttributes.PageNumber;
}
else if (pdfPage.PDFAttributes.PageNumber == firstPage)
{
myDoc.Pages[-1].Delete();
break;
}
counter++;
}
myDoc = (InDesignServer.Document)(myDoc.Save(iddFilePath, false, string.Empty, false));
myDoc.Close(InDesignServer.idSaveOptions.idNo,iddFilePath, string.Empty, false);