C# implementation of Internet Printing Protocol/1.1.
It can print! And do other stuff with any printer, connected via Internet.
SharpIpp
is still in development. Currently available operations are
Available on nuget
PM> Install-Package SharpIpp
Prints file (pdf or txt). Returns new job info
await using var stream = File.Open(@"c:\file.pdf", FileMode.Open);
var printerUri = new Uri("ipp://192.168.0.1:631");
var request = new PrintJobRequest
{
PrinterUri = printer,
Document = stream,
JobName = "Test Job",
IppAttributeFidelity = false,
DocumentName = "Document Name",
DocumentFormat = "application/octet-stream",
DocumentNaturalLanguage = "en",
MultipleDocumentHandling = MultipleDocumentHandling.SeparateDocumentsCollatedCopies,
Copies = 1,
Finishings = Finishings.None,
PageRanges = new[] {new Range(1, 1)},
Sides = Sides.OneSided,
NumberUp = 1,
OrientationRequested = Orientation.Portrait,
PrinterResolution = new Resolution(600, 600, ResolutionUnit.DotsPerInch),
PrintQuality = PrintQuality.Normal
};
var response = await client.PrintJobAsync(request);
Returns printer info (state, version, etc)
var printerUri = new Uri("ipp://192.168.0.1:631");
var request = new GetPrinterAttributesRequest {PrinterUri = printerUri };
var response = await client.GetPrinterAttributesAsync(request);
Returns job info (state, dates, pages)
var printerUri = new Uri("ipp://192.168.0.1:631");
var request = new GetJobAttributesRequest {PrinterUri = printer, JobId = 1};
var response = await client.GetJobAttributesAsync(request);