WatermarkArtifact
Panoramica
WatermarkArtifact è una classe in Aspose.PDF FOSS per .NET. Eredita da: Artifact.
Rappresenta un artefatto watermark che può essere aggiunto a una pagina PDF.
Questa classe fornisce 19 metodi per lavorare con oggetti WatermarkArtifact nei programmi .NET. I metodi disponibili includono: AddToPage, Artifact, BeginUpdates, Dispose, GetValue, RemoveValue, SaveUpdates, SetImage, SetLinesAndState, SetPageNumberReplacementString, SetPdfPage, SetText e 3 metodi aggiuntivi. Tutti i membri pubblici sono accessibili a qualsiasi applicazione .NET dopo aver installato il pacchetto Aspose.PDF FOSS per .NET. Proprietà: ArtifactHorizontalAlignment, ArtifactVerticalAlignment, BackgroundColor, BottomMargin, Contents, CustomSubtype e altre 18.
Proprietà
| Nome | Tipo | Accesso | Descrizione |
|---|---|---|---|
Type | ArtifactType | Lettura/Scrittura | La classificazione del tipo dell’artefatto. |
Subtype | ArtifactSubtype | Lettura/Scrittura | Il sottotipo dell’artefatto. |
CustomType | string? | Lettura/Scrittura | Nome del tipo di artefatto non standard. |
CustomSubtype | string? | Lettura/Scrittura | Nome del sottotipo di artefatto non standard. |
Text | string? | Lettura/Scrittura | Contenuto testuale estratto dagli operatori del flusso di contenuto dell’artefatto. |
Rectangle | Rectangle? | Lettura | Bounding box dalla voce /BBox nel dizionario delle proprietà. |
Opacity | double | Lettura/Scrittura | Opacità dell’artefatto (da ExtGState /ca). |
Page | Page? | Lettura | La pagina a cui appartiene questo artefatto. |
ArtifactHorizontalAlignment | HorizontalAlignment | Lettura/Scrittura | Allineamento orizzontale (da /Attached entry). |
ArtifactVerticalAlignment | VerticalAlignment | Lettura/Scrittura | Allineamento verticale (da /Attached entry). |
IsBackground | bool | Lettura/Scrittura | Se questo è un artefatto di sfondo. |
Rotation | double | Lettura/Scrittura | Angolo di rotazione in gradi. |
BackgroundColor | Color? | Lettura/Scrittura | Colore di sfondo. |
RightMargin | double | Lettura/Scrittura | Margine destro. |
LeftMargin | double | Lettura/Scrittura | Margine sinistro. |
TopMargin | double | Lettura/Scrittura | Margine superiore. |
BottomMargin | double | Lettura/Scrittura | Margine inferiore. |
Position | Point? | Lettura/Scrittura | Coordinate di posizionamento esplicite. |
FormattedText | FormattedText? | Lettura/Scrittura | Testo formattato per l’artefatto. |
TextState | TextState? | Lettura/Scrittura | Stato del testo per il testo dell’artefatto. |
Lines | List<string> | Lettura | Contenuto di testo multilinea. |
Contents | List<Operator> | Lettura | Operatori interni del flusso di contenuto che disegnano l’artefatto. |
Form | XForm? | Lettura | L’XObject Form che supporta questo artefatto quando viene renderizzato come modulo riutilizzabile (ad es. |
Image | XImage? | Lettura | L’XObject Image che supporta questo artefatto quando il suo contenuto è un’immagine raster. |
Metodi
| Firma | Descrizione |
|---|---|
WatermarkArtifact() | Crea un’istanza di un artefatto Watermark. |
SetTextAndState(text: string, state: TextState) | Imposta il testo e lo stato del testo per il watermark. |
SetText(formattedText: Aspose.Pdf.Facades.FormattedText) | Imposta il testo del watermark da un oggetto FormattedText (helper in stile API di Facades). |
AddToPage(page: Page) | Aggiungi questo artefatto a una pagina. |
Artifact() | Costruttore predefinito — crea un artefatto con tipo e sottotipo Undefined. |
Artifact(type: ArtifactType, subType: ArtifactSubtype) | Crea un artefatto con il tipo e il sottotipo forniti. |
Artifact(type: string, subType: string) | Crea un artefatto con tipo e sottotipo personalizzati basati su stringa. |
SetPageNumberReplacementString(value: string) | Imposta il token di sostituzione del numero di pagina usato in Text. |
SetLinesAndState(text: string[], textState: TextState) | Imposta il contenuto di testo multilinea con lo stato di testo fornito. |
BeginUpdates() | Inizia un aggiornamento batch delle proprietà. |
SaveUpdates() | Esegui il flush di un aggiornamento batch avviato da BeginUpdates. |
Dispose() | Rilascia le risorse detenute dall’artefatto. |
GetValue(name: string) | Leggi una coppia nome/valore personalizzata impostata tramite SetValue(string, string). |
SetValue(name: string, value: string) | Memorizza una coppia nome/valore personalizzata sull’artefatto (per l’accesso ai metadati a valle; non emessa nel PDF in questa build). |
RemoveValue(name: string) | Rimuovi una coppia nome/valore personalizzata impostata in precedenza tramite SetValue. |
SetImage(imageStream: Stream) | Allega un’immagine raster all’artefatto. |
SetImage(imageName: string) | Allega un’immagine raster tramite percorso. |
SetText(formattedText: FormattedText) | Imposta il testo dell’artifact da un’istanza FormattedText. |
SetPdfPage(page: Page) | Associa questo artefatto a una pagina specifica. |