Wim Sandra
February 20, 2004, 09:40:41
We do not succeed in having the txtextcontrol print to a fax machine. We get the error "Failure to print page". Any ideas where we have to look?
Below, you can find the source code.
Tx4oleLib.ILicManager licenceManager = new Tx4oleLib.TXLicenseManagerClass();
Tx4oleLib.TXTextControlClass txText = new Tx4oleLib.TXTextControlClass();
txText.EnableAutomationServer();
txText.ResetContents();
txText.ViewMode = 2;
txText.PageHeight = 16837;
txText.PageWidth = 11906;
txText.PageMarginL = 567;
txText.PageMarginB = 567;
txText.PageMarginT = 567;
txText.PageMarginR = 567;
txText.LoadFromMemory(data,5,false);
WinFax.FAX_CONTEXT_INFO FaxContextInfo = new OMS.Services.Readers.Fax.Win32.WinFax.FAX_CONTEXT_ INFO();
WinFax.FAX_PRINT_INFO FaxPrintInfo = new OMS.Services.Readers.Fax.Win32.WinFax.FAX_PRINT_IN FO();
long JobId;
FaxContextInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_CONTEXT_INFO));
FaxPrintInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_PRINT_INFO));
FaxPrintInfo.RecipientNumber = "8401";
FaxPrintInfo.RecipientName = "test";
WinFax.FaxStartPrintJob(null,ref FaxPrintInfo,out JobId,ref FaxContextInfo);
txText.PrintDevice = FaxContextInfo.hDC;
txText.PrintDoc("automated fax job",1,(short)txText.CurrentPages,1);
Below, you can find the source code.
Tx4oleLib.ILicManager licenceManager = new Tx4oleLib.TXLicenseManagerClass();
Tx4oleLib.TXTextControlClass txText = new Tx4oleLib.TXTextControlClass();
txText.EnableAutomationServer();
txText.ResetContents();
txText.ViewMode = 2;
txText.PageHeight = 16837;
txText.PageWidth = 11906;
txText.PageMarginL = 567;
txText.PageMarginB = 567;
txText.PageMarginT = 567;
txText.PageMarginR = 567;
txText.LoadFromMemory(data,5,false);
WinFax.FAX_CONTEXT_INFO FaxContextInfo = new OMS.Services.Readers.Fax.Win32.WinFax.FAX_CONTEXT_ INFO();
WinFax.FAX_PRINT_INFO FaxPrintInfo = new OMS.Services.Readers.Fax.Win32.WinFax.FAX_PRINT_IN FO();
long JobId;
FaxContextInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_CONTEXT_INFO));
FaxPrintInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_PRINT_INFO));
FaxPrintInfo.RecipientNumber = "8401";
FaxPrintInfo.RecipientName = "test";
WinFax.FaxStartPrintJob(null,ref FaxPrintInfo,out JobId,ref FaxContextInfo);
txText.PrintDevice = FaxContextInfo.hDC;
txText.PrintDoc("automated fax job",1,(short)txText.CurrentPages,1);