0 Replies Latest reply on Aug 11, 2011 3:31 AM by wait andrew

    server datamerge .net crash

    wait andrew

      I am trialling indesign server

       

      I have successfully created a js based datamerge using the soap example

       

      I am now trying to do this programatically (e.g. directly interfacing with the server objects)

       

      In both C# and VB I am getting a crash everytime I execute the datamerge MergeRecords function.

       

      Below is the script I am running, with comments, if the doc.DataMergeProperties.MergeRecords("c:/temp/wibble.txt") line is commented out the script will execute fine, uncomment it and the whole thing crashes, including the server, when another function is called afterwards.

       

      This is driving me mad

       

      Any help appreciated

       

       

      Option Explicit Off

       

      Partial Class vbcreate

          Inherits System.Web.UI.Page

       

          Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

      Response.Write("here")

       

      'Dim app As InDesignServer.Application

      'Dim doc As InDesignServer.Document

       

      app = CreateObject("IndesignServer.Application")

       

      doc = app.Open("C:/Adobe InDesign CS5.5 Server SDK/samples/sampleclient-aspnet-soap/files/template2.indd")

       

      '''''' Below returns 1 so OK up to here

      Response.Write(app.Documents.Count)

       

       

      ds = "C:/Adobe InDesign CS5.5 Server SDK/samples/sampleclient-aspnet-soap/files/CSV/xls.csv"

       

       

      app.dataMergeOptions.removeBlankLines = True

       

      doc.DataMergeProperties.SelectDataSource(ds)

       

      '''''' Below still returns 1 so still working

      Response.Write(app.Documents.Count)

       

      ''''' the wibble file is created but then the application CRASHES

      doc.DataMergeProperties.MergeRecords("c:/temp/wibble.txt")

       

       

      '''''''EITHER of these two next lines will cause a crash

      Response.Write(app.Documents.Count)

      'doc.close(InDesignServer.idSaveOptions.idNo)

       

       

      'Response.Write(app.Documents.Count)

       

       

       

       

       

      End Sub

      End Class