Here is a code sample using temp storage together with jobticket and production classes:
//set some variables
string username = "xxx";
string password = "yyy";
string remotedatafile = @"c:\temp\contacts2.csv";
int bufferSizeInBytes = 128;
string docID = "222";
//do the file upload to temp storage
xmp_ts.TempStorage_SSP tempStorage = new xmp_ts.TempStorage_SSP();
string tempFolder = tempStorage.CreateFolder(username, password);
string fileToken = tempStorage.AddFileToFolder(username, password, tempFolder, System.IO.Path.GetFileName(remotedatafile));
System.IO.FileStream fs = new System.IO.FileStream(remotedatafile, System.IO.FileMode.Open, System.IO.FileAccess.Read);
int numToRead = (int)fs.Length;
int bytesRead = 0;
byte[] buffer = new byte[bufferSizeInBytes];
while (numToRead > 0)
{
bytesRead = fs.Read(buffer, 0, bufferSizeInBytes);
if (bytesRead > 0)
{
bool ret = tempStorage.AppendFileBinaryStream(username, password, fileToken, buffer);
numToRead -= bytesRead;
}
}
//create the recipient info
xmp_jt.RecipientsInfo ri = new xmp_jt.RecipientsInfo();
ri.m_Filter = System.IO.Path.GetFileName(fileToken);
ri.m_FilterType = 3;
//create the connection string
xmp_jt.Connection conn = new xmp_jt.Connection();
conn.m_ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.IO.Path.GetDirectoryName(fileToken) + ";Extended Properties=text;";
conn.m_AdditionalInfo = System.IO.Path.GetFileName(fileToken) + "@,@,";
conn.m_Type = "TXT";
//create job ticket
xmp_jt.JobTicket_SSP jt = new xmp_jt.JobTicket_SSP();
string jtid = jt.CreateNewTicketForDocument(username, password, docID, "", false);
jt.SetOutputInfo(username, password, jtid, "PDFO", 1, null, null, null);
jt.SetJobType(username, password, jtid, "PRINT");
jt.SetRI(username, password, jtid, ri, conn);
//submit the job
xmp_p.Production_SSP prod = new xmp_p.Production_SSP();
string jobid = prod.SubmitJob(username, password, jtid, "0", null, null);
//return the jobid to the user or do something else with it
Label1.Text = jobid;
//remember to delete the temp storage folder and contents after production is completed