Click here to Skip to main content
15,905,233 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Scroll Viewer and inside that a text block with multiple pages contents. How can I print everything within the Scroll Viewer.I'm Using WPF MVVM pattern. Is text block is the right control for this?Or shall I go for any other WPF controls.?

Thanks in advance..
Posted

I don't know what is exactly the problem,But something related to Printer.

From Control Panel->Printers & Fax

1.Right Click the Printer and take Printer preferences
2.Change the Source property to 'Manual Feed'& Apply.(Initially it was'AutoSelect')
3.Still got some error.
4.Again me changed the Source property back to 'Auto Select'& Apply.
5.Changed the Quick set Property to 'Defaults'& Apply
5.Now its Working Fine
 
Share this answer
 
These two clauses contradict: "How can I print everything within the Scroll Viewer?" and "I'm using WPF MVVM pattern". If you really used MVVM, you would print not the content of the scroll viewer and not the window; you would print the data of the Model. MVVM Model comes in two flavors: object-oriented approach or data-centric approach. In both cases you have data; either describing the real state content of the data content accessed via the data access layer. See http://en.wikipedia.org/wiki/MVVM[^].

You can use data to compose XPS document out of it which can be printed. Please see http://msdn.microsoft.com/en-us/library/ms742418.aspx[^]. It can resemble your window as much as you can but certainly will not include limitations of the vertical size typical for the on-screen window and scroll controls :-).

—SA
 
Share this answer
 
Comments
CGN007 22-Jul-11 0:43am    
Actually my Print Icommand from the ViewlModel gets the textBlocks contents.But
I'm Getting the following error while printing

PrintTicket provider failed to retrieve PrintCapabilities. Win32 error.

Here is my Code to Print

printDlg.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing.");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900