Orphaned Printers

Raster-XChange SDK (all versions)
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's Raster-XChange Printer Drivers SDK (only).

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
John - Tracker Supp
Site Admin
Posts: 8201
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Orphaned Printers

Post by John - Tracker Supp » Mon Aug 02, 2010 5:13 pm

Placed on behalf of : Kalyan.Chakkravarthy

We are using Raster-XChange printer to print the output to TIFF format in our application. We are using C# code to implement it. When ever we take new instance of Raster-XChange printer its creating a new object and those objects are not killing and they are listed in the printers (Control Panel) list always. Please find the attachment.

We are using the below code which we have got at Raster-XChange SDK.

m_PrinterFactory = new RXCCOMLib.PrinterFactoryClass();

m_Printer = (RXCCOMLib.Printer)m_PrinterFactory.get_Printer("", "");

if (m_Printer == null)

return;

AttachToEvents();

m_Printer.ProtectionKey = "";

m_Printer.ProtectionDevCode = "";

m_DevMode = (RXCCOMLib.IDevMode)m_Printer.DevMode;

m_DevMode.Format = RXCCOMLib.ImageFormat.format_TIFF;

m_DevMode.set_FormatParameter("Image Type", "BW:1");

m_DevMode.set_FormatParameter("Compression", "CCITTFax4");

txtPrinter.Text = m_Printer.Name;

txtDst.Text = m_DevMode.OutputFileName;

txtPaperW.Text = ((int)m_DevMode.PaperWidth / 10).ToString();

txtPaperL.Text = ((int)m_DevMode.PaperLength / 10).ToString();

if (m_DevMode.PaperOrientation == DMORIENT_PORTRAIT)

rdoPortrait.Checked = true;

else

rdoLandscape.Checked = true;


Kindly support me on the above and suggest us how to proceed.


Regard
KAlyan



raster.JPG
Attachments
raster.zip
(36.08 KiB) Downloaded 243 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

User avatar
Roman - Tracker Supp
Site Admin
Posts: 265
Joined: Sun Nov 21, 2004 3:19 pm

Re: Orphaned Printers

Post by Roman - Tracker Supp » Mon Aug 02, 2010 6:03 pm

Raster-XChange temporary printer is deleted when the corresponding IPrinter interface is Released (in other words when the interface's wrapping object is destroyed). Probably you experience this problem due to undetermined object destruction in .NET. Please make sure the RXCCOMLib.Printer objects you implicitly create through m_PrinterFactory.get_Printer are destroyed as soon as possible when they are not needed.

If the problem persists please provide a minimal but complete sample application (along with sources) to let me replicate the issue.
Tracker Software Products

Please ZIP any files uploaded to this forum or they will not be posted !
You may also use a RAR or 7Z archive format

Post Reply