wpf - Saving and printing XPSDocument through Paginator (seems to)causes a rasterization of the content -
I am using a WPF printing path to handle large diagrams created in our application. The entire diagram contains views.
A so-called "designerpaginator" depicts the picture (it is quite easy). From this point, I do the following three things: - I print the document with print dialliag. Print Document (Pageinator, Title) - I also make an XPS document with the Exps Document Writer. White (Pageinator, PrintTicket); What I save on HDD - I provide the XPS documentware writer to the XPS document. In a document viewer, the following code is important:
PrintDialog _pdialog = new PrintDialog (); System.Printing.ValidationResult Results = this.PrintQueue.MergeAndValidatePrintTicket (this.printqu.UserPrintcontent, this.printultate); _pdialog.PrintTicket = Result. Validity per ticket; XpsDocument _xpsDocument = New XpsDocument ("C: \\ test.xps", FileAccess.ReadWrite); XPS Docuation Extract xpsdw = XpsDocument.CreateXpsDocumentWriter (_xpsDocument); Xpsdw.Write (this.pignator, results. Validity ticket); Documentviewer.Document = _xpsDocument.GetFixedDocumentSequence (); _xpsDocument.Close (); _pdialog.PrintQueue = this.PrintQueue; _pdialog.PrintDocument (This programmer, "Model Test");
The output is low:
Exps on HDD -> You can not recognize anything blurry, it's like a GIF file with a 100x zoom. DocumentViewer -> Perfect Documents Needed with XPSDocument in Perfect - It should be that the printout of the XPS file should be -> terrible, blurred, but at least xps file is very good
and now the mysterious part: if I I print directly with the DocumentViewer, which seems correct document succes), I get the same blurry output from the first print.
My view of this matter is that the WPPS XPS system underlines the content and puts the Bittemap in the form of low quality in the XPS system. This is all vectors, and despite this fact the product is always familiar with the low resolution bitmap.
I appreciate any help I am out of ideas. I tried to do a lot to debug this problem, but in some way it seems to be something simple and fragile at the same time Happening.
I came to know how to avoid my problem, but I can not guarantee the solution In fact, it seems that using two nested visual bows on your scene, you are using results in blurry output.
We can not save from the visuals used in a WPF printing: it is the one that the Pageinator has to cut our visuals and distribute it on multiple pages. I also had a user control that served as a "template". I have to draw a rectangle with the visuals of our diagram in UserControl, and only after this operation, UserControl pulls itself on pages by a visitor as a rectangle with a visitor. Since the WPF printing path uses XPS for printing, you can also create an XPSDocument, change the file type to Zip, remove it and analyze one page of your document with any text editor. can do. This will be very helpful in understanding your problem.
I also suspect that the document is "rasterized" if the contents of the visualbrush are not applied in the visual with the original 1: 1 height / width ratio. The mistakes within the resizing calculation were taken to the height / width ratio for the visual saw used in 1: 0.9 9 48, and this resulted in a bleak output (excluding "nested visualbush" problem).
It is still just a doubt. My problem has been solved by leaving the "extra" visible brush and respecting the original aspect ratio. It is also possible to believe that one / or both problems appear in combination with only a certain visual / effect / conversion or rainbow brush.
At least, once I think of issues such as WPF printing paths: think about the fact that your things always change into the XPS behind the scene, and the XPS is similar to the WPF But, WPF does not support anything. In fact, if I was not misunderstood, XPS was inspired in XFAM in WPF.
I too welcome this problem My problem has been solved, but I want to know why this happened.
Comments
Post a Comment