Similar to CReadFaxFile usage CWriteFaxFile also has three steps::
The following code snippet shows the usage:
//Create err variable and descriptors for panics while creating and opening file TInt err; _LIT(KFaxFileName, "c:\\file.fax"); _LIT(KPanicOpeningWriteFile,"Opening write file"); //Create scan line write buffer and set its size TBuf8<216> scanlineWrite; scanlineWrite.SetLength(216); _LIT(KPanicAddScanLine,"Adding scanline"); TInt row, numberLines; //Create and open fax file.If there is an error then panic TRAP(err,writeFaxFile->OpenL(KFaxFileName,64)); if (err!=KErrNone) User::Panic(KPanicOpeningWriteFile,err); //set the resolution as normal, and the encoding as MH iWriteFaxPages->StartPage(EFaxNormal, EModifiedHuffman); // iterate through the scan lines, adding them to the page for (row=0; row<numberLines; row++) { scanlineWrite[0] = TUint8(row); // create test scan line — for which the first byte is the current line number // add test scan line. Panic if there is an error adding line TRAP(err,writeFaxFile->iWriteFaxPages->AddScanLineL(scanlineWrite)); if (err!=KErrNone) User::Panic(KPanicAddScanLine,err); } _LIT(KPanicEndingPage,"Ending page"); // call EndPageL() under a trap harness. Panic if error saving page information TRAP(err,writeFaxFile->iWriteFaxPages->EndPageL(EFaxFine,senderId)); if (err!=KErrNone) User::Panic(KPanicEndingPage,err); _LIT(KPanicCommittingPages,"Committing pages"); //Call CommitL() under a trap harness. Panic if error commiting page TRAP(err,writeFaxFile->CommitL()); if (err!=KErrNone) User::Panic(KPanicCommittingPages,err); writeFaxFile->Close();
Fax file storage can be aborted at any time using CWriteFaxFile::AbortWrite(). The function first
aborts the storing operation, and then deletes the file. It can be called at any point prior to closing
the file.
writeFaxFile->AbortWrite();
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Fax Client API on Series 60 | synov | General Symbian C++ | 2 | 2006-02-23 13:13 |
| Fax API problem | synov | General Symbian C++ | 0 | 2002-11-12 06:14 |