PDA

View Full Version : TX Text Ctontrol does not fax


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);

Björn Meyer
February 20, 2004, 18:27:42
Hello Wim

We do not have any experience with that, but we will test it as soon as possible. I will get back to you soon.

Wim Sandra
February 26, 2004, 16:38:07
Bjorn,


This workaround solved my problem:

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.Readers.Fax.Win32.WinFax.FAX_CONTEXT_INFO();
WinFax.FAX_PRINT_INFO FaxPrintInfo = new OMS.Readers.Fax.Win32.WinFax.FAX_PRINT_INFO();

long JobId;



FaxContextInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_CONTEXT_INFO));
FaxPrintInfo.SizeOfStruct = Marshal.SizeOf(typeof(WinFax.FAX_PRINT_INFO));

FaxPrintInfo.RecipientNumber = info.CarrierAddress;

if (!WinFax.FaxStartPrintJob(null,ref FaxPrintInfo,out JobId,ref FaxContextInfo) )
{
int pages = txText.CurrentPages;

for (short i = 1; i <=(short)pages ; i++)
{
StartPage(FaxContextInfo.hDC);

txText.PrintDevice = FaxContextInfo.hDC;
txText.PrintPage(i);

EndPage(FaxContextInfo.hDC);
}

EndDoc(FaxContextInfo.hDC);