XPS Document Errors

Header: xpsobjectmodel.h

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.

SymbolicCodeDescription
XPS_E_ALREADY_OWNED0x80520503The interface already has an owner.
XPS_E_BLEED_BOX_PAGE_DIMENSIONS_NOT_IN_SYNC0x80520509The 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.
XPS_E_BOTH_PATHFIGURE_AND_ABBR_SYNTAX_PRESENT0x80520507A 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.
XPS_E_BOTH_RESOURCE_AND_SOURCEATTR_PRESENT0x80520508A ResourceDictionary element that specifies a remote resource dictionary in its Source attribute MUST NOT contain any resource definition children.
XPS_E_CARET_OUT_OF_ORDER0x80520306A caret location value is out of order. The location values must be sorted in ascending order.
XPS_E_CARET_OUTSIDE_STRING0x80520305Caret stops were specified for an empty string; or, the caret jump index has exceeded the length of the Unicode string.
XPS_E_COLOR_COMPONENT_OUT_OF_RANGE0x80520506A 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.
XPS_E_DICTIONARY_ITEM_NAMED0x80520401A visual in a resource dictionary has the Name attribute, which may not be specified on any children of a ResourceDictionary element.
XPS_E_DUPLICATE_NAMES0x80520209An object with this name already exists in the dictionary.
XPS_E_DUPLICATE_RESOURCE_KEYS0x80520200An object with this key name already exists in the dictionary.
XPS_E_INDEX_OUT_OF_RANGE0x80520500Reserved.
XPS_E_INVALID_BLEED_BOX0x80520004The bleed box rectangle contains one or more values that are not valid. See the parameter description for the valid values.
XPS_E_INVALID_CONTENT_BOX0x8052000bThe content box rectangle contains one or more values that are not valid. See the parameter description for the valid values.
XPS_E_INVALID_CONTENT_TYPE0x8052000eThe content type string is not valid.
XPS_E_INVALID_FLOAT0x80520007A FLOAT value is not valid. It is either an infinite or not a number (NAN).
XPS_E_INVALID_FONT_URI0x8052000aThe font URI is not valid, possibly because it contains an empty fragment or characters that are not valid.
XPS_E_INVALID_LANGUAGE0x80520000The specified language is either not valid or not correctly formatted.
XPS_E_INVALID_LOOKUP_TYPE0x80520006The 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_MARKUP0x8052000cThe 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.
XPS_E_INVALID_NAME0x80520001The string that was passed is not a valid name, according to the XML Paper Specification.
XPS_E_INVALID_OBFUSCATED_FONT_URI0x8052000fReserved.
XPS_E_INVALID_PAGE_SIZE0x80520003The page dimensions contain a page size value that is not valid.
XPS_E_INVALID_RESOURCE_KEY0x80520002According to the XML Paper Specification , the lookup key string is not valid.
XPS_E_INVALID_THUMBNAIL_IMAGE_TYPE0x80520005The thumbnail image type is not supported.
XPS_E_INVALID_XML_ENCODING0x8052000dFound improper or incorrectly formatted XML markup.
XPS_E_MAPPING_OUT_OF_ORDER0x80520302In one or more XPS_GLYPH_MAPPING structures, an element is out of sequence.
XPS_E_MAPPING_OUTSIDE_INDICES0x80520304The glyph mappings exceed the number of glyph indices.
XPS_E_MAPPING_OUTSIDE_STRING0x80520303Error 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.
XPS_E_MISSING_COLORPROFILE0x80520104The 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.
XPS_E_MISSING_DISCARDCONTROL0x80520112A page refers to discardable resources but does not specify a DiscardControl part name.
XPS_E_MISSING_DOCUMENT0x80520109IXpsOMPackageWriter::AddPage was called before IXpsOMPackageWriter::StartNewDocument .
XPS_E_MISSING_DOCUMENTSEQUENCE_RELATIONSHIP0x80520108The package does not contain a FixedDocumentSequence.
XPS_E_MISSING_FONTURI0x80520107The IXpsOMGlyphs interface requires a font URI, but one is not specified.
XPS_E_MISSING_GLYPHS0x80520102The 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.
XPS_E_MISSING_IMAGE_IN_IMAGEBRUSH0x8052010eAn image resource could not be located for the image brush.
XPS_E_MISSING_LOOKUP0x80520101The remote resource has an unexpected object.
XPS_E_MISSING_NAME0x80520100The page has not been named; the hyperlink target status can only be set if the page has a name.
XPS_E_MISSING_PAGE_IN_DOCUMENT0x8052010cThe FixedDocument does not contain any FixedPage parts. An XPS document must contain at least one FixedPage part.
XPS_E_MISSING_PAGE_IN_PAGEREFERENCE0x8052010dThe page reference does not have a corresponding page.
XPS_E_MISSING_PART_REFERENCE0x80520110A required target part was not referenced.
XPS_E_MISSING_PART_STREAM0x80520113A stream was not specified for the resource.
XPS_E_MISSING_REFERRED_DOCUMENT0x8052010aThe FixedDocument part that is referenced by the FixedDocumentSequence could not be found. An XPS document must contain at least one FixedDocument.
XPS_E_MISSING_REFERRED_PAGE0x8052010bThe FixedPage part that is referenced by the FixedDocument could not be found. An XPS document must contain at least one FixedPage part.
XPS_E_MISSING_RELATIONSHIP_TARGET0x80520105The relationship target part is not present in the package relationship.
XPS_E_MISSING_RESOURCE_KEY0x8052010fNo x:Key attribute was specified for the resource.
XPS_E_MISSING_RESOURCE_RELATIONSHIP0x80520106The resource referred to by the page or remote dictionary content does not exist as a page relationship.
XPS_E_MISSING_RESTRICTED_FONT_RELATIONSHIP0x80520111The referenced restricted font was not specified in the call to IXpsOMPackageWriter::StartNewDocument .
XPS_E_MISSING_SEGMENT_DATA0x80520103The segment data array has fewer entries than the segment types array.
XPS_E_MULTIPLE_DOCUMENTSEQUENCE_RELATIONSHIPS0x80520202An 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.
XPS_E_MULTIPLE_PRINTTICKETS_ON_DOCUMENT0x80520206An 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.
XPS_E_MULTIPLE_PRINTTICKETS_ON_DOCUMENTSEQUENCE0x80520207An 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.
XPS_E_MULTIPLE_PRINTTICKETS_ON_PAGE0x80520205An 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.
XPS_E_MULTIPLE_REFERENCES_TO_PART0x80520208The restricted font collection contained a restricted font entry that was repeated. Each font entry can occur in the collection only once.
XPS_E_MULTIPLE_RESOURCES0x80520201A resource by that part name already exists.
XPS_E_MULTIPLE_THUMBNAILS_ON_PACKAGE0x80520204An 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.
XPS_E_MULTIPLE_THUMBNAILS_ON_PAGE0x80520203An 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.
XPS_E_NEGATIVE_FLOAT0x8052030aAn entry contains a negative value, but it must contain a non-negative value.
XPS_E_NESTED_REMOTE_DICTIONARY0x80520402An attempt was made to add a remote dictionary reference to a remote dictionary. A remote dictionary cannot reference another remote dictionary.
XPS_E_NO_CUSTOM_OBJECTS0x80520502An interface pointer does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.
XPS_E_NOT_ENOUGH_GRADIENT_STOPS0x8052050bThe gradient stop collection has fewer than two stops. A gradient stop collection must have at least two gradient stops.
XPS_E_ODD_BIDILEVEL0x80520307The 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.
XPS_E_ONE_TO_ONE_MAPPING_EXPECTED0x80520308The glyph mappings do not match the Unicode string contents.
XPS_E_PACKAGE_WRITER_NOT_CLOSED0x8052050cThe package writer was not closed before it was released.
XPS_E_RELATIONSHIP_EXTERNAL0x8052050aA 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.
XPS_E_RESOURCE_NOT_OWNED0x80520504Reserved.
XPS_E_RESTRICTED_FONT_NOT_OBFUSCATED0x80520309Reserved .
XPS_E_STRING_TOO_LONG0x80520300A size_t overflow occurred during an attempt to copy a string into a new buffer.
XPS_E_TOO_MANY_INDICES0x80520301There 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.
XPS_E_UNAVAILABLE_PACKAGE0x80520114A 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.
XPS_E_UNEXPECTED_COLORPROFILE0x80520505A color profile was present when one was not expected. A color profile is only allowed when the color type is XPS_COLOR_TYPE_CONTEXT .
XPS_E_UNEXPECTED_CONTENT_TYPE0x80520008The target of a relationship is not the type expected by the context of the relationship.
XPS_E_UNEXPECTED_RELATIONSHIP_TYPE0x80520010The relationship type was not recognized.
XPS_E_UNEXPECTED_RESTRICTED_FONT_RELATIONSHIP0x80520011The restricted font collection contains an unrestricted font.
XPS_E_VISUAL_CIRCULAR_REF0x80520501Reserved.
XPS_E_XKEY_ATTR_PRESENT_OUTSIDE_RES_DICT0x80520400A 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.
75 entries

Article text from the Win32 documentation (opens in a new tab), by Microsoft, under the CC BY 4.0 (opens in a new tab) licence.