-
Notifications
You must be signed in to change notification settings - Fork 22
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
Doesn't print #2
Comments
Hi, @Stryno. Could you please serialize and send me your var request = new GetJobAttributesRequest {PrinterUri = new Uri(@"ipp://" + printerIP + ":631"), JobId = jobId};
var response = client.GetJobAttributesAsync(request); There may be some strange values for the job which seems like unsuccessful. |
Hi @Zelenov, I have changed method to async and now am getting error: This exception was originally thrown at this call stack: SharpIpp.Exceptions.IppResponseException This exception was originally thrown at this call stack: |
The code looks almost the same:
|
This code resembles somewhat like Also, try printing without unnecessary parameters at all: var request = new PrintJobRequest
{
PrinterUri = printerUri,
Document = stream
}; |
Hi @Zelenov, |
It turned out the guilty property is DocumentFormat = "application /octet-stream" I don't really need this so can comment it out. Is there a way to set Color / BW ? Thank you |
var request = new PrintJobRequest
{
PrinterUri = printerUri,
Document = stream
AdditionalJobAttributes = new IppAttribute[]
{
new IppAttribute(Tag.Keyword, "print-color-mode", "monochrome")
}
} Available values of var request = new GetPrinterAttributesRequest {PrinterUri = xxxx};
var response = await client.GetPrinterAttributesAsync(request);
var supported = res.Sections.FirstOrDefault(s=>s.Tag==SectionTag.PrinterAttributesTag)
?.Attributes.Where(a => a.Name == "print-color-mode-supported")
.Select(a => a.Value.ToString())
.ToArray() ?? new string?[0]; |
@Zelenov - thank you very much for your support. |
Try updating SharpIpp to the latest version. I've just updated it a week ago Or use AllAttributes in the current version |
Could you please send me serialized |
Here you go: ipp://BRWB010412572B6.local./ipp/print none none BRWB010412572B6 Brother MFC-9340CDW http://BRWB010412572B6.local./net/net/airprint.html Brother MFC-9340CDW Idle none 1.0 1.1 2.0 PrintJob ValidateJob CancelJob GetJobAttributes GetJobs GetPrinterAttributes false utf-8 utf-8 en en fr application/octet-stream application/octet-stream image/urf image/pwg-raster false 0 false attempted 287777 None 23 23 V11 SuccessfulOk 1 OperationAttributesTag PrinterAttributesTag |
hmm it strips off all XML tags |
Put you reply between triple tildas
|
|
That's after upgrading to 0.9.0 |
Seems like response is not that great in xml serialization: all the attributes are empty. Could you please serialize it to json? I would add a better xml serialization and |
I tried to set Also I set Sides = 2 which is supposed to be Duplex Vertical and it doesn't work either - prints two sheets of paper instead of one two-sided sheet. |
{ |
@Zelenov Hi Evgeny - any chance you'd get back to this project any time soon? Thank you |
Hi, have no color ipp-printer available. The only way I can debug this stuff is if someone gives me access to it. On the other hand, your output seems ok (no errors at least). |
Hi Evgeny,
I found SharpIpp on Nuget and it's what I need - send PDF file to a printer using IP. I tried to use it (got rid of async stuff though). It returns no error but the document is not printed. Not sure how to troubleshoot it as it's using client.PrintJobAsync(request) which returns OK. I'd appreciate any help.
Thank you,
Yuri
public static bool PrintPDFIPP(string printerIP,
string filename,
string paperName = null,
int copies = 1,
bool? isColor = null,
Duplex duplex = Duplex.Default)
{
var stream = File.Open(@filename, FileMode.Open);
var printerUri = new Uri(@"ipp://" + printerIP + ":631");
var request = new PrintJobRequest
{
PrinterUri = printerUri,
Document = stream,
JobName = Path.GetFileName(filename),
IppAttributeFidelity = false,
DocumentName = Path.GetFileName(filename),
DocumentFormat = "application /octet-stream",
DocumentNaturalLanguage = "en",
MultipleDocumentHandling = MultipleDocumentHandling.SeparateDocumentsCollatedCopies,
Copies = copies,
Finishings = Finishings.None,
//PageRanges = new[] { new Range(1, 1) },
Sides = (Sides)duplex,
//NumberUp = 1,
//OrientationRequested = Orientation.Portrait,
//PrinterResolution = new Resolution(600, 600, ResolutionUnit.DotsPerInch),
//PrintQuality = PrintQuality.Normal
};
SharpIppClient client = new SharpIppClient();
var response = client.PrintJobAsync(request);
return true;
}
The text was updated successfully, but these errors were encountered: