Zelenov / SharpIpp

MIT License
41 stars 20 forks source link

Error Information: Reported by PDL invalidfont #25

Open jiweiqing opened 1 week ago

jiweiqing commented 1 week ago

Hi. I encountered a problem. Some PDF files cannot be printed successfully. The printed paper shows Error Information: Reported by PDL invalidfont. It seems to be a font problem. Can you help me find out where the problem is? Thank you! The following is my code. using SharpIpp; using SharpIpp.Models; using SharpIpp.Protocol.Models; using System.Reflection;

await using var stream = File.Open(@"ARC-------------------------------_DT_PDF_C07.pdf", FileMode.Open); var printerUri = new Uri("ipp://192.168.11.2:631"); HttpClient httpClient = new HttpClient(); ISharpIppClient client = new SharpIppClient(httpClient); var request = new PrintJobRequest { PrinterUri = printerUri, Document = stream, DocumentAttributes = new DocumentAttributes { DocumentName = "Document Name", DocumentFormat = "application/octet-stream", Compression = Compression.None, DocumentNaturalLanguage = "en", }, NewJobAttributes = new NewJobAttributes { Copies = 1, MultipleDocumentHandling = MultipleDocumentHandling.SeparateDocumentsCollatedCopies, JobName = "Test Job", IppAttributeFidelity = false, Finishings = Finishings.None, PageRanges = new[] { new SharpIpp.Protocol.Models.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);