How to use XPSViewer in Win32 based applications
hi:
Ihave a few qeutions to ask :
a)Our company's software(win32 based application) would spport xps file format, viewing and wirting the xps file. Could the XPSViewer be embeded in own software to view the xps file?
if can do, how to do? If can't, how to support to view the xps format file?
b)What are difference between win32 based application and WPF application? Could I use the new API classes under win32 based application? such asDocumentViewer, XpsDocument and so on.
[660 byte] By [
beam] at [2008-2-25]
Question: Our company's software(win32 based application) would spport xps file format, viewing and wirting the xps file. Could the XPSViewer be embeded in own software to view the xps file?Answer: No, this is not a supported scenario for the XPSViewer. (The XPSViewer is a WPF Application, btw.)
Question: What are difference between win32 based application and WPF application? Could I use the new API classes under win32 based application? such as DocumentViewer, XpsDocument and so on.
Answer: I believe it is possible to host a WPF component inside of a win32 application. (Or vice versa.) (Unfortunately, I cannot remember how to do this off the top of my head.) This does mean that you could create a control that would use DocumentViewer to view an XPSDocument inside of your application.
I can provide some code samples for how to extract a FixedDocumentSequence from an XPSDocument, if you need that. I just need to know what version of WPF you are running. Once you have a FixedDocumentSequence you can set the DocumentViewer.Document property to that value -- and voila! you are good to go.
We will be shipping an out of band native code based viewer. This viewer will implement Windows' iPreview interfaces. You can use these interfaces to view XPS documents inside your win32 applications. This will work for Windows XP, Server 03 and Vista.