IXpsFixedDocumentSequenceWriter Interface
.NET Framework (current version)
Defines methods and properties for writing a FixedDocumentSequence.
Assembly: ReachFramework (in ReachFramework.dll)
| Name | Description | |
|---|---|---|
![]() | PrintTicket | Sets a PrintTicket for the FixedDocumentSequence that is being written. |
![]() | Uri | Gets the URI of the FixedDocumentSequence that is being written. |
| Name | Description | |
|---|---|---|
![]() | AddFixedDocument() | Adds a new FixedDocument to the FixedDocumentSequence. |
![]() | AddThumbnail(XpsImageType) | Adds an XpsThumbnail image for the FixedDocumentSequence. |
![]() | Commit() | Flushes and closes the FixedDocumentSequence writer. |
The following example shows how to use the AddFixedDocumentSequence method in order to obtain a FixedDocumentSequence writer for adding FixedDocument content to an XpsDocument.
// ------------------------- AddPackageContent ---------------------------- /// <summary> /// Adds a predefined set of content to a given XPS document.</summary> /// <param name="xpsDocument"> /// The package to add the document content to.</param> /// <param name="attachPrintTicket"> /// true to include a PrintTicket with the /// document; otherwise, false.</param> void AddPackageContent (XpsDocument^ xpsDocument, bool attachPrintTicket) { try { PrintTicket^ printTicket = GetPrintTicketFromPrinter(); // PrintTicket is null, there is no need to attach one. if (printTicket == nullptr) { attachPrintTicket = false; } // Add a FixedDocumentSequence at the Package root IXpsFixedDocumentSequenceWriter^ documentSequenceWriter = xpsDocument->AddFixedDocumentSequence(); // Add the 1st FixedDocument to the FixedDocumentSequence. - - - - - IXpsFixedDocumentWriter^ fixedDocumentWriter = documentSequenceWriter->AddFixedDocument(); AddDocumentContent(fixedDocumentWriter); // Commit the 1st Document fixedDocumentWriter->Commit(); // Add a 2nd FixedDocument to the FixedDocumentSequence. - - - - - - fixedDocumentWriter = documentSequenceWriter->AddFixedDocument(); // Add content to the 2nd document. AddDocumentContent(fixedDocumentWriter); // If attaching PrintTickets, attach one at the FixedDocument level. if (attachPrintTicket) { fixedDocumentWriter->PrintTicket = printTicket; } // Commit the 2nd document. fixedDocumentWriter->Commit(); // If attaching PrintTickets, attach one at // the package FixedDocumentSequence level. if (attachPrintTicket) { documentSequenceWriter->PrintTicket = printTicket; } // Commit the FixedDocumentSequence documentSequenceWriter->Commit(); } catch (XpsPackagingException^ xpsException) { throw xpsException; } };// end:AddPackageContent()
.NET Framework
Available since 3.0
Available since 3.0
Show:

