Skip to content

Latest commit

 

History

History
176 lines (130 loc) · 5.6 KB

nf-xpsobjectmodel-ixpsompackage-writetofile.md

File metadata and controls

176 lines (130 loc) · 5.6 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:xpsobjectmodel.IXpsOMPackage.WriteToFile
IXpsOMPackage::WriteToFile (xpsobjectmodel.h)
Writes the XPS package to a specified file.
FALSE
IXpsOMPackage interface [XPS Documents and Packaging]
WriteToFile method
IXpsOMPackage.WriteToFile
IXpsOMPackage::WriteToFile
TRUE
WriteToFile
WriteToFile method [XPS Documents and Packaging]
WriteToFile method [XPS Documents and Packaging]
IXpsOMPackage interface
xps.ixpsompackage_writetofile
xpsobjectmodel/IXpsOMPackage::WriteToFile
xps\ixpsompackage_writetofile.htm
xps
89accde7-989e-4a87-b96e-e47cc6c6954a
12/05/2018
FALSE, IXpsOMPackage interface [XPS Documents and Packaging],WriteToFile method, IXpsOMPackage.WriteToFile, IXpsOMPackage::WriteToFile, TRUE, WriteToFile, WriteToFile method [XPS Documents and Packaging], WriteToFile method [XPS Documents and Packaging],IXpsOMPackage interface, xps.ixpsompackage_writetofile, xpsobjectmodel/IXpsOMPackage::WriteToFile
xpsobjectmodel.h
Windows
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps \| UWP apps]
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps \| UWP apps]
XpsObjectModel.idl
Windows
19H1
IXpsOMPackage::WriteToFile
xpsobjectmodel/IXpsOMPackage::WriteToFile
c++
APIRef
kbSyntax
COM
xpsobjectmodel.h
IXpsOMPackage.WriteToFile

IXpsOMPackage::WriteToFile

-description

Writes the XPS package to a specified file.

-parameters

-param fileName [in]

The name of the file to be created. This parameter must not be NULL.

-param securityAttributes [in]

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.

-param flagsAndAttributes [in]

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.

-param optimizeMarkupSize [in]

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.

-returns

The method returns an HRESULT. Possible values include, but are not limited to, those in the table that follows. For information about XPS document API return values that are not listed in this table, see XPS Document Errors.

Return code Description
S_OK
The method succeeded.
E_POINTER
fileName is NULL.
 

This method calls the Packaging API. For information about the Packaging API return values, see Packaging Errors.

-remarks

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.
 

-see-also

CreateFile

IXpsOMPackage

Packaging Errors

SECURITY_ATTRIBUTES

XML Paper Specification

XPS Document Errors