c# - NotSupportedException in creation of xps file -
i'm trying create xps file out of documentviewer:
microsoft.win32.savefiledialog dlg = new microsoft.win32.savefiledialog(); dlg.filename = "myreport"; // default file name dlg.defaultext = ".xps"; // default file extension dlg.filter = "xps documents (.xps)|*.xps"; // filter files extension // show save file dialog box nullable<bool> result = dlg.showdialog(); // process save file dialog box results if (result == true) { // save document string filename = dlg.filename; fixeddocument doc = (fixeddocument)documentviewer.document; xpsdocument xpsd = new xpsdocument(filename, fileaccess.readwrite); system.windows.xps.xpsdocumentwriter xw = xpsdocument.createxpsdocumentwriter(xpsd); xw.write(doc); xpsd.close(); }
but throws following exception in xw.write(doc)
:
bitmapmetadata not available on bitmapimage
either way, creates xps file in don't see (of course) following message:
this page cannot displayed
1) don't understand bitmap came from...
2) can exception?
thanks.
Comments
Post a Comment