Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetPrinterAttributesAsync() throws "0 length attribute name found not in a 1setOf" from Lexmark printers #3

Open
xqrzd opened this issue Dec 9, 2024 · 2 comments
Labels
question Further information is requested

Comments

@xqrzd
Copy link

xqrzd commented Dec 9, 2024

It seems to have regressed from this commit, 37b0660
Reverting to the prior implementation of GetNormalizedName() fixes the issue,

var normalizedName = string.IsNullOrEmpty(name) && prevAttribute != null ? prevAttribute.Name : name;
if (string.IsNullOrEmpty(normalizedName))
{
    throw new ArgumentException("0 length attribute name found not in a 1setOf");
}

When the exception is thrown in GetNormalizedName(), tag is Keyword, name is an empty string, and prevAttribute is two-sided-long-edge. If it's helpful I can attach the binary response from the printer.

@danielklecha
Copy link
Owner

@xqrzd Sorry, I missed notification.
If the tag is Keyword, the name is an empty string, and the prevAttribute is two-sided-long-edge, then why was return prevAttribute.Name; not used?
Is prevAttribute.Name also an empty string?
Even if you have 3 attributes with the same name then previous value should be calculated correctly.

@danielklecha danielklecha added the question Further information is requested label Jan 12, 2025
@danielklecha
Copy link
Owner

danielklecha commented Jan 12, 2025

I searched for public printers.
I tested GetPrinterAttributesAsync with:

  • Lexmark X464de
  • Lexmark M3150
  • Lexmark MS510
  • Lexmark T652

I didn't get an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants