using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Vanara.InteropServices; using static Vanara.PInvoke.Ole32; using static Vanara.PInvoke.Opc; namespace Vanara.PInvoke { public static partial class XpsObjectModel { /// /// This interface provides access to the metadata that is stored in the Core Properties part of the XPS document. /// /// The contents of the Core Properties part are described in the 1st edition, Part 2, "Open Packaging Conventions," of Standard /// ECMA-376, Office Open XML File Formats. /// /// /// The meaning and use of these properties is determined by the user or context. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsomcoreproperties [PInvokeData("xpsobjectmodel.h", MSDNShortId = "705ec9c7-5aa9-4fc5-ad2c-441cb545d056")] [ComImport, Guid("3340FE8F-4027-4AA1-8F5F-D35AE45FE597"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMCoreProperties : IXpsOMPart { /// Gets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the part name. If the part name has not been set (by the SetPartName /// method), a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT // GetPartName( IOpcPartUri **partUri ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Interface)] new IOpcPartUri GetPartName(); /// Sets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the name of this part. This parameter cannot be NULL. /// /// /// IXpsOMPackageWriter will generate an error if it encounters an XPS document part whose name is the same as that of a part it /// has previously serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT // SetPartName( IOpcPartUri *partUri ); [MethodImpl(MethodImplOptions.InternalCall)] new void SetPartName([In] IOpcPartUri partUri); /// Gets a pointer to the IXpsOMPackage interface that contains the core properties. /// /// A pointer to the IXpsOMPackage interface that contains the core properties. If the interface does not belong to a package, a /// NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getowner HRESULT // GetOwner( IXpsOMPackage **package ); IXpsOMPackage GetOwner(); /// Gets the category property. /// The string that is read from the category property. /// /// The category property contains categorization of the content. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcategory HRESULT // GetCategory( LPWSTR *category ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetCategory(); /// Sets the category property. /// /// The string to be written to the category property. A NULL pointer clears the category property. /// /// The category property contains a categorization of the content. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcategory HRESULT // SetCategory( LPCWSTR category ); void SetCategory([In, MarshalAs(UnmanagedType.LPWStr)] string category); /// Gets the contentStatus property. /// The string that is read from the contentStatus property. /// /// /// The contentStatus property stores the content's status. Examples of contentStatus values include Draft, /// Reviewed, and Final. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontentstatus // HRESULT GetContentStatus( LPWSTR *contentStatus ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetContentStatus(); /// Sets the contentStatus property. /// /// The string to be written to the contentStatus property. A NULL pointer clears the contentStatus property. /// /// /// The contentStatus property contains the status of the content. Examples of contentStatus values include /// Draft, Reviewed, and Final. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcontentstatus // HRESULT SetContentStatus( LPCWSTR contentStatus ); void SetContentStatus([In, MarshalAs(UnmanagedType.LPWStr)] string contentStatus); /// Gets the contentType property. /// The string that is read from the contentType property. /// /// /// The contentType property stores the type of content that is being represented, and it is generally defined by a /// specific use and intended audience. Examples of contentType values include Whitepaper, Security /// Bulletin, and Exam. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontenttype // HRESULT GetContentType( LPWSTR *contentType ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetContentType(); /// Sets the contentType property. /// /// The string to be written to the contentType property. A NULL pointer clears the contentType property. /// /// /// The contentType property contains the type of content that is being represented, which is generally defined by a /// specific use and intended audience. Examples of contentType values include Whitepaper, Security /// Bulletin, and Exam. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcontenttype // HRESULT SetContentType( LPCWSTR contentType ); void SetContentType([In, MarshalAs(UnmanagedType.LPWStr)] string contentType); /// Gets the created property. /// The date and time that are read from the created property. /// The created property contains the date and time the package was created. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcreated HRESULT // GetCreated( SYSTEMTIME *created ); SYSTEMTIME GetCreated(); /// Sets the created property. /// The date and time the package was created. A NULL pointer clears the created property /// The created property contains the date and time the package was created. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcreated HRESULT // SetCreated( const SYSTEMTIME *created ); void SetCreated(in SYSTEMTIME created); /// Gets the creator property. /// The string that is read from the creator property. /// /// The creator property describes the entity that is primarily responsible for making the content of the resource. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcreator HRESULT // GetCreator( LPWSTR *creator ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetCreator(); /// Sets the creator property. /// /// The string to be written to the creator property. A NULL pointer clears the creator property. /// /// /// The creator property describes the entity that is primarily responsible for making the content of the resource. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcreator HRESULT // SetCreator( LPCWSTR creator ); void SetCreator([In, MarshalAs(UnmanagedType.LPWStr)] string creator); /// Gets the description property. /// The string that is read from the description property. /// /// The description property provides an explanation of the content. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getdescription // HRESULT GetDescription( LPWSTR *description ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetDescription(); /// Sets the description property. /// /// The string to be written to the description property. A NULL pointer clears this property. /// /// The description property explains the content. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setdescription // HRESULT SetDescription( LPCWSTR description ); void SetDescription([In, MarshalAs(UnmanagedType.LPWStr)] string description); /// Gets the identifier property. /// The string that is read from the identifier property. /// /// /// The identifier property is an unambiguous reference to the resource within a user-defined or application-specific context. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getidentifier // HRESULT GetIdentifier( LPWSTR *identifier ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetIdentifier(); /// Sets the identifier property. /// /// The string to be written to the identifier property. A NULL pointer clears the identifier property. /// /// /// The identifier property is an unambiguous reference to the resource within a user-defined or application-specific context. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setidentifier // HRESULT SetIdentifier( LPCWSTR identifier ); void SetIdentifier([In, MarshalAs(UnmanagedType.LPWStr)] string identifier); /// Gets the keywords property. /// The string that is read from the keywords property. /// /// /// The keywords property is a delimited set of keywords that are used to support searching and indexing. This is /// typically a list of terms that are not available in other properties. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getkeywords HRESULT // GetKeywords( LPWSTR *keywords ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetKeywords(); /// Sets the keywords property. /// /// The string that contains the keywords to be written to the keywords property. A NULL pointer clears the /// keywords property. /// /// /// The keywords property is a delimited set of keywords that are used to support searching and indexing. It is typically /// a list of terms that are not available elsewhere in the properties. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setkeywords HRESULT // SetKeywords( LPCWSTR keywords ); void SetKeywords([In, MarshalAs(UnmanagedType.LPWStr)] string keywords); /// Gets the language property. /// The value that is read from the language property. /// /// The language property describes the language of the resource's intellectual content. /// Internet Engineering Task Force (IETF) RFC 3066 describes the recommended encoding for this property. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlanguage HRESULT // GetLanguage( LPWSTR *language ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetLanguage(); /// Sets the language property. /// /// The string that contains the language value to be written to the language property. A NULL pointer clears the /// language property. /// /// /// The language property describes the language of the resource's intellectual content. /// Internet Engineering Task Force (IETF) RFC 3066 describes the recommended encoding for this property. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlanguage HRESULT // SetLanguage( LPCWSTR language ); void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language); /// Gets the lastModifiedBy property. /// The value that is read from the lastModifiedBy property. /// /// The lastModifiedBy property describes the user who performed the last modification. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlastmodifiedby // HRESULT GetLastModifiedBy( LPWSTR *lastModifiedBy ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetLastModifiedBy(); /// Sets the lastModifiedBy property. /// /// The string that contains the value to be written to the lastModifiedBy property. A NULL pointer clears the /// lastModifiedBy property. /// /// The lastModifiedBy property describes the user who performs the last modification. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlastmodifiedby // HRESULT SetLastModifiedBy( LPCWSTR lastModifiedBy ); void SetLastModifiedBy([In, MarshalAs(UnmanagedType.LPWStr)] string lastModifiedBy); /// Gets the lastPrinted property. /// The date and time that are read from the lastPrinted property. /// The lastPrinted property contains the date and time the package was last printed. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlastprinted // HRESULT GetLastPrinted( SYSTEMTIME *lastPrinted ); SYSTEMTIME GetLastPrinted(); /// Sets the lastPrinted property. /// /// The date and time the package was last printed. A NULL pointer clears the lastPrinted property. /// /// The lastPrinted property contains the date and time the package was last printed. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlastprinted // HRESULT SetLastPrinted( const SYSTEMTIME *lastPrinted ); void SetLastPrinted(in SYSTEMTIME lastPrinted); /// Gets the modified property. /// The date and time that are read from the modified property. /// The modified property contains the date and time the package was last modified. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getmodified HRESULT // GetModified( SYSTEMTIME *modified ); SYSTEMTIME GetModified(); /// Sets the modified property. /// /// The date and time the package was last changed. A NULL pointer clears the modified property. /// /// The modified property contains the date and time the package was last changed. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setmodified HRESULT // SetModified( const SYSTEMTIME *modified ); void SetModified(in SYSTEMTIME modified); /// Gets the revision property. /// The string that is read from the revision property. /// /// The revision property contains the resource's revision number. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getrevision HRESULT // GetRevision( LPWSTR *revision ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetRevision(); /// Sets the revision property. /// /// The string to be written to the revision property. A NULL pointer clears the revision property. /// /// The revision property contains the revision number of the resource. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setrevision HRESULT // SetRevision( LPCWSTR revision ); void SetRevision([In, MarshalAs(UnmanagedType.LPWStr)] string revision); /// Gets the subject property. /// The string that is read from the subject property. /// The subject property contains the topic of the resource's content. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getsubject HRESULT // GetSubject( LPWSTR *subject ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetSubject(); /// Sets the subject property. /// /// The string to be written to the subject property. A NULL pointer clears the subject property. /// /// The subject property contains the topic of the resource content. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setsubject HRESULT // SetSubject( LPCWSTR subject ); void SetSubject([In, MarshalAs(UnmanagedType.LPWStr)] string subject); /// Gets the title property. /// The string that is read from the title property. /// The title property contains the resource's name. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-gettitle HRESULT // GetTitle( LPWSTR *title ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetTitle(); /// Sets the title property. /// /// The string to be written to the title property. A NULL pointer clears the title property. /// /// The title property contains the name given to the resource. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-settitle HRESULT // SetTitle( LPCWSTR title ); void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string title); /// Gets the version property. /// The string that is read from the version property. /// The version property contains the resource's version number. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getversion HRESULT // GetVersion( LPWSTR *version ); [return: MarshalAs(UnmanagedType.LPWStr)] string GetVersion(); /// Sets the version property. /// /// The string to be written to the version property. A NULL pointer clears the version property. /// /// The version property contains the version number of the resource. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setversion HRESULT // SetVersion( LPCWSTR version ); void SetVersion([In, MarshalAs(UnmanagedType.LPWStr)] string version); /// Makes a deep copy of the interface. /// A pointer to the copy of the interface. /// The owner of the interface returned in coreProperties is NULL. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-clone HRESULT Clone( // IXpsOMCoreProperties **coreProperties ); IXpsOMCoreProperties Clone(); } /// An ordered sequence of fixed pages and document-level resources that make up the document. /// The code example that follows illustrates how to create an instance of this interface. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsomdocument [PInvokeData("xpsobjectmodel.h", MSDNShortId = "22d3c0a1-3ad5-4f48-9e1e-eaf3bd95b39f")] [ComImport, Guid("2C2C94CB-AC5F-4254-8EE9-23948309D9F0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMDocument : IXpsOMPart { /// Gets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the part name. If the part name has not been set (by the SetPartName /// method), a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT // GetPartName( IOpcPartUri **partUri ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Interface)] new IOpcPartUri GetPartName(); /// Sets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the name of this part. This parameter cannot be NULL. /// /// /// IXpsOMPackageWriter will generate an error if it encounters an XPS document part whose name is the same as that of a part it /// has previously serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT // SetPartName( IOpcPartUri *partUri ); [MethodImpl(MethodImplOptions.InternalCall)] new void SetPartName([In] IOpcPartUri partUri); /// Gets a pointer to the IXpsOMDocumentSequence interface that contains the document. /// /// A pointer to the IXpsOMDocumentSequence interface that contains the document. If the document does not belong to a document /// sequence, a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-getowner HRESULT GetOwner( // IXpsOMDocumentSequence **documentSequence ); IXpsOMDocumentSequence GetOwner(); /// Gets the IXpsOMPageReferenceCollection interface of the document, which allows virtualized access to its pages. /// /// A pointer to the IXpsOMPageReferenceCollection interface that contains a collection of page references for each page of the /// document. If there are no page references, the IXpsOMPageReferenceCollection returned in pageReferences will be empty /// and will have no elements. /// /// /// /// To get the pages of a document, first get the list of IXpsOMPageReference interfaces by calling GetPageReferences. /// Then, for each IXpsOMPageReference interface, load a page by calling GetPage. /// /// /// If the document does not have any pages, the page reference collection returned in pageReferences will be empty. To get the /// number of page references in the collection, call its GetCount method. /// /// For an example of how this method can be used in a program, see Navigate the XPS OM. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-getpagereferences HRESULT // GetPageReferences( IXpsOMPageReferenceCollection **pageReferences ); IXpsOMPageReferenceCollection GetPageReferences(); /// Gets the IXpsOMPrintTicketResource interface of the document-level print ticket. /// /// A pointer to the IXpsOMPrintTicketResource interface of the document-level print ticket that is associated with the /// document. If no print ticket has been assigned, a NULL pointer will be returned. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-getprintticketresource // HRESULT GetPrintTicketResource( IXpsOMPrintTicketResource **printTicketResource ); IXpsOMPrintTicketResource GetPrintTicketResource(); /// Sets the IXpsOMPrintTicketResource interface for the document-level print ticket. /// /// A pointer to the IXpsOMPrintTicketResource interface for the document-level print ticket to be assigned to the document. A /// NULL pointer releases any previously assigned print ticket resource. /// /// /// If the document contains an IXpsOMPrintTicketResource interface when this method is called, that interface is released /// before the new IXpsOMPrintTicketResource interface, passed in printTicketResource, is set. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-setprintticketresource // HRESULT SetPrintTicketResource( IXpsOMPrintTicketResource *printTicketResource ); void SetPrintTicketResource([In] IXpsOMPrintTicketResource printTicketResource); /// /// Gets a pointer to the IXpsOMDocumentStructureResource interface of the resource that contains structural information about /// the document. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-getdocumentstructureresource // HRESULT GetDocumentStructureResource( IXpsOMDocumentStructureResource **documentStructureResource ); IXpsOMDocumentStructureResource GetDocumentStructureResource(); /// Sets the IXpsOMDocumentStructureResource interface for the document. /// /// If the document contains an IXpsOMDocumentStructureResource interface when this method is called, that interface is released /// before the new IXpsOMDocumentStructureResource interface, which is passed in documentStructureResource, is set. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-setdocumentstructureresource // HRESULT SetDocumentStructureResource( IXpsOMDocumentStructureResource *documentStructureResource ); void SetDocumentStructureResource([In] IXpsOMDocumentStructureResource documentStructureResource); /// /// Gets a pointer to the IXpsOMSignatureBlockResourceCollection interface, which refers to a collection of the document's /// digital signature block resources. /// /// /// A pointer to the IXpsOMSignatureBlockResourceCollection interface, which refers to a collection of the document's digital /// signature block resources. If the document does not contain any signature block resources, the /// IXpsOMSignatureBlockResourceCollection interface will be empty. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-getsignatureblockresources // HRESULT GetSignatureBlockResources( IXpsOMSignatureBlockResourceCollection **signatureBlockResources ); IXpsOMSignatureBlockResourceCollection GetSignatureBlockResources(); /// Makes a deep copy of the interface. /// A pointer to the copy of the interface. /// This method does not update any of the resource pointers in the copy. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocument-clone HRESULT Clone( // IXpsOMDocument **document ); IXpsOMDocument Clone(); } /// A collection of IXpsOMDocument interface pointers. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsomdocumentcollection [PInvokeData("xpsobjectmodel.h", MSDNShortId = "4f3acae9-10a0-47ff-9170-a40abe230580")] [ComImport, Guid("D1C87F0D-E947-4754-8A25-971478F7E83E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMDocumentCollection { /// Gets the number of IXpsOMDocument interface pointers in the collection. /// The number of IXpsOMDocument interface pointers in the collection. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-getcount HRESULT // GetCount( UINT32 *count ); uint GetCount(); /// Gets an IXpsOMDocument interface pointer from a specified location in the collection. /// The zero-based index of the IXpsOMDocument interface pointer to be obtained. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-getat HRESULT // GetAt( UINT32 index, IXpsOMDocument **document ); IXpsOMDocument GetAt([In] uint index); /// Inserts an IXpsOMDocument interface pointer at a specified location in the collection. /// /// The zero-based index of the collection where the interface pointer that is passed in document is to be inserted. /// /// The IXpsOMDocument interface pointer that is to be inserted at the location specified by index. /// /// /// At the location specified by index, this method inserts the IXpsOMDocument interface pointer that is passed in document. /// Prior to the insertion, the pointer in this and all subsequent locations is moved up by one index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-insertat HRESULT // InsertAt( UINT32 index, IXpsOMDocument *document ); void InsertAt([In] uint index, [In] IXpsOMDocument document); /// Removes and releases an IXpsOMDocument interface pointer from a specified location in the collection. /// /// The zero-based index in the collection from which an IXpsOMDocument interface pointer is to be removed and released. /// /// /// /// This method releases the interface referenced by the pointer at the location specified by index. After releasing the /// interface, this method compacts the collection by reducing by 1 the index of each pointer subsequent to index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-removeat HRESULT // RemoveAt( UINT32 index ); void RemoveAt([In] uint index); /// Replaces an IXpsOMDocument interface pointer at a specified location in the collection. /// The zero-based index in the collection where an IXpsOMDocument interface pointer is to be replaced. /// /// The IXpsOMDocument interface pointer that will replace current contents at the location specified by index. /// /// /// /// At the location specified by index, this method releases the IXpsOMDocument interface referenced by the existing pointer, /// then writes the pointer that is passed in document. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-setat HRESULT // SetAt( UINT32 index, IXpsOMDocument *document ); void SetAt([In] uint index, [In] IXpsOMDocument document); /// Appends an IXpsOMDocument interface to the end of the collection. /// A pointer to the IXpsOMDocument interface that is to be appended to the collection. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentcollection-append HRESULT // Append( IXpsOMDocument *document ); void Append([In] IXpsOMDocument document); } /// The root object that has the XPS document content. /// The code example that follows illustrates how to create an instance of this interface. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsomdocumentsequence [PInvokeData("xpsobjectmodel.h", MSDNShortId = "472095a4-ecd8-406a-97c2-1a34b4e5184a")] [ComImport, Guid("56492EB4-D8D5-425E-8256-4C2B64AD0264"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMDocumentSequence : IXpsOMPart { /// Gets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the part name. If the part name has not been set (by the SetPartName /// method), a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT // GetPartName( IOpcPartUri **partUri ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Interface)] new IOpcPartUri GetPartName(); /// Sets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the name of this part. This parameter cannot be NULL. /// /// /// IXpsOMPackageWriter will generate an error if it encounters an XPS document part whose name is the same as that of a part it /// has previously serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT // SetPartName( IOpcPartUri *partUri ); [MethodImpl(MethodImplOptions.InternalCall)] new void SetPartName([In] IOpcPartUri partUri); /// Gets a pointer to the IXpsOMPackage interface that contains the document sequence. /// /// A pointer to the IXpsOMPackage interface that contains the document sequence. If the document sequence does not belong to a /// package, a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-getowner HRESULT // GetOwner( IXpsOMPackage **package ); IXpsOMPackage GetOwner(); /// /// Gets a pointer to the IXpsOMDocumentCollection interface, which contains the documents specified in the document sequence. /// /// /// A pointer to the IXpsOMDocumentCollection interface, which contains the documents specified in the document sequence. If the /// sequence does not have any documents, the IXpsOMDocumentCollection interface will be empty. /// /// /// If the document sequence does not have any documents, the document collection that is returned in documents will be empty. /// To get the number of documents in the collection, call the collection's GetCount method. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-getdocuments // HRESULT GetDocuments( IXpsOMDocumentCollection **documents ); IXpsOMDocumentCollection GetDocuments(); /// /// Gets the IXpsOMPrintTicketResource interface to the job-level print ticket that is assigned to the document sequence. /// /// /// A pointer to the IXpsOMPrintTicketResource interface of the job-level print ticket that is assigned to the document /// sequence. If no IXpsOMPrintTicketResource interface has been assigned to the document sequence, a NULL pointer /// is returned. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-getprintticketresource // HRESULT GetPrintTicketResource( IXpsOMPrintTicketResource **printTicketResource ); IXpsOMPrintTicketResource GetPrintTicketResource(); /// Sets the job-level print ticket resource for the document sequence. /// /// A pointer to the IXpsOMPrintTicketResource interface of the job-level print ticket that will be set for the document /// sequence. If the document sequence has a print ticket resource, a NULL pointer will release it. /// /// /// If the document contains an IXpsOMPrintTicketResource interface when this method is called, that interface is released /// before the new IXpsOMPrintTicketResource interface, which is passed in printTicketResource, is set. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-setprintticketresource // HRESULT SetPrintTicketResource( IXpsOMPrintTicketResource *printTicketResource ); void SetPrintTicketResource([In] IXpsOMPrintTicketResource printTicketResource); } /// /// Provides the top-level entry into the XPS object model tree. /// /// Although this interface does not correspond to any XPS markup, it does correspond to the XPS document, and it is required to /// save the components of an XPS object model tree as an XPS document. /// /// /// /// The code example that follows illustrates how to create an instance of this interface. /// For information about using this interface in a program, see Create a Blank XPS OM. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompackage [PInvokeData("xpsobjectmodel.h", MSDNShortId = "7b0a36d6-1af1-4c2c-af14-d6139e9115c3")] [ComImport, Guid("18C3DF65-81E1-4674-91DC-FC452F5A416F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPackage { /// Gets a pointer to the IXpsOMDocumentSequence interface that contains the document sequence of the XPS package. /// /// A pointer to the IXpsOMDocumentSequence interface that contains the document sequence of the XPS package. If an /// IXpsOMDocumentSequence interface has not been set, a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getdocumentsequence HRESULT // GetDocumentSequence( IXpsOMDocumentSequence **documentSequence ); IXpsOMDocumentSequence GetDocumentSequence(); /// Sets the IXpsOMDocumentSequence interface of the XPS package. /// /// The IXpsOMDocumentSequence interface pointer to be assigned to the package. This parameter must not be NULL. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setdocumentsequence HRESULT // SetDocumentSequence( IXpsOMDocumentSequence *documentSequence ); void SetDocumentSequence([In] IXpsOMDocumentSequence documentSequence); /// Gets a pointer to the IXpsOMCoreProperties interface of the XPS package. /// /// A pointer to the IXpsOMCoreProperties interface of the XPS package. If an IXpsOMCoreProperties interface has not been /// set, a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getcoreproperties HRESULT // GetCoreProperties( IXpsOMCoreProperties **coreProperties ); IXpsOMCoreProperties GetCoreProperties(); /// Sets the IXpsOMCoreProperties interface of the XPS package. /// /// The IXpsOMCoreProperties interface pointer to be assigned to the package. A NULL pointer releases any previously /// assigned core properties interface. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setcoreproperties HRESULT // SetCoreProperties( IXpsOMCoreProperties *coreProperties ); void SetCoreProperties([In] IXpsOMCoreProperties coreProperties); /// Gets the name of the discard control part in the XPS package. /// /// A pointer to the IOpcPartUri interface that contains the name of the discard control part in the XPS package. If a discard /// control part has not been set, a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getdiscardcontrolpartname // HRESULT GetDiscardControlPartName( IOpcPartUri **discardControlPartUri ); IOpcPartUri GetDiscardControlPartName(); /// Sets the name of the discard control part in the XPS package. /// /// The IOpcPartUri interface that contains the name of the discard control part to be assigned to the XPS package. A /// NULL pointer releases any previously assigned discard control part. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setdiscardcontrolpartname // HRESULT SetDiscardControlPartName( IOpcPartUri *discardControlPartUri ); void SetDiscardControlPartName([In] IOpcPartUri discardControlPartUri); /// /// Gets a pointer to the IXpsOMImageResource interface of the thumbnail resource that is associated with the XPS package. /// /// /// A pointer to the IXpsOMImageResource interface of the thumbnail resource that is associated with the XPS package. If the /// package does not have a thumbnail resource, a NULL pointer is returned. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getthumbnailresource // HRESULT GetThumbnailResource( IXpsOMImageResource **imageResource ); IXpsOMImageResource GetThumbnailResource(); /// Sets the thumbnail image of the XPS document. /// /// The IXpsOMImageResource interface that contains the thumbnail image that will be assigned to the package. A NULL /// pointer releases any previously assigned thumbnail image resources. /// /// /// The thumbnail image is a small, visual representation of the document's contents. /// The image type of the image resource must be either XPS_IMAGE_TYPE_JPEG or XPS_IMAGE_TYPE_PNG. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setthumbnailresource // HRESULT SetThumbnailResource( IXpsOMImageResource *imageResource ); void SetThumbnailResource([In] IXpsOMImageResource imageResource); /// Writes the XPS package to a specified file. /// The name of the file to be created. This parameter must not be NULL. /// /// The SECURITY_ATTRIBUTES structure, which contains two distinct but related data members: /// /// /// lpSecurityDescriptor: an optional security descriptor /// /// /// bInheritHandle: a Boolean value that determines whether the returned handle can be inherited by child processes /// /// /// If /// lpSecurityDescriptor /// is /// NULL /// , the file or device that is associated with the returned handle will be assigned a default security descriptor. /// For more information about the securityAttributes parameter, refer to CreateFile. /// /// /// /// Specifies the settings and attributes of the file to be created. For most files, a value of FILE_ATTRIBUTE_NORMAL can /// be used. /// /// For more information about the flagsAndAttributes parameter, refer to CreateFile. /// /// /// A Boolean value that indicates whether the document markup is to be optimized for size when it is written to the file. /// /// /// Value /// Meaning /// /// /// TRUE /// The package writer will attempt to optimize the markup for minimum size. /// /// /// FALSE /// The package writer will not attempt any optimization. /// /// /// /// /// /// The optimizeMarkupSize value determines whether the markup inside the individual document parts is to be optimized. It has /// no effect on how the parts are interleaved. /// /// /// Note Writing an XPS OM to a file does not automatically create a thumbnail for the XPS document. To create a /// thumbnail of the XPS document, use the IXpsOMThumbnailGenerator interface. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-writetofile HRESULT // WriteToFile( LPCWSTR fileName, LPSECURITY_ATTRIBUTES securityAttributes, DWORD flagsAndAttributes, BOOL optimizeMarkupSize ); void WriteToFile([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] SECURITY_ATTRIBUTES securityAttributes, [In] FileFlagsAndAttributes flagsAndAttributes, [In, MarshalAs(UnmanagedType.Bool)] bool optimizeMarkupSize); /// Writes the XPS package to a specified stream. /// The stream that receives the serialized contents of the package. This parameter must not be NULL. /// /// A Boolean value that indicates whether the document markup is to be optimized for size when it is written to the stream. /// /// /// Value /// Meaning /// /// /// TRUE /// The package writer will attempt to optimize the markup for minimum size. /// /// /// FALSE /// The package writer will not attempt any optimization. /// /// /// /// /// /// The optimizeMarkupSize value determines whether the markup inside the individual document parts is to be optimized. It has /// no effect on how the parts are interleaved. /// /// /// Note Writing an XPS OM to a stream does not automatically create a thumbnail for the XPS document. To create a /// thumbnail of the XPS document, use the IXpsOMThumbnailGenerator interface. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-writetostream HRESULT // WriteToStream( ISequentialStream *stream, BOOL optimizeMarkupSize ); void WriteToStream([In] ISequentialStream stream, [In, MarshalAs(UnmanagedType.Bool)] bool optimizeMarkupSize); } /// Incrementally writes the parts of an XPS document to a package file. /// /// /// Progressive writing enables an application to serialize XPS document content and resources as they become available. It does not /// require the application to create all elements of the document before serialization. /// /// /// This interface writes the pages to the package sequentially, in the order that AddPage is called. The interface does not support /// page writing in a non-sequential order; thus it should only be used when page content is produced or is available for writing in /// the order it is to appear in the XPS document. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompackagewriter [PInvokeData("xpsobjectmodel.h", MSDNShortId = "cbbcc8bf-6172-41c8-9d74-27e5635ec167")] [ComImport, Guid("4E2AA182-A443-42C6-B41B-4F8E9DE73FF9"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPackageWriter { /// Opens and initializes a new FixedDocument in the FixedDocumentSequence of the package. /// A pointer to an IOpcPartUri interface that contains the part name of the new document. /// /// A pointer to an IXpsOMPrintTicketResource interface that contains the document-level print ticket. If there is no /// document-level print ticket for this package, this parameter can be set to NULL. See also Remarks. /// /// /// A pointer to an IXpsOMDocumentStructureResource interface that contains the initial document structure resource, if the /// resource is available; if it is not available, this parameter can be set to NULL. /// /// /// A pointer to an IXpsOMSignatureBlockResourceCollection interface that contains a collection of digital signatures to be /// attached to the document. If there are no digital signatures to be attached, this parameter can be set to NULL. /// /// /// /// A pointer to an IXpsOMPartUriCollection interface that contains the fonts that must have restricted font relationships /// written for them. The font data are not written until AddResource or Close is called. /// /// If the document does not contain any restricted fonts, this parameter can be set to NULL. /// /// /// This method must be called before AddPage can be called to write the contents of an IXpsOMPage interface. /// /// Immediately after the IXpsOMPackageWriter interface has been instantiated, the package contains only an empty Fixed Document /// Sequence part. The first time this method is called, a FixedDocument part is added to the Fixed Document Sequence part and /// the AddPage method will add pages to that FixedDocument part. Each time this method is called after the first time, the /// current FixedDocument part is closed, and a new FixedDocument part is opened and added to the Fixed Document Sequence part. /// All subsequent calls to the AddPage method add pages to the most recently opened FixedDocument part. This interface /// does not support adding pages to closed FixedDocument parts. /// /// /// If documentPrintTicket contains a NULL pointer and the package writer was created with interleaving set to /// XPS_INTERLEAVING_ON, this method creates a blank document-level print ticket, if one does not already exist. Each /// time this method is called with a NULL pointer in documentPrintTicket, it adds a relationship from the new document /// to the blank print ticket. This is done to provide more efficient streaming consumption of the package. /// /// /// If documentPrintTicket contains a NULL pointer and the package writer was created with interleaving set to /// XPS_INTERLEAVING_OFF, no blank print ticket is created. /// /// /// Note Creating a new document in the package does not automatically create a thumbnail for the XPS document. To create /// a thumbnail of the XPS document, use the IXpsOMThumbnailGenerator interface. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackagewriter-startnewdocument // HRESULT StartNewDocument( IOpcPartUri *documentPartName, IXpsOMPrintTicketResource *documentPrintTicket, // IXpsOMDocumentStructureResource *documentStructure, IXpsOMSignatureBlockResourceCollection *signatureBlockResources, // IXpsOMPartUriCollection *restrictedFonts ); [MethodImpl(MethodImplOptions.InternalCall)] void StartNewDocument([In] IOpcPartUri documentPartName, [In] IXpsOMPrintTicketResource documentPrintTicket, [In] IXpsOMDocumentStructureResource documentStructure, [In] IXpsOMSignatureBlockResourceCollection signatureBlockResources, [In] IXpsOMPartUriCollection restrictedFonts); /// Writes a new FixedPage part to the currently open FixedDocument part in the package. /// /// The IXpsOMPage interface whose page content is to be written to the currently open FixedDocument of the package. /// /// /// The XPS_SIZE structure that contains page dimensions. /// /// Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are /// 816 by 1,056 XPS units. /// /// /// /// The IXpsOMPartUriCollection interface that contains a collection of the discardable resource parts. /// /// The IXpsOMStoryFragmentsResource interface that is to be used for this page. /// /// The IXpsOMPrintTicketResource interface that contains the page-level print ticket for this page. See also Remarks. /// /// The IXpsOMImageResource interface that contains the thumbnail image of this page. /// /// Call this method after calling StartNewDocument. /// /// This method creates a new FixedPage part in the package, copies the contents of the IXpsOMPage interface that is passed in /// the page parameter, and then closes the new FixedPage part after the page has been written to the package. /// /// /// If pagePrintTicket contains a NULL pointer and the package writer was created with interleaving set to /// XPS_INTERLEAVING_ON, this method creates a blank page-level print ticket, if one does not already exist. Each time /// method is called with a NULL pointer in pagePrintTicket, it adds a relationship from the new page to the blank print /// ticket. This is done to provide more efficient streaming consumption of the package. /// /// /// If pagePrintTicket contains a NULL pointer and the package writer was created with interleaving set to /// XPS_INTERLEAVING_OFF, no blank print ticket is created. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackagewriter-addpage HRESULT // AddPage( IXpsOMPage *page, const XPS_SIZE *advisoryPageDimensions, IXpsOMPartUriCollection *discardableResourceParts, // IXpsOMStoryFragmentsResource *storyFragments, IXpsOMPrintTicketResource *pagePrintTicket, IXpsOMImageResource *pageThumbnail ); [MethodImpl(MethodImplOptions.InternalCall)] void AddPage([In] IXpsOMPage page, in XPS_SIZE advisoryPageDimensions, [In] IXpsOMPartUriCollection discardableResourceParts, [In] IXpsOMStoryFragmentsResource storyFragments, [In] IXpsOMPrintTicketResource pagePrintTicket, [In] IXpsOMImageResource pageThumbnail); /// Creates a new part resource in the package. /// /// The IXpsOMResource interface of the part resource that will be added as a new part in the package. See Remarks for the types /// of resources that may be passed in this parameter. /// /// /// /// This method creates a new part in the document package that corresponds to resource, adds the contents of resource to the /// new part, and then closes the new part. /// /// If this method returns an error, the package writer is no longer usable. /// The resource parameter must be one of the following: /// /// /// /// The IXpsOMFontResource interface of a font resource that is used in the current page or a page that has already been added. /// /// /// /// /// The IXpsOMImageResource interface of an image resource that is used in the current page or a page that has already been added. /// /// /// /// /// The IXpsOMColorProfileResource interface of color profile resource that is used in the current page or a page that has /// already been added. /// /// /// /// /// The IXpsOMStoryFragmentsResource interface of a story fragments resource that is used in the current page or a page that has /// already been added. /// /// /// /// /// The IXpsOMDocumentStructureResource interface of a document structure resource that is used in the current document or a /// document that has already been added. /// /// /// /// /// The IXpsOMSignatureBlockResource interface of a signature block resource that is used in the current document or a document /// that has already been added. /// /// /// /// This method returns an error if resource contains one of the following: /// /// /// The IXpsOMRemoteDictionaryResource interface of a remote resource dictionary. /// /// /// The IXpsOMPrintTicketResource interface of a print ticket. /// /// /// The IXpsOMImageResource interface of a thumbnail image. /// /// /// /// This method returns an error when resource references a resource that has the same name as a resource that has already been /// added to the stream or for which there is no existing relationship. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackagewriter-addresource HRESULT // AddResource( IXpsOMResource *resource ); [MethodImpl(MethodImplOptions.InternalCall)] void AddResource([In] IXpsOMResource resource); /// Closes any open parts of the package, then closes the package. /// /// If any discardable parts that are referenced by a call to AddPage have not been received, an error will be returned. /// After this method is called, calling any other IXpsOMPackageWriter method except IsClosed will return an error. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackagewriter-close HRESULT Close(); [MethodImpl(MethodImplOptions.InternalCall)] void Close(); /// Gets the status of the IXpsOMPackageWriter interface. /// /// A pointer to a Boolean variable that receives the status of the IXpsOMPackageWriter interface. /// /// /// Value /// Meaning /// /// /// TRUE /// The package is closed and no more content can be added. /// /// /// FALSE /// The package is open and content can be added. /// /// /// /// If the IXpsOMPackageWriter interface is closed, operations on the package are not allowed. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackagewriter-isclosed HRESULT // IsClosed( BOOL *isClosed ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Bool)] bool IsClosed(); } /// /// Provides the root node of a tree of objects that hold the contents of a single page. /// The IXpsOMPage interface corresponds to the FixedPage element in XPS document markup. /// /// /// The code example that follows illustrates how to create an instance of this interface. /// For information about using this interface in a program, see Create a Blank XPS OM and Navigate the XPS OM. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompage [PInvokeData("xpsobjectmodel.h", MSDNShortId = "741deebd-9dce-4cd9-883e-4586c10a4609")] [ComImport, Guid("D3E18888-F120-4FEE-8C68-35296EAE91D4"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPage : IXpsOMPart { /// Gets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the part name. If the part name has not been set (by the SetPartName /// method), a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT // GetPartName( IOpcPartUri **partUri ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Interface)] new IOpcPartUri GetPartName(); /// Sets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the name of this part. This parameter cannot be NULL. /// /// /// IXpsOMPackageWriter will generate an error if it encounters an XPS document part whose name is the same as that of a part it /// has previously serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT // SetPartName( IOpcPartUri *partUri ); [MethodImpl(MethodImplOptions.InternalCall)] new void SetPartName([In] IOpcPartUri partUri); /// Gets a pointer to the IXpsOMPageReference interface that contains the page. /// A pointer to the IXpsOMPageReference interface that contains the page. /// When the page does not have an owner, a NULL pointer is returned in pageReference. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getowner HRESULT GetOwner( // IXpsOMPageReference **pageReference ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMPageReference GetOwner(); /// Gets a pointer to an IXpsOMVisualCollection interface that contains a collection of the page's visual objects. /// A pointer to the IXpsOMVisualCollection interface that contains a collection of the page's visual objects. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getvisuals HRESULT GetVisuals( // IXpsOMVisualCollection **visuals ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMVisualCollection GetVisuals(); /// Gets the page dimensions. /// /// The page dimensions. /// /// Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are /// 816 by 1,056 XPS units. /// /// /// The default page size is passed to IXpsOMObjectFactory::CreatePage in the pageDimensions parameter. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getpagedimensions HRESULT // GetPageDimensions( XPS_SIZE *pageDimensions ); [MethodImpl(MethodImplOptions.InternalCall)] XPS_SIZE GetPageDimensions(); /// Sets dimensions of the page. /// /// Dimensions of the page. /// /// Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are /// 816 by 1,056 XPS units. /// /// The XPS_SIZE structure has the following properties: /// 0 ≤ value ) /// 0 ≤ value ) /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setpagedimensions HRESULT // SetPageDimensions( const XPS_SIZE *pageDimensions ); [MethodImpl(MethodImplOptions.InternalCall)] void SetPageDimensions(in XPS_SIZE pageDimensions); /// Gets the dimensions of the page's content box. /// The dimensions of the content box. /// /// The content box indicates where ink appears on the page. /// The default content box of a page is /// /// /// XPS_RECT field /// Default value /// /// /// x /// 0 /// /// /// y /// 0 /// /// /// width /// pageDimension.width /// /// /// height /// pageDimension.height /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getcontentbox HRESULT // GetContentBox( XPS_RECT *contentBox ); [MethodImpl(MethodImplOptions.InternalCall)] XPS_RECT GetContentBox(); /// Sets the dimensions of the page's content box. /// /// The dimensions of the page's content box. /// /// /// contentBox field /// Valid values /// /// /// contentBox.width /// Greater than or equal to 0.0 and less than or equal to (pageDimensions.width - contentBox.x). /// /// /// contentBox.height /// Greater than or equal to 0.0 and less than or equal to (pageDimensions.height - contentBox.y). /// /// /// contentBox.x /// Greater than or equal to 0.0 and less than pageDimensions.width. /// /// /// contentBox.y /// Greater than or equal to 0.0 and less than pageDimensions.height. /// /// /// /// /// The content box specifies where ink appears on the page. /// The content box dimensions are not checked against the page dimensions until the page is serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setcontentbox HRESULT // SetContentBox( const XPS_RECT *contentBox ); [MethodImpl(MethodImplOptions.InternalCall)] void SetContentBox(in XPS_RECT contentBox); /// Gets the dimensions of the page's bleed box. /// The dimensions of the bleed box. /// /// The default bleed box of a page is: /// /// /// XPS_RECT field /// Default value /// /// /// x /// 0 /// /// /// y /// 0 /// /// /// width /// pageDimension.width /// /// /// height /// pageDimension.height /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getbleedbox HRESULT // GetBleedBox( XPS_RECT *bleedBox ); [MethodImpl(MethodImplOptions.InternalCall)] XPS_RECT GetBleedBox(); /// Sets the dimensions of the page's bleed box. /// /// The dimensions of the page's bleed box. This parameter must not be NULL. /// A valid bleed box has the following properties: /// ####### x)) ≤ value ) /// ####### y)) ≤ value ) /// 0) /// 0) /// /// The bleed box dimensions are not checked against the page dimensions until the page is serialized. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setbleedbox HRESULT // SetBleedBox( const XPS_RECT *bleedBox ); [MethodImpl(MethodImplOptions.InternalCall)] void SetBleedBox(in XPS_RECT bleedBox); /// Gets the Language property of the page. /// /// A language tag string that represents the language of the page contents. If the Language property has not been set, a /// NULL pointer is returned. /// /// /// The default value is the language tag string that is passed to IXpsOMObjectFactory::CreatePage in the language parameter. /// /// Internet Engineering Task Force (IETF) RFC 3066 describes the recommended encoding of the language tag string that is /// returned in language. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getlanguage HRESULT // GetLanguage( LPWSTR *language ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.LPWStr)] string GetLanguage(); /// Sets the Language property of the page. /// /// A language tag string that represents the language of the page content. A NULL pointer clears the previously assigned language. /// /// /// The language tag string must conform to the language tag syntax that is described in the Internet Engineering Task Force /// (IETF) RFC 3066. For more information, go to http://tools.ietf.org/html/rfc3066. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setlanguage HRESULT // SetLanguage( LPCWSTR language ); [MethodImpl(MethodImplOptions.InternalCall)] void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language); /// Gets the Name property of the page. /// /// The Name property of the page. A NULL pointer is returned if the Name property has not been set. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getname HRESULT GetName( // LPWSTR *name ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.LPWStr)] string GetName(); /// Sets the Name property of this page. /// /// A pointer to the name string to be set as the page's Name property. A NULL pointer clears any previously /// assigned name. /// /// /// The Name property identifies the current page as a named, addressable point in a document, allowing the page to be /// referenced by a hyperlink. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setname HRESULT SetName( // LPCWSTR name ); [MethodImpl(MethodImplOptions.InternalCall)] void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name); /// Gets a Boolean value that indicates whether the page is the target of a hyperlink. /// /// A Boolean value that indicates whether the page is the target of a hyperlink. /// /// /// Value /// Meaning /// /// /// TRUE /// The page is the target of a hyperlink. /// /// /// FALSE /// The page is not the target of a hyperlink. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getishyperlinktarget HRESULT // GetIsHyperlinkTarget( BOOL *isHyperlinkTarget ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.Bool)] bool GetIsHyperlinkTarget(); /// Specifies whether the page is the target of a hyperlink. /// /// The Boolean value that indicates whether the page is the target of a hyperlink. /// /// /// Value /// Meaning /// /// /// TRUE /// The page is the target of a hyperlink. /// /// /// FALSE /// The page is not the target of a hyperlink. /// /// /// /// /// Only those pages that have this property set to TRUE will be included in the hyperlink targets that are collected by IXpsOMPageReference::CollectLinkTargets. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setishyperlinktarget HRESULT // SetIsHyperlinkTarget( BOOL isHyperlinkTarget ); [MethodImpl(MethodImplOptions.InternalCall)] void SetIsHyperlinkTarget([In, MarshalAs(UnmanagedType.Bool)] bool isHyperlinkTarget); /// Gets a pointer to the resolved IXpsOMDictionary interface that is associated with this page. /// /// A pointer to the resolved IXpsOMDictionary interface that is associated with this page. /// The value that is returned in this parameter depends on which method has most recently been called to set the dictionary. /// /// /// Most recent method called /// Object that is returned in resourceDictionary /// /// /// SetDictionaryLocal /// The local dictionary resource that is set by SetDictionaryLocal. /// /// /// SetDictionaryResource /// The shared dictionary in the dictionary resource that is set by SetDictionaryResource. /// /// /// Neither SetDictionaryLocal nor SetDictionaryResource has been called yet. /// NULL pointer. /// /// /// /// /// /// Whether the dictionary is local or is contained within a remote dictionary resource, this method returns an IXpsOMDictionary /// interface pointer. GetOwner determines whether the dictionary is remote. /// /// /// If a page contains a remote dictionary, GetDictionary will deserialize the dictionary. If the page contains a remote /// dictionary that is not valid, GetDictionary might return a deserialization error code. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionary HRESULT // GetDictionary( IXpsOMDictionary **resourceDictionary ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMDictionary GetDictionary(); /// /// Gets a pointer to the IXpsOMDictionary interface of the local, unshared dictionary that is associated with this page. /// /// /// /// A pointer to the IXpsOMDictionary interface of the local, unshared dictionary that is associated with this page. If no /// IXpsOMDictionary interface pointer has been set or if a remote dictionary resource has been set, a NULL /// pointer is returned. /// /// /// /// Most recent method called /// Object that is returned in resourceDictionary /// /// /// SetDictionaryLocal /// The local dictionary resource that is set by SetDictionaryLocal. /// /// /// SetDictionaryResource /// NULL pointer. /// /// /// Neither SetDictionaryLocal nor SetDictionaryResource has been called yet. /// NULL pointer. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionarylocal HRESULT // GetDictionaryLocal( IXpsOMDictionary **resourceDictionary ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMDictionary GetDictionaryLocal(); /// Sets the IXpsOMDictionary interface pointer of the page's local dictionary resource. /// /// The IXpsOMDictionary interface pointer to be set for the page. A NULL pointer releases any previously assigned local dictionary. /// /// /// /// After you call SetDictionaryLocal, the remote dictionary resource is released and GetDictionaryResource returns a /// NULL pointer in the remoteDictionaryResource parameter. The table that follows explains the relationship between the /// local and remote values of this property. /// /// /// /// Most recent method called /// Object that is returned in resourceDictionary by GetDictionary /// Object that is returned in resourceDictionary by GetDictionaryLocal /// Object that is returned in remoteDictionaryResource by GetDictionaryResource /// /// /// SetDictionaryLocal (this method) /// The local dictionary resource that is set by SetDictionaryLocal. /// The local dictionary resource that is set by SetDictionaryLocal. /// NULL pointer. /// /// /// SetDictionaryResource /// The shared dictionary in the dictionary resource that is set by SetDictionaryResource. /// NULL pointer. /// The remote dictionary resource that is set by SetDictionaryResource. /// /// /// Neither SetDictionaryLocal nor SetDictionaryResource has been called yet. /// NULL pointer. /// NULL pointer. /// NULL pointer. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setdictionarylocal HRESULT // SetDictionaryLocal( IXpsOMDictionary *resourceDictionary ); [MethodImpl(MethodImplOptions.InternalCall)] void SetDictionaryLocal([In] IXpsOMDictionary resourceDictionary); /// /// Gets a pointer to the IXpsOMRemoteDictionaryResource interface of the shared dictionary resource that is used by this page. /// /// /// /// A pointer to the IXpsOMRemoteDictionaryResource interface of the shared dictionary resource that is used by this page. If no /// IXpsOMRemoteDictionaryResource interface has been set or if a local dictionary has been set, a NULL pointer is returned. /// /// /// /// Most recent method called /// Object that is returned in remoteDictionaryResource /// /// /// SetDictionaryLocal /// NULL pointer. /// /// /// SetDictionaryResource /// The remote dictionary resource that is set by SetDictionaryResource. /// /// /// Neither SetDictionaryLocal nor SetDictionaryResource has been called yet. /// NULL pointer. /// /// /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionaryresource HRESULT // GetDictionaryResource( IXpsOMRemoteDictionaryResource **remoteDictionaryResource ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMRemoteDictionaryResource GetDictionaryResource(); /// Sets the IXpsOMRemoteDictionaryResource interface pointer of the page's remote dictionary resource. /// /// The IXpsOMRemoteDictionaryResource interface pointer to be set for the page. A NULL value releases the previously /// assigned dictionary resource. /// /// /// Setting this value will cause GetDictionaryLocal to return NULL. /// /// /// Most recent method called /// Object that is returned in resourceDictionary by GetDictionary /// Object that is returned in resourceDictionary by GetDictionaryLocal /// Object that is returned in remoteDictionaryResource by GetDictionaryResource /// /// /// SetDictionaryLocal /// The local dictionary resource that is set by SetDictionaryLocal. /// The local dictionary resource that is set by SetDictionaryLocal. /// NULL pointer. /// /// /// SetDictionaryResource (this method) /// The shared dictionary in the dictionary resource that is set by SetDictionaryResource. /// NULL pointer. /// The remote dictionary resource that is set by SetDictionaryResource. /// /// /// Neither SetDictionaryLocal nor SetDictionaryResource has been called yet. /// NULL pointer. /// NULL pointer. /// NULL pointer. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setdictionaryresource HRESULT // SetDictionaryResource( IXpsOMRemoteDictionaryResource *remoteDictionaryResource ); [MethodImpl(MethodImplOptions.InternalCall)] void SetDictionaryResource([In] IXpsOMRemoteDictionaryResource remoteDictionaryResource); /// Writes the page to the specified stream. /// The stream that receives the serialized contents of the page. /// /// /// A Boolean value that indicates whether the document markup of the page is to be optimized for size when the page is written /// to the stream. /// /// /// /// Value /// Meaning /// /// /// TRUE /// The package writer will attempt to optimize the markup for minimum size when writing the page to the stream. /// /// /// FALSE /// The package writer will not attempt any optimization when writing the page to the stream. /// /// /// /// /// /// To examine the XPS markup of a page before it is written to an XPS package, an application can call the Write method /// to write the page's contents to a stream. The application can then read that stream to examine the XPS markup as it would be /// serialized when it is written to the XPS package. /// /// The XPS markup that is written to the stream by this method contains the page markup but none of the page's resources. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-write HRESULT Write( // ISequentialStream *stream, BOOL optimizeMarkupSize ); [MethodImpl(MethodImplOptions.InternalCall)] void Write([In] ISequentialStream stream, [In, MarshalAs(UnmanagedType.Bool)] bool optimizeMarkupSize); /// Generates a unique name that can be used as a lookup key by a resource in a resource dictionary. /// The type of IXpsOMShareable object for which the lookup key is generated. /// The lookup key string that is generated by this method. /// /// /// To be unique in the dictionary, the string generated by GenerateUnusedLookupKey consists of a prefix string that is /// based on the object type and is followed by four unique alphanumeric characters. /// /// The prefix string for each object type is shown in the following table. /// /// /// Object type /// Prefix string for this object type /// /// /// XPS_OBJECT_TYPE_CANVAS /// Canvas_ /// /// /// XPS_OBJECT_TYPE_GEOMETRY /// Geometry_ /// /// /// XPS_OBJECT_TYPE_GLYPHS /// Glyphs_ /// /// /// XPS_OBJECT_TYPE_IMAGE_BRUSH /// IBrush_ /// /// /// XPS_OBJECT_TYPE_LINEAR_GRADIENT_BRUSH /// LGBrush_ /// /// /// XPS_OBJECT_TYPE_MATRIX_TRANSFORM /// MTransform_ /// /// /// XPS_OBJECT_TYPE_PATH /// Path_ /// /// /// XPS_OBJECT_TYPE_RADIAL_GRADIENT_BRUSH /// RGBrush_ /// /// /// XPS_OBJECT_TYPE_SOLID_COLOR_BRUSH /// SCBrush_ /// /// /// XPS_OBJECT_TYPE_VISUAL_BRUSH /// VBrush_ /// /// /// /// Note This method returns a key string that is unique within the context of this page. It is not guaranteed to return /// a key that is unique in a remote dictionary resource that could be used by more than one page. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-generateunusedlookupkey // HRESULT GenerateUnusedLookupKey( XPS_OBJECT_TYPE type, LPWSTR *key ); [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.LPWStr)] string GenerateUnusedLookupKey([In] XPS_OBJECT_TYPE type); /// Makes a deep copy of the interface. /// A pointer to the copy of the interface. /// /// This method does not update any of the resource pointers in the copy. /// The owner of the new interface is NULL. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-clone HRESULT Clone( // IXpsOMPage **page ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMPage Clone(); } /// /// Enables virtualization of pages in an XPS document. /// /// A page reference defers loading of the full object model of a page until the page is requested. If the page has not been /// altered, it can also be unloaded on request. /// /// /// /// The code example that follows illustrates how to create an instance of this interface. /// For information about using this interface in a program, see Create a Blank XPS OM and Navigate the XPS OM. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompagereference [PInvokeData("xpsobjectmodel.h", MSDNShortId = "cdebab24-f918-4235-b4d5-5ee1007ade87")] [ComImport, Guid("ED360180-6F92-4998-890D-2F208531A0A0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPageReference { /// Gets a pointer to the IXpsOMDocument interface that contains the page reference. /// /// A pointer to the IXpsOMDocument interface that contains the page reference. If the page reference does not have an owner, a /// NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getowner HRESULT // GetOwner( IXpsOMDocument **document ); IXpsOMDocument GetOwner(); /// Gets a pointer to the IXpsOMPage interface that contains the page. /// A pointer to the IXpsOMPage interface of the page. If a page has not been set, a NULL pointer is returned. /// /// /// If a page has not been set but the IXpsOMPackage interface that contains the page's reference has loaded from an XPS /// package, this method will load and return the page. If a page has not been set and the IXpsOMPackage interface that /// contains this page reference has not loaded from an XPS package, a NULL pointer will be returned. /// /// /// Depending on the page's contents, this call might take some time to return and it might also cause unexpected changes in /// other objects in the document tree. For example, if the page has remote resource dictionary references, the remote resource /// dictionary might get modified. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getpage HRESULT // GetPage( IXpsOMPage **page ); IXpsOMPage GetPage(); /// Sets the IXpsOMPage interface of the page reference. /// The IXpsOMPage interface pointer of the page. /// /// The page added by this method can be empty or fully constructed. /// /// If the incoming page has references to remote dictionary objects, those objects will not be imported into the document /// object by this call. They must be added in a separate call to the IXpsOMPage::SetDictionaryResource or /// IXpsOMCanvas::SetDictionaryResource method. /// /// /// If a page has been set, the calling method must first release that page before calling SetPage with a new page. To /// explain, once SetPage has been called with a new page, the original page cannot be discarded even if it still exists /// in the package. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setpage HRESULT // SetPage( IXpsOMPage *page ); void SetPage([In] IXpsOMPage page); /// Discards the page from memory. /// /// /// 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. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-discardpage HRESULT DiscardPage(); void DiscardPage(); /// Gets the referenced page status, which indicates whether the page is loaded. /// /// A Boolean value that indicates the status of the page. /// /// /// Value /// Meaning /// /// /// TRUE /// The page is loaded. /// /// /// FALSE /// The page is not loaded. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-ispageloaded HRESULT // IsPageLoaded( BOOL *isPageLoaded ); [return: MarshalAs(UnmanagedType.Bool)] bool IsPageLoaded(); /// Gets the suggested dimensions of the page. /// /// The suggested dimensions of the page. /// /// Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are /// 816 by 1,056 XPS units. /// /// /// Note If a dimension value has not been set, a value of –1.0 is returned for that dimension. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getadvisorypagedimensions // HRESULT GetAdvisoryPageDimensions( XPS_SIZE *pageDimensions ); XPS_SIZE GetAdvisoryPageDimensions(); /// Sets the suggested dimensions of the page. /// /// The suggested dimensions to be set for the page. /// /// The height and width members must have the value of –1.0 or a value that is greater than or equal to +1.0. /// /// /// Size is described in XPS units. There are 96 XPS units per inch. For example, the dimensions of an 8.5" by 11.0" page are /// 816 by 1,056 XPS units. /// /// /// /// The height and width members of the XPS_SIZE structure that is referenced by pageDimensions must have values /// that are greater than or equal to +1.0, if those fields' values are to be set, or –1.0 if not. For example, if an advisory /// dimension were to be set just for the page width, pageDimensions.width would have the desired value and /// pageDimensions.height would have the value of –1.0. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setadvisorypagedimensions // HRESULT SetAdvisoryPageDimensions( const XPS_SIZE *pageDimensions ); void SetAdvisoryPageDimensions(in XPS_SIZE pageDimensions); /// /// Gets a pointer to the IXpsOMStoryFragmentsResource interface of the StoryFragments part resource that is associated with the page. /// /// /// A pointer to the IXpsOMStoryFragmentsResource interface of the StoryFragments part resource that is associated with the /// page. If there is no StoryFragments part, a NULL pointer is returned. /// /// /// /// After the resource is parsed and loaded into the XPS OM, this method might return an error that applies to another resource. /// This occurs because when a resource is loaded, all of the relationships are parsed. /// /// /// The StoryFragments part of a page contains the XML markup that describes the portions of one or more stories that are /// associated with a single fixed page. Some of the document contents that might be described by the XML markup in a /// StoryFragments part include the story's tables and paragraphs that are found on the page. /// /// The XML markup in the DocumentStructure and StoryFragments parts is described in the XML Paper Specification. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getstoryfragmentsresource // HRESULT GetStoryFragmentsResource( IXpsOMStoryFragmentsResource **storyFragmentsResource ); IXpsOMStoryFragmentsResource GetStoryFragmentsResource(); /// /// Sets the IXpsOMStoryFragmentsResource interface pointer of the StoryFragments resource to be assigned to the page. /// /// /// A pointer to the IXpsOMStoryFragmentsResource interface of the StoryFragments part resource to be assigned to the page. If /// an IXpsOMStoryFragmentsResource interface has been set, a NULL pointer will release it. /// /// /// /// The StoryFragments part of a page contains the XML markup that describes the portions of one or more stories that are /// associated with a single fixed page. Some of the document contents that might be described by the XML markup in a /// StoryFragments part include the story's tables and paragraphs that are found on the page. /// /// The XML markup of the DocumentStructure and StoryFragments parts is described in the XML Paper Specification. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setstoryfragmentsresource // HRESULT SetStoryFragmentsResource( IXpsOMStoryFragmentsResource *storyFragmentsResource ); void SetStoryFragmentsResource([In] IXpsOMStoryFragmentsResource storyFragmentsResource); /// /// Gets a pointer to the IXpsOMPrintTicketResource interface of the page-level print ticket resource that is associated with /// the page. /// /// /// A pointer to the IXpsOMPrintTicketResource interface of the page-level print ticket resource that is associated with the /// page. If no print ticket resource has been set, a NULL pointer is returned. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getprintticketresource // HRESULT GetPrintTicketResource( IXpsOMPrintTicketResource **printTicketResource ); IXpsOMPrintTicketResource GetPrintTicketResource(); /// /// Sets the IXpsOMPrintTicketResource interface pointer of the page-level print ticket resource that is to be assigned to the page. /// /// /// A pointer to the IXpsOMPrintTicketResource interface of the page-level print ticket resource that is to be assigned to the /// page. If a print ticket has already been set, a NULL pointer releases it. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setprintticketresource // HRESULT SetPrintTicketResource( IXpsOMPrintTicketResource *printTicketResource ); void SetPrintTicketResource([In] IXpsOMPrintTicketResource printTicketResource); /// /// Gets a pointer to the IXpsOMImageResource interface of the thumbnail image resource that is associated with the page. /// /// /// A pointer to the IXpsOMImageResource interface of the thumbnail image resource that is associated with the page. If no /// thumbnail image resource has been assigned to the page, a NULL pointer is returned. /// /// /// The thumbnail image is a small, visual representation of the page's contents. /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getthumbnailresource // HRESULT GetThumbnailResource( IXpsOMImageResource **imageResource ); IXpsOMImageResource GetThumbnailResource(); /// /// Sets the pointer to the IXpsOMImageResource interface of the thumbnail image resource to be assigned to the page. /// /// /// A pointer to the IXpsOMImageResource interface of the thumbnail image resource to be assigned to the page. If an /// IXpsOMImageResource interface has been set, a NULL pointer will release it. /// /// /// The thumbnail image is a small, visual representation of the document's contents. /// The image type of the image resource must be either XPS_IMAGE_TYPE_JPEG or XPS_IMAGE_TYPE_PNG. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setthumbnailresource // HRESULT SetThumbnailResource( IXpsOMImageResource *imageResource ); void SetThumbnailResource([In] IXpsOMImageResource imageResource); /// /// Gets an IXpsOMNameCollection interface that contains the names of all the document subtree objects whose /// IsHyperlinkTarget property is set to TRUE. /// /// /// /// A pointer to an IXpsOMNameCollection interface that contains the names of all the document subtree objects whose /// IsHyperlinkTarget property is set to TRUE. If no such objects exist in the document, the /// IXpsOMNameCollection interface will be empty. /// /// Note Every time this method is called, it returns a new collection. /// /// /// /// If the page is originally loaded from a package but is not currently loaded in the object model, this method returns the /// values specified in the original PageContent.LinkTargets markup. /// /// If the document does not have any link targets, the name collection returned in linkTargets will be empty. /// To get the number of elements in the collection that is returned in linkTargets, call the collection's GetCount method. /// /// This method returns the pointer to a new collection every time it is called. To prevent a memory leak, the pointer to a /// previous collection should be released when it is no longer needed or before the pointer variable is reused for another call /// to this method. The following code example shows how this can be done in a program. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-collectlinktargets // HRESULT CollectLinkTargets( IXpsOMNameCollection **linkTargets ); IXpsOMNameCollection CollectLinkTargets(); /// Creates a list of all part-based resources that are associated with the page. /// /// A pointer to the IXpsOMPartResources interface that contains the list of all part-based resources that are associated with /// the page. /// /// /// /// If the page is not loaded when this method is called, this method finds the part-based resources that are associated with /// this page by parsing the relationships part of the page and returns them in the partResources parameter. If the page is /// loaded, this method traverses the page's object model to find the part-based resources and returns them in partResources. /// /// /// The list of resource parts that are returned in the IXpsOMPartResources interface is a snapshot of the document structure /// that is taken when the method is called. Changes made to the document after this call are not reflected in the /// IXpsOMPartResources interface after it is returned by this method. Likewise, changes made to the /// IXpsOMPartResources interface that is returned by this method will not be reflected in the document contents. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-collectpartresources // HRESULT CollectPartResources( IXpsOMPartResources **partResources ); IXpsOMPartResources CollectPartResources(); /// /// Gets a Boolean value that indicates whether the document sub-tree of the referenced page includes any Glyphs that have a /// font resource whose EmbeddingOption property is set to XPS_FONT_EMBEDDING_RESTRICTED. /// /// /// /// A Boolean value that indicates whether the document sub-tree of the referenced page includes any IXpsOMGlyphs interfaces /// that have a font resource whose EmbeddingOption property is set to XPS_FONT_EMBEDDING_RESTRICTED. /// /// /// /// Value /// Meaning /// /// /// TRUE /// /// If the referenced page is loaded, the page references at least one font resource whose EmbeddingOption property is set to /// XPS_FONT_EMBEDDING_RESTRICTED. If the referenced page is not loaded, it has a relationship with at least one font resource /// whose EmbeddingOption property is set to XPS_FONT_EMBEDDING_RESTRICTED. /// /// /// /// FALSE /// /// If the referenced page is loaded, the page does not reference any font resources whose EmbeddingOption property is set to /// XPS_FONT_EMBEDDING_RESTRICTED. If the referenced page is not loaded, it does not have a relationship with a font resource /// whose EmbeddingOption property is set to XPS_FONT_EMBEDDING_RESTRICTED. /// /// /// /// /// /// This value is not updated automatically. If fonts or glyphs are added or removed such that the value changes, /// HasRestrictedFonts must be called again to get the current value. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-hasrestrictedfonts // HRESULT HasRestrictedFonts( BOOL *restrictedFonts ); [return: MarshalAs(UnmanagedType.Bool)] bool HasRestrictedFonts(); /// Makes a deep copy of the interface. /// A pointer to the copy of the interface. /// This method does not update the resource pointers in the new IXpsOMPageReference interface. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-clone HRESULT Clone( // IXpsOMPageReference **pageReference ); IXpsOMPageReference Clone(); } /// A collection of IXpsOMPageReference interface pointers. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompagereferencecollection [PInvokeData("xpsobjectmodel.h", MSDNShortId = "4b51bc29-c653-41fa-bbd3-9ff529f84e4e")] [ComImport, Guid("CA16BA4D-E7B9-45C5-958B-F98022473745"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPageReferenceCollection { /// Gets the number of IXpsOMPageReference interface pointers in the collection. /// The number of IXpsOMPageReference interface pointers in the collection. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-getcount // HRESULT GetCount( UINT32 *count ); uint GetCount(); /// Gets an IXpsOMPageReference interface pointer from a specified location in the collection. /// The zero-based index of the IXpsOMPageReference interface pointer to be obtained. /// The IXpsOMPageReference interface pointer at the location specified by index. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-getat // HRESULT GetAt( UINT32 index, IXpsOMPageReference **pageReference ); IXpsOMPageReference GetAt([In] uint index); /// Inserts an IXpsOMPageReference interface pointer at a specified location in the collection. /// /// The zero-based index in the collection where the interface pointer that is passed in pageReference is to be inserted. /// /// /// The IXpsOMPageReference interface pointer that is to be inserted at the location specified by index. /// /// /// /// At the location specified by index, this method inserts the IXpsOMPageReference interface pointer that is passed in /// pageReference. Prior to the insertion, the pointer in this and all subsequent locations is moved up by one index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-insertat // HRESULT InsertAt( UINT32 index, IXpsOMPageReference *pageReference ); void InsertAt([In] uint index, [In] IXpsOMPageReference pageReference); /// Removes and releases an IXpsOMPageReference interface pointer from a specified location in the collection. /// /// The zero-based index in the collection from which an IXpsOMPageReference interface pointer is to be removed and released. /// /// /// /// This method releases the interface referenced by the pointer at the location specified by index. After releasing the /// interface, this method compacts the collection by reducing by 1 the index of each pointer subsequent to index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-removeat // HRESULT RemoveAt( UINT32 index ); void RemoveAt([In] uint index); /// Replaces an IXpsOMPageReference interface pointer at a specified location in the collection. /// The zero-based index in the collection where an IXpsOMPageReference interface pointer is to be replaced. /// /// The IXpsOMPageReference interface pointer that will replace current contents at the location specified by index. /// /// /// /// At the location specified by index, this method releases the IXpsOMPageReference interface referenced by the existing /// pointer, then writes the pointer that is passed in pageReference. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-setat // HRESULT SetAt( UINT32 index, IXpsOMPageReference *pageReference ); void SetAt([In] uint index, [In] IXpsOMPageReference pageReference); /// Appends an IXpsOMPageReference interface to the end of the collection. /// A pointer to the IXpsOMPageReference interface that is to be appended to the collection. /// If the method succeeds, it returns S_OK; otherwise, it returns an HRESULT error code. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereferencecollection-append // HRESULT Append( IXpsOMPageReference *pageReference ); void Append([In] IXpsOMPageReference pageReference); } /// The base interface for all XPS document part interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompart [PInvokeData("xpsobjectmodel.h", MSDNShortId = "71cd0155-6c95-42ca-bfc3-dffd43d95dc9")] [ComImport, Guid("74EB2F0B-A91E-4486-AFAC-0FABECA3DFC6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPart { /// Gets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the part name. If the part name has not been set (by the SetPartName /// method), a NULL pointer is returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT // GetPartName( IOpcPartUri **partUri ); [MethodImpl(MethodImplOptions.InternalCall)] IOpcPartUri GetPartName(); /// Sets the name that will be used when the part is serialized. /// /// A pointer to the IOpcPartUri interface that contains the name of this part. This parameter cannot be NULL. /// /// /// IXpsOMPackageWriter will generate an error if it encounters an XPS document part whose name is the same as that of a part it /// has previously serialized. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT // SetPartName( IOpcPartUri *partUri ); [MethodImpl(MethodImplOptions.InternalCall)] void SetPartName([In] IOpcPartUri partUri); } /// Provides access to all shared, part-based resources of the XPS document. /// The code example that follows illustrates how to create an instance of this interface. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsompartresources [PInvokeData("xpsobjectmodel.h", MSDNShortId = "9f706f23-25a0-40ee-93f4-3d7ac98ad6ed")] [ComImport, Guid("F4CF7729-4864-4275-99B3-A8717163ECAF"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPartResources { /// Gets the IXpsOMFontResourceCollection interface that contains the fonts that are used in the XPS document. /// A pointer to the IXpsOMFontResourceCollection interface that contains the fonts that are used in the XPS document. /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompartresources-getfontresources // HRESULT GetFontResources( IXpsOMFontResourceCollection **fontResources ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMFontResourceCollection GetFontResources(); /// Gets the IXpsOMImageResourceCollection interface that contains the images that are used in the XPS document. /// A pointer to the IXpsOMImageResourceCollection interface that contains the images that are used in the XPS document. /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompartresources-getimageresources // HRESULT GetImageResources( IXpsOMImageResourceCollection **imageResources ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMImageResourceCollection GetImageResources(); /// /// Gets the IXpsOMColorProfileResourceCollection interface that contains the color profiles that are used in the XPS document. /// /// /// A pointer to the IXpsOMColorProfileResourceCollection interface that contains the color profiles that are used in the XPS document. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompartresources-getcolorprofileresources // HRESULT GetColorProfileResources( IXpsOMColorProfileResourceCollection **colorProfileResources ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMColorProfileResourceCollection GetColorProfileResources(); /// /// Gets the IXpsOMRemoteDictionaryResourceCollection interface that contains the remote resource dictionaries that are used in /// the XPS document. /// /// /// A pointer to the IXpsOMRemoteDictionaryResourceCollection interface that contains the remote resource dictionaries that are /// used in the XPS document. /// /// /// After loading and parsing the resource into the XPS OM, this method might return an error that applies to another resource. /// This occurs because all of the relationships are parsed when a resource is loaded. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompartresources-getremotedictionaryresources // HRESULT GetRemoteDictionaryResources( IXpsOMRemoteDictionaryResourceCollection **dictionaryResources ); [MethodImpl(MethodImplOptions.InternalCall)] IXpsOMRemoteDictionaryResourceCollection GetRemoteDictionaryResources(); } /// A collection of IOpcPartUri interface pointers. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nn-xpsobjectmodel-ixpsomparturicollection [PInvokeData("xpsobjectmodel.h", MSDNShortId = "05fe9700-19e6-4e63-9693-cfa4b019f643")] [ComImport, Guid("57C650D4-067C-4893-8C33-F62A0633730F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IXpsOMPartUriCollection { /// Gets the number of IOpcPartUri interface pointers in the collection. /// The number of IOpcPartUri interface pointers in the collection. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-getcount HRESULT // GetCount( UINT32 *count ); uint GetCount(); /// Gets an IOpcPartUri interface pointer from a specified location in the collection. /// The zero-based index of the IOpcPartUri interface pointer to be obtained. /// The IOpcPartUri interface pointer at the location specified by index. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-getat HRESULT // GetAt( UINT32 index, IOpcPartUri **partUri ); IOpcPartUri GetAt([In] uint index); /// Inserts an IOpcPartUri interface pointer at a specified location in the collection. /// /// The zero-based index of the collection where the interface pointer that is passed in partUri is to be inserted. /// /// The IOpcPartUri interface pointer that is to be inserted at the location specified by index. /// /// /// At the location specified by index, this method inserts the IOpcPartUri interface pointer that is passed in partUri. Prior /// to the insertion, the pointer in this and all subsequent locations is moved up by one index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-insertat HRESULT // InsertAt( UINT32 index, IOpcPartUri *partUri ); void InsertAt([In] uint index, [In] IOpcPartUri partUri); /// Removes and releases an IOpcPartUri interface pointer from a specified location in the collection. /// /// The zero-based index in the collection from which an IOpcPartUri interface pointer is to be removed and released. /// /// /// /// This method releases the interface referenced by the pointer at the location specified by index. After releasing the /// interface, this method compacts the collection by reducing by 1 the index of each pointer subsequent to index. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-removeat HRESULT // RemoveAt( UINT32 index ); void RemoveAt([In] uint index); /// Replaces an IOpcPartUri interface pointer at a specified location in the collection. /// The zero-based index of the collection where an IOpcPartUri interface pointer is to be replaced. /// /// The IOpcPartUri interface pointer that will replace current contents at the location specified by index. /// /// /// /// At the location specified by index, this method releases the IOpcPartUri interface referenced by the existing pointer, then /// writes the pointer that is passed in partUri. /// /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. /// // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-setat HRESULT // SetAt( UINT32 index, IOpcPartUri *partUri ); void SetAt([In] uint index, [In] IOpcPartUri partUri); /// Appends an IOpcPartUri interface to the end of the collection. /// A pointer to the IOpcPartUri interface that is to be appended to the collection. /// If the method succeeds, it returns S_OK; otherwise, it returns an HRESULT error code. /// For more information about the collection methods, see Working with XPS OM Collection Interfaces. // https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomparturicollection-append HRESULT // Append( IOpcPartUri *partUri ); void Append([In] IOpcPartUri partUri); } } }