AnnotationDocumentPaginator Konstruktorer

Definition

Initierar en ny instans av AnnotationDocumentPaginator klassen.

Överlagringar

Name Description
AnnotationDocumentPaginator(DocumentPaginator, Stream)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator anteckningslagring Stream.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator och AnnotationStore.

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator, anteckningslagring Streamoch text FlowDirection.

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator, AnnotationStoreoch text FlowDirection.

Kommentarer

Klassen AnnotationDocumentPaginator omsluter den DocumentPaginator angivna till AnnotationDocumentPaginator konstruktorn för att lägga till användarkommentarerna på sidorna för utskrift.

AnnotationDocumentPaginator(DocumentPaginator, Stream)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator anteckningslagring 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)

Parametrar

originalPaginator
DocumentPaginator

Dokumentet som de utskrivna anteckningarna ska läggas till i.

annotationStore
Stream

Anteckningslagringsströmmen som anteckningarna ska hämtas från.

Kommentarer

Som standard anger konstruktorn textflödesriktningen till LeftToRight. Om det behövs kan du använda en av de alternativa AnnotationDocumentPaginator konstruktoröverlagringarna för att ange texten FlowDirection till en annan inställning.

Klassen AnnotationDocumentPaginator omsluter den DocumentPaginator angivna till AnnotationDocumentPaginator konstruktorn för att lägga till användarkommentarerna på sidorna för utskrift.

Gäller för

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator och 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)

Parametrar

originalPaginator
DocumentPaginator

Dokumentet som de utskrivna anteckningarna ska läggas till i.

annotationStore
AnnotationStore

Arkivet som anteckningarna ska hämtas från.

Exempel

I följande exempel visas hur konstruktorn används 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

Kommentarer

Som standard anger konstruktorn textflödesriktningen till LeftToRight. Om det behövs kan du använda en av de alternativa AnnotationDocumentPaginator konstruktoröverlagringarna för att ange texten FlowDirection till en annan inställning.

Klassen AnnotationDocumentPaginator omsluter den DocumentPaginator angivna till AnnotationDocumentPaginator konstruktorn för att lägga till användarkommentarerna på sidorna för utskrift.

Gäller för

AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator, anteckningslagring Streamoch text 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)

Parametrar

originalPaginator
DocumentPaginator

Dokumentet som de utskrivna anteckningarna ska läggas till i.

annotationStore
Stream

Anteckningslagringsströmmen som anteckningarna ska hämtas från.

flowDirection
FlowDirection

Textflödesriktningen, LeftToRight eller RightToLeft.

Kommentarer

Klassen AnnotationDocumentPaginator omsluter den DocumentPaginator angivna till AnnotationDocumentPaginator konstruktorn för att lägga till användarkommentarerna på sidorna för utskrift.

Gäller för

AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection)

Initierar en ny instans av AnnotationDocumentPaginator klassen baserat på en angiven DocumentPaginator, AnnotationStoreoch text 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)

Parametrar

originalPaginator
DocumentPaginator

Dokumentet som de utskrivna anteckningarna ska läggas till i.

annotationStore
AnnotationStore

Arkivet som anteckningarna ska hämtas från.

flowDirection
FlowDirection

Textflödesriktningen, LeftToRight eller RightToLeft.

Kommentarer

Klassen AnnotationDocumentPaginator omsluter den DocumentPaginator angivna till AnnotationDocumentPaginator konstruktorn för att lägga till användarkommentarerna på sidorna för utskrift.

Gäller för