AnnotationDocumentPaginator Klas
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Biedt een DocumentPaginator indeling voor het afdrukken van een document samen met de bijbehorende aantekeningen.
public ref class AnnotationDocumentPaginator sealed : System::Windows::Documents::DocumentPaginator
public sealed class AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator
type AnnotationDocumentPaginator = class
inherit DocumentPaginator
Public NotInheritable Class AnnotationDocumentPaginator
Inherits DocumentPaginator
- Overname
Voorbeelden
In het volgende voorbeeld ziet u het gebruik van de AnnotationDocumentPaginator klasse.
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
Opmerkingen
De AnnotationDocumentPaginator klasse verpakt de DocumentPaginator opgegeven aan de AnnotationDocumentPaginator constructor om de gebruikersaantekeningen toe te voegen aan de pagina's voor afdrukken.
Constructors
| Name | Description |
|---|---|
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection) |
Initialiseert een nieuw exemplaar van de AnnotationDocumentPaginator klasse op basis van een opgegeven DocumentPaginator, AnnotationStoreen tekst FlowDirection. |
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore) |
Initialiseert een nieuw exemplaar van de AnnotationDocumentPaginator klasse op basis van een opgegeven DocumentPaginator en AnnotationStore. |
| AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection) |
Initialiseert een nieuw exemplaar van de AnnotationDocumentPaginator klasse op basis van een opgegeven DocumentPaginator, aantekeningsopslag Streamen tekst FlowDirection. |
| AnnotationDocumentPaginator(DocumentPaginator, Stream) |
Initialiseert een nieuw exemplaar van de AnnotationDocumentPaginator klasse op basis van een opgegeven DocumentPaginator en aantekeningenopslag Stream. |
Eigenschappen
| Name | Description |
|---|---|
| IsPageCountValid |
Hiermee wordt een waarde opgehaald die aangeeft of PageCount het totale aantal pagina's is. |
| PageCount |
Hiermee wordt een waarde opgehaald die het aantal pagina's aangeeft dat momenteel is opgemaakt. |
| PageSize |
Hiermee haalt u de voorgestelde breedte en hoogte van elke pagina op of stelt u deze in. |
| Source |
Hiermee haalt u het brondocument op dat wordt gepagineerd. |
Methoden
| Name | Description |
|---|---|
| CancelAsync(Object) |
Annuleert alle asynchrone bewerkingen die zijn gestart met een bepaald |
| ComputePageCount() |
Hiermee wordt een paginering van de inhoud, updates PageCount met het nieuwe totaal en ingesteld IsPageCountValid op |
| ComputePageCountAsync() |
Asynchroon, dwingt een paginering van de inhoud af, wordt PageCount bijgewerkt met het nieuwe totaal en wordt ingesteld IsPageCountValid op |
| ComputePageCountAsync(Object) |
Hiermee start u een asynchrone paginering van de inhoud, wordt bijgewerkt PageCount met het nieuwe totaal en wordt ingesteld IsPageCountValid |
| Equals(Object) |
Bepaalt of het opgegeven object gelijk is aan het huidige object. (Overgenomen van Object) |
| GetHashCode() |
Fungeert als de standaardhashfunctie. (Overgenomen van Object) |
| GetPage(Int32) |
Retourneert een DocumentPage samen met gekoppelde gebruikersaantekeningen voor een opgegeven paginanummer. |
| GetPageAsync(Int32, Object) |
Asynchroon retourneert een DocumentPage samen met gekoppelde gebruikersaantekeningen voor een opgegeven paginanummer. |
| GetPageAsync(Int32) |
Asynchroon retourneert (via de GetPageCompleted gebeurtenis) het DocumentPage opgegeven paginanummer. (Overgenomen van DocumentPaginator) |
| GetType() |
Hiermee haalt u de Type huidige instantie op. (Overgenomen van Object) |
| MemberwiseClone() |
Hiermee maakt u een ondiepe kopie van de huidige Object. (Overgenomen van Object) |
| OnComputePageCountCompleted(AsyncCompletedEventArgs) |
Hiermee wordt de ComputePageCountCompleted gebeurtenis gegenereerd. (Overgenomen van DocumentPaginator) |
| OnGetPageCompleted(GetPageCompletedEventArgs) |
Hiermee wordt de GetPageCompleted gebeurtenis gegenereerd. (Overgenomen van DocumentPaginator) |
| OnPagesChanged(PagesChangedEventArgs) |
Hiermee wordt de PagesChanged gebeurtenis gegenereerd. (Overgenomen van DocumentPaginator) |
| ToString() |
Retourneert een tekenreeks die het huidige object vertegenwoordigt. (Overgenomen van Object) |
gebeurtenis
| Name | Description |
|---|---|
| ComputePageCountCompleted |
Treedt op wanneer een ComputePageCountAsync bewerking is voltooid. (Overgenomen van DocumentPaginator) |
| GetPageCompleted |
Vindt plaats wanneer GetPageAsync dit is voltooid. (Overgenomen van DocumentPaginator) |
| PagesChanged |
Treedt op wanneer de documentinhoud wordt gewijzigd. (Overgenomen van DocumentPaginator) |