Class PdfAppearance
Represents the appearance of an annotation.
Inheritance
System.Object
PdfAppearance
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfAppearance : Object, IPdfWrapper
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Create a brush
PdfBrush brush = PdfBrushes.Blue;
//Create a new pdf3d annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new pdf appearance
annotation.Appearance = new PdfAppearance(annotation);
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, new PointF(40, 40));
//Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, new PointF(annotation.Location.X, annotation.Location.Y));
//Adds annotation to page
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 10)
'Create a brush
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a new pdf3d annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new pdf appearance
annotation.Appearance = New PdfAppearance(annotation)
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, New PointF(40, 40))
'Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, New PointF(annotation.Location.X, annotation.Location.Y))
'Add annotation to page
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfAppearance(PdfAnnotation)
Initializes a new instance of the PdfAppearance class.
Declaration
public PdfAppearance(PdfAnnotation annotation)
Parameters
Type | Name | Description |
---|---|---|
PdfAnnotation | annotation | The PdfAnnotation object specifies the annotation. |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Create a brush
PdfBrush brush = PdfBrushes.Blue;
//Create a new pdf3d annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new pdf appearance
annotation.Appearance = new PdfAppearance(annotation);
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, new PointF(40, 40));
//Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, new PointF(annotation.Location.X, annotation.Location.Y));
//Adds annotation to page
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 10)
'Create a brush
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a new pdf3d annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new pdf appearance
annotation.Appearance = New PdfAppearance(annotation)
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, New PointF(40, 40))
'Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, New PointF(annotation.Location.X, annotation.Location.Y))
'Add annotation to page
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
MouseHover
Gets or sets PdfTemplate object which applied to the annotation on hovering the mouse.
Declaration
public PdfTemplate MouseHover { get; set; }
Property Value
Type |
---|
PdfTemplate |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Create a brush
PdfBrush brush = PdfBrushes.Blue;
//Create a new pdf3d annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new pdf appearance
annotation.Appearance = new PdfAppearance(annotation);
annotation.Appearance.MouseHover.Graphics.DrawString("Click to activate", font, brush, new PointF(40, 40));
//Add this annotation to a new page
annotation.Appearance.MouseHover.Draw(page, new PointF(annotation.Location.X, annotation.Location.Y));
//Adds annotation to page
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 10)
'Create a brush
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a new pdf3d annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new pdf appearance
annot.Appearance = New PdfAppearance(annotation)
annot.Appearance.MouseHover.Graphics.DrawString("Click to activate", font, brush, New PointF(40, 40))
'Add this annotation to a new page
annot.Appearance.MouseHover.Draw(page, New PointF(annot.Location.X, annot.Location.Y))
'Add annotation to page
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Normal
Gets or sets PdfTmplate object which applied to annotation in normal state.
Declaration
public PdfTemplate Normal { get; set; }
Property Value
Type |
---|
PdfTemplate |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Create a brush
PdfBrush brush = PdfBrushes.Blue;
//Create a new pdf3d annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new pdf appearance
annotation.Appearance = new PdfAppearance(annotation);
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, new PointF(40, 40));
//Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, new PointF(annotation.Location.X, annotation.Location.Y));
//Adds annotation to page
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 10)
'Create a brush
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a new pdf3d annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new pdf appearance
annotation.Appearance = New PdfAppearance(annotation)
annotation.Appearance.Normal.Graphics.DrawString("Click to activate", font, brush, New PointF(40, 40))
'Add this annotation to a new page
annotation.Appearance.Normal.Draw(page, New PointF(annotation.Location.X, annotation.Location.Y))
'Add annotation to page
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Pressed
Gets or sets PdfTemplate object which applied to an annotation when mouse button is pressed.
Declaration
public PdfTemplate Pressed { get; set; }
Property Value
Type |
---|
PdfTemplate |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 10);
//Create a brush
PdfBrush brush = PdfBrushes.Blue;
//Create a new pdf3d annotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new pdf appearance
annotation.Appearance = new PdfAppearance(annotation);
annotation.Appearance.Pressed.Graphics.DrawString("Click to activate", font, brush, new PointF(40, 40));
//Add this annotation to a new page
annotation.Appearance.Pressed.Draw(page, new PointF(annotation.Location.X, annotation.Location.Y));
//Adds annotation to page
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 10)
'Create a brush
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a new pdf3d annotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new pdf appearance
annotation.Appearance = New PdfAppearance(annotation)
annotation.Appearance.Pressed.Graphics.DrawString("Click to activate", font, brush, New PointF(40, 40))
'Add this annotation to a new page
annotation.Appearance.Pressed.Draw(page, New PointF(annotation.Location.X, annotation.Location.Y))
'Add annotation to page
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)