c# - Reading .xps file causes OutOfMemoryException -
when use c# read .xps file, outofmemoryexception
.
got information opening xps document in .net causes memory leak, seems not work in code.
my code below:
using (xpsdocument document = new xpsdocument(xpspath, system.io.fileaccess.read)) { fixeddocumentsequence fds = document.getfixeddocumentsequence(); int pagecount = fds.documentpaginator.pagecount; (int = 0; < pagecount; i++) { documentpage source = fds.documentpaginator.getpage(i); visual v = source.visual; fixedpage fixedpage = (fixedpage)v; fixedpage.updatelayout(); } document.close(); }
- when remove line
fixedpage.updatelayout()
. through win8's "task manager", current program's use of memory increased 10mb each time while read 1 .xps file. - when add line, use of memory still increased 1mb each time.
any 1 can me?
Comments
Post a Comment