XPS Document Errors
The following table lists all the HRESULT values that can be returned by the methods of the XPS Document API. Note that not every method returns every return value that is listed in this table.
Return code/value | Description |
---|---|
|
The interface already has an owner. |
|
The bleed box dimensions are not compatible with the page dimensions. The bleed box width value must be greater than or equal to the page width plus the absolute value of the x-coordinate of the bleed box origin. The bleed box height value must be greater than or equal to the page height plus the absolute value of the y-coordinate of the bleed box origin. |
|
A PathGeometry element contains a set of path figures that are specified either with the Figures attribute or with a child PathFigure element. The path figures of a geometry cannot have both the Figures attribute and a child PathFigure element. |
|
A ResourceDictionary element that specifies a remote resource dictionary in its Source attribute MUST NOT contain any resource definition children. |
|
A caret location value is out of order. The location values must be sorted in ascending order. |
|
Caret stops were specified for an empty string; or, the caret jump index has exceeded the length of the Unicode string. |
|
A color value is out of range. For XPS_COLOR_TYPE_SCRGB color types, the alpha channel value must be greater than or equal to 0.0 and less than or equal to +1.0. For XPS_COLOR_TYPE_CONTEXT color types, the channelValues[0] that represents the alpha channel value must be greater than or equal to 0.0 and less than or equal to +1.0. |
|
A visual in a resource dictionary has the Name attribute, which may not be specified on any children of a ResourceDictionary element. |
|
An object with this name already exists in the dictionary. |
|
An object with this key name already exists in the dictionary. |
|
Reserved. |
|
The bleed box rectangle contains one or more values that are not valid. See the parameter description for the valid values. |
|
The content box rectangle contains one or more values that are not valid. See the parameter description for the valid values. |
|
The content type string is not valid. |
|
A FLOAT value is not valid. It is either an infinite or not a number (NAN). |
|
The font URI is not valid, possibly because it contains an empty fragment or characters that are not valid. |
|
The specified language is either not valid or not correctly formatted. |
|
The lookup key name references an object that is not the correct type for the call; for example, if the method returns a brush but the lookup key name refers to a geometry object. |
XPS_E_INVALID_MARKUP 0x8052000c |
The markup being read contains an element or an attribute that does not conform to the XML Paper Specification. Note: To represent floating-point values, the XPS OM uses the FLOAT data type instead of DOUBLE. If an XPS document has an element with floating-point data that does not fit into a FLOAT value, this error will be returned when that value is encountered during deserialization. |
|
The string that was passed is not a valid name, according to the XML Paper Specification. |
|
Reserved. |
|
The page dimensions contain a page size value that is not valid. |
|
According to the XML Paper Specification, the lookup key string is not valid. |
|
The thumbnail image type is not supported. |
|
Found improper or incorrectly formatted XML markup. |
|
In one or more XPS_GLYPH_MAPPING structures, an element is out of sequence. |
|
The glyph mappings exceed the number of glyph indices. |
|
Error in the glyph mappings. If the Unicode string is empty, this error means that a glyph mapping was also defined. Glyph mappings must not be defined if the Unicode string is empty. If the Unicode string is not empty, this error means that a glyph mapping was defined for glyphs outside of the Unicode string. Glyph mappings cannot be defined for glyphs that fall outside the length of the Unicode string. |
|
The color profile parameter is NULL, but a color profile is expected. A color profile is required when the color type is XPS_COLOR_TYPE_CONTEXT. |
|
A page refers to discardable resources but does not specify a DiscardControl part name. |
|
IXpsOMPackageWriter::AddPage was called before IXpsOMPackageWriter::StartNewDocument. |
|
The package does not contain a FixedDocumentSequence. |
|
The IXpsOMGlyphs interface requires a font URI, but one is not specified. |
|
The IXpsOMGlyphs interface without a Unicode string does not specify any glyph indices. An IXpsOMGlyphs interface must specify either a Unicode string or an array of glyph indices. |
|
An image resource could not be located for the image brush. |
|
The remote resource has an unexpected object. |
|
The page has not been named; the hyperlink target status can only be set if the page has a name. |
|
The FixedDocument does not contain any FixedPage parts. An XPS document must contain at least one FixedPage part. |
|
The page reference does not have a corresponding page. |
|
A required target part was not referenced. |
|
A stream was not specified for the resource. |
|
The FixedDocument part that is referenced by the FixedDocumentSequence could not be found. An XPS document must contain at least one FixedDocument. |
|
The FixedPage part that is referenced by the FixedDocument could not be found. An XPS document must contain at least one FixedPage part. |
|
The relationship target part is not present in the package relationship. |
|
No x:Key attribute was specified for the resource. |
|
The resource referred to by the page or remote dictionary content does not exist as a page relationship. |
|
The referenced restricted font was not specified in the call to IXpsOMPackageWriter::StartNewDocument. |
|
The segment data array has fewer entries than the segment types array. |
|
An attempt was made to add a FixedDocumentSequence to a package that already has one. An XPS document must contain one and only one FixedDocumentSequence part. |
|
An attempt was made to add a document-level print ticket to a FixedDocument that already has one. A FixedDocument in an XPS document can contain only one document-level print ticket. |
|
An attempt was made to add a job-level print ticket to a FixedDocumentSequence that already has one. The FixedDocumentSequence in an XPS document can contain only one job-level print ticket. |
|
An attempt was made to add a page-level print ticket to a FixedPage that already has one. A FixedPage in an XPS document can contain only one page-level print ticket. |
|
The restricted font collection contained a restricted font entry that was repeated. Each font entry can occur in the collection only once. |
|
A resource by that part name already exists. |
|
An attempt was made to add a thumbnail image to a package that already has one. An XPS document can contain only one package-level thumbnail image. |
|
An attempt was made to add a page-level thumbnail image to a FixedPage that already has one. A FixedPage in an XPS document can contain only one page-level thumbnail image. |
|
An entry contains a negative value, but it must contain a non-negative value. |
|
An attempt was made to add a remote dictionary reference to a remote dictionary. A remote dictionary cannot reference another remote dictionary. |
|
An interface pointer does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported. |
|
The gradient stop collection has fewer than two stops. A gradient stop collection must have at least two gradient stops. |
|
The text string was specified as being oriented sideways and right-to-left. If the text is oriented sideways, it cannot have a bidi level that is an odd value (right-to-left). Likewise, if the bidi level is an odd value, the text cannot be oriented sideways. |
|
The glyph mappings do not match the Unicode string contents. |
|
The package writer was not closed before it was released. |
|
A relationship refers to a part that is outside of the XPS document. All content to be rendered in an XPS document must be contained in the XPS document. |
|
Reserved. |
|
Reserved. |
|
A size_t overflow occurred during an attempt to copy a string into a new buffer. |
|
There were more glyph indices than Unicode code points. If there are no glyph mappings, the number of glyph indices must be less than or equal to the number of Unicode code points. |
|
A severe error occurred and the contents of the XPS OM might be unrecoverable. Some components of the XPS OM might still be usable, but they will need to be verified before being used further. Because the state of the XPS OM cannot be predicted after this error is returned, all components of the XPS OM should be released and discarded. |
|
A color profile was present when one was not expected. A color profile is only allowed when the color type is XPS_COLOR_TYPE_CONTEXT. |
|
The target of a relationship is not the type expected by the context of the relationship. |
|
The relationship type was not recognized. |
|
The restricted font collection contains an unrestricted font. |
|
Reserved. |
|
A path geometry that is not in a resource dictionary has an x:Key attribute specified. Path geometries that are not in a resource dictionary cannot have an x:Key attribute. |
Remarks
Some XPS document API methods make calls to the Packaging API. For information about the Packaging API return values, see Packaging Errors.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps only] |
Header |
|
IDL |
|