AnnotationDocumentPaginator Конструкторы
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Инициализирует новый экземпляр класса AnnotationDocumentPaginator.
Перегрузки
| Имя | Описание |
|---|---|
| AnnotationDocumentPaginator(DocumentPaginator, Stream) |
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginator хранилища заметок Stream. |
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore) |
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginator и AnnotationStore. |
| AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection) |
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginatorхранилища заметок Streamи текста FlowDirection. |
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection) |
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginatorи AnnotationStoreтекстового FlowDirectionэлемента. |
Комментарии
Класс AnnotationDocumentPaginator упаковывает DocumentPaginator указанный AnnotationDocumentPaginator конструктор, чтобы добавить заметки пользователя на страницы для печати.
AnnotationDocumentPaginator(DocumentPaginator, Stream)
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginator хранилища заметок Stream.
public:
AnnotationDocumentPaginator(System::Windows::Documents::DocumentPaginator ^ originalPaginator, System::IO::Stream ^ annotationStore);
public AnnotationDocumentPaginator(System.Windows.Documents.DocumentPaginator originalPaginator, System.IO.Stream annotationStore);
new System.Windows.Annotations.AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator * System.IO.Stream -> System.Windows.Annotations.AnnotationDocumentPaginator
Public Sub New (originalPaginator As DocumentPaginator, annotationStore As Stream)
Параметры
- originalPaginator
- DocumentPaginator
Документ для добавления печатных заметок.
- annotationStore
- Stream
Поток хранилища заметок, из которого извлекаются заметки.
Комментарии
По умолчанию этот конструктор задает направление LeftToRightпотока текста. При необходимости можно использовать одну из перегрузок альтернативного AnnotationDocumentPaginator конструктора, чтобы задать текст FlowDirection другим параметрам.
Класс AnnotationDocumentPaginator упаковывает DocumentPaginator указанный AnnotationDocumentPaginator конструктор, чтобы добавить заметки пользователя на страницы для печати.
Применяется к
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginator и AnnotationStore.
public:
AnnotationDocumentPaginator(System::Windows::Documents::DocumentPaginator ^ originalPaginator, System::Windows::Annotations::Storage::AnnotationStore ^ annotationStore);
public AnnotationDocumentPaginator(System.Windows.Documents.DocumentPaginator originalPaginator, System.Windows.Annotations.Storage.AnnotationStore annotationStore);
new System.Windows.Annotations.AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator * System.Windows.Annotations.Storage.AnnotationStore -> System.Windows.Annotations.AnnotationDocumentPaginator
Public Sub New (originalPaginator As DocumentPaginator, annotationStore As AnnotationStore)
Параметры
- originalPaginator
- DocumentPaginator
Документ для добавления печатных заметок.
- annotationStore
- AnnotationStore
Хранилище, из которого извлекаются заметки.
Примеры
В следующем примере показано использование конструктора AnnotationDocumentPaginator .
PrintDialog prntDialog = new PrintDialog();
if ((bool)prntDialog.ShowDialog())
{
// XpsDocumentWriter.Write() may change the current
// directory to "My Documents" or another user selected
// directory for storing the print document. Save the
// current directory and restore it after calling Write().
string docDir = Directory.GetCurrentDirectory();
// Create and XpsDocumentWriter for the selected printer.
XpsDocumentWriter xdw = PrintQueue.CreateXpsDocumentWriter(
prntDialog.PrintQueue);
// Print the document with annotations.
try
{
xdw.Write(_annotHelper.GetAnnotationDocumentPaginator(
_xpsDocument.GetFixedDocumentSequence()));
}
catch (PrintingCanceledException)
{
// If in the PrintDialog the user chooses a file-based
// output, such as the "MS Office Document Image Writer",
// the user confirms or specifies the actual output
// filename when the xdw.write operation executes.
// If the user clicks "Cancel" in the filename
// dialog a PrintingCanceledException is thrown
// which we catch here and ignore.
// MessageBox.Show("Print output cancelled");
}
// Restore the original document directory to "current".
Directory.SetCurrentDirectory(docDir);
}
Dim prntDialog As New PrintDialog()
If CBool(prntDialog.ShowDialog()) Then
' XpsDocumentWriter.Write() may change the current
' directory to "My Documents" or another user selected
' directory for storing the print document. Save the
' current directory and restore it after calling Write().
Dim docDir As String = Directory.GetCurrentDirectory()
' Create and XpsDocumentWriter for the selected printer.
Dim xdw As XpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(prntDialog.PrintQueue)
' Print the document with annotations.
Try
xdw.Write(_annotHelper.GetAnnotationDocumentPaginator(_xpsDocument.GetFixedDocumentSequence()))
Catch e1 As PrintingCanceledException
' If in the PrintDialog the user chooses a file-based
' output, such as the "MS Office Document Image Writer",
' the user confirms or specifies the actual output
' filename when the xdw.write operation executes.
' If the user clicks "Cancel" in the filename
' dialog a PrintingCanceledException is thrown
' which we catch here and ignore.
End Try
' Restore the original document directory to "current".
Directory.SetCurrentDirectory(docDir)
End If
// ------------------ GetAnnotationDocumentPaginator ------------------
/// <summary>
/// Returns a paginator for printing annotations.</summary>
/// <param name="fds">
/// The FixedDocumentSequence containing
/// the annotations to print.</param>
/// <returns>
/// An paginator for printing the document's annotations.</returns>
public AnnotationDocumentPaginator GetAnnotationDocumentPaginator(
FixedDocumentSequence fds)
{
return new AnnotationDocumentPaginator(
fds.DocumentPaginator, _annotService.Store);
}
' ------------------ GetAnnotationDocumentPaginator ------------------
''' <summary>
''' Returns a paginator for printing annotations.</summary>
''' <param name="fds">
''' The FixedDocumentSequence containing
''' the annotations to print.</param>
''' <returns>
''' An paginator for printing the document's annotations.</returns>
Public Function GetAnnotationDocumentPaginator(ByVal fds As FixedDocumentSequence) As AnnotationDocumentPaginator
Return New AnnotationDocumentPaginator(fds.DocumentPaginator, _annotService.Store)
End Function
Комментарии
По умолчанию этот конструктор задает направление LeftToRightпотока текста. При необходимости можно использовать одну из перегрузок альтернативного AnnotationDocumentPaginator конструктора, чтобы задать текст FlowDirection другим параметрам.
Класс AnnotationDocumentPaginator упаковывает DocumentPaginator указанный AnnotationDocumentPaginator конструктор, чтобы добавить заметки пользователя на страницы для печати.
Применяется к
AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginatorхранилища заметок Streamи текста FlowDirection.
public:
AnnotationDocumentPaginator(System::Windows::Documents::DocumentPaginator ^ originalPaginator, System::IO::Stream ^ annotationStore, System::Windows::FlowDirection flowDirection);
public AnnotationDocumentPaginator(System.Windows.Documents.DocumentPaginator originalPaginator, System.IO.Stream annotationStore, System.Windows.FlowDirection flowDirection);
new System.Windows.Annotations.AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator * System.IO.Stream * System.Windows.FlowDirection -> System.Windows.Annotations.AnnotationDocumentPaginator
Public Sub New (originalPaginator As DocumentPaginator, annotationStore As Stream, flowDirection As FlowDirection)
Параметры
- originalPaginator
- DocumentPaginator
Документ для добавления печатных заметок.
- annotationStore
- Stream
Поток хранилища заметок, из которого извлекаются заметки.
- flowDirection
- FlowDirection
Направление LeftToRight потока текста или RightToLeft.
Комментарии
Класс AnnotationDocumentPaginator упаковывает DocumentPaginator указанный AnnotationDocumentPaginator конструктор, чтобы добавить заметки пользователя на страницы для печати.
Применяется к
AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)
Инициализирует новый экземпляр класса на основе указанного AnnotationDocumentPaginatorDocumentPaginatorи AnnotationStoreтекстового FlowDirectionэлемента.
public:
AnnotationDocumentPaginator(System::Windows::Documents::DocumentPaginator ^ originalPaginator, System::Windows::Annotations::Storage::AnnotationStore ^ annotationStore, System::Windows::FlowDirection flowDirection);
public AnnotationDocumentPaginator(System.Windows.Documents.DocumentPaginator originalPaginator, System.Windows.Annotations.Storage.AnnotationStore annotationStore, System.Windows.FlowDirection flowDirection);
new System.Windows.Annotations.AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator * System.Windows.Annotations.Storage.AnnotationStore * System.Windows.FlowDirection -> System.Windows.Annotations.AnnotationDocumentPaginator
Public Sub New (originalPaginator As DocumentPaginator, annotationStore As AnnotationStore, flowDirection As FlowDirection)
Параметры
- originalPaginator
- DocumentPaginator
Документ для добавления печатных заметок.
- annotationStore
- AnnotationStore
Хранилище, из которого извлекаются заметки.
- flowDirection
- FlowDirection
Направление LeftToRight потока текста или RightToLeft.
Комментарии
Класс AnnotationDocumentPaginator упаковывает DocumentPaginator указанный AnnotationDocumentPaginator конструктор, чтобы добавить заметки пользователя на страницы для печати.