IXpsOMPageReference::DiscardPage method (xpsobjectmodel.h)

Discards the page from memory.

Syntax

HRESULT DiscardPage();

Return value

If the method succeeds, it returns S_OK; otherwise, it returns an HRESULT error code.

Return code Description
S_OK
The method succeeded.
E_UNEXPECTED

DiscardPage has been called more than once or the page has not been loaded.

Remarks

If SetPage has not been called, calling DiscardPage and then GetPage will return the virtualized page from the source package. If SetPage has been called, calling DiscardPage and then GetPage will return NULL.

If the page referenced by this IXpsOMPageReference interface has been constructed entirely in memory and does not have a corresponding file, DiscardPage will delete the page from memory and the page's content will be lost. If the page has been constructed from a file, DiscardPage will delete the page from memory but will not alter the original file. The page can be reconstructed and read back into memory by calling GetPage.

If the page has been constructed from a file and subsequently modified, DiscardPage will discard the page from memory, and any changes made to the page will be lost. Calling GetPage after this will re-read the original content from the file.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h

See also

IXpsOMPageReference

IXpsOMPageReference::GetPage

IXpsOMPageReference::SetPage

XML Paper Specification