dymosoftware / DCD-SDK-Sample

DYMO Connect SDK Samples
Other
60 stars 27 forks source link

Any way to get an error when PrintLabel() doesn't work and returns false? #69

Open bubblesnout opened 2 years ago

bubblesnout commented 2 years ago

I have a valid IDymoPrinter object and a iDymoLabel object, I can render a preview on-screen via the GetPreviewLabel() function of the IDymoLabel with no issues. When I run PrintLabel() passing in the IDymoLabel object and the name of the Dymo printer it uisually works, but at random it seems to fail to send the print job to the printer at all, instead the PrintLabel() function simply returns false to advise that it failed. As mentioned this seems to happen completely at random so I'm trying to debug this but I can't see any way to actually present any meaningful error I can use to troubleshoot.

How might I proceed?

bubblesnout commented 2 years ago

To anybody that comes across this, while I didn't get an answer on how to get a meaningful error out of the PrintLabel() function when it fails I was able to resolve my issue.

I made contact with the developers of the SDK, which you can also do by sending an email to SDKReply@newellco.com

The solution to my problem was to ensure GetPrinters() on your DymoPrinter instance before attempting to call PrintLabel(). It seems this call refreshes the status of the attached Dymo printer(s) allowing you to print to them.