I need to print 5 different documents. 4 of them are A4 portrait and these are going OK. But the last one is A3 landscape and Amyuni is printing it as A4 portrait.
I've search this forum and I stumbled on the setPaperSize and setPaperOrientation methods, but I can't find those methods in my C# code.
Here's my class I'm using:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
using CDIntf;
namespace FillInWord
{
class Amyuni
{
private CDIntf.CDIntfControl cdiNet = null;
private Log Logger = new Log();
/// <summary>
/// Constructor
/// </summary>
public Amyuni()
{
try
{
cdiNet = new CDIntf.CDIntfControl();
cdiNet.DriverInit(Declarations.PrinterName);
return;
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
throw ex;
return;
}
}
public Boolean printSettings(string pdfFile)
{
try
{
Logger.Write("Setting printersettings for Amyuni ... ");
// Set the Printer as Default, this is needed only if you can not print to a specific printer
cdiNet.SetDefaultPrinter();
//cdiNet.SetDefaultConfig();
cdiNet.FileNameOptions = Declarations.NoPrompt + Declarations.UseFileName;
cdiNet.DefaultFileName = pdfFile;
// Enable the printer before each printout for the Developer version
cdiNet.EnablePrinter(Declarations.LicensedTo, Declarations.ActivationCode);
//Logger.WriteLine("Amyuni returned: " + cdiNet.GetLastErrorMsg());
Logger.WriteLine("OK");
return true;
}
catch (Exception ex)
{
Logger.WriteLine("ERROR");
Logger.WriteLine("Amyuni returned: " + cdiNet.GetLastErrorMsg());
Logger.WriteLine(ex.ToString());
return false;
}
}
/// <summary>
/// Destructor
/// </summary>
~Amyuni()
{
try
{
if (cdiNet != null)
{
cdiNet.RestoreDefaultPrinter();
cdiNet.FileNameOptions = 0;
cdiNet.DriverEnd();
cdiNet.Dispose();
cdiNet = null;
}
return;
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
return;
}
}
}
}
Please advise how to proceed.
Thanks
Paul
The Netherlands