Class PdfXfaImage
Represents image field in the XFA form.
Inherited Members
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfXfaImage : PdfXfaField
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg");
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg")
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Constructors
PdfXfaImage(String, PdfBitmap)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, PdfBitmap image)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
PdfBitmap | image | PDF bitmap |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", new PdfBitmap("image.jpg"));
//Set image size.
image.Size = new SizeF(100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", New PdfBitmap("image.jpg"))
'Set image size.
image.Size = New SizeF(100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Image)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Image image)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.Drawing.Image | image | Image |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", Image.FromFile("image.jpg"));
//Set image size.
image.Size = new SizeF(100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", Image.FromFile("image.jpg"))
'Set image size.
image.Size = New SizeF(100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Image, SizeF)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Image image, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.Drawing.Image | image | |
System.Drawing.SizeF | size | Image size. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", Image.FromFile("image.jpg"), new SizeF(100,100));
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", Image.FromFile("image.jpg"), New SizeF(100,100))
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Image, Single, Single)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Image image, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.Drawing.Image | image | |
System.Single | width | Width. |
System.Single | height | Height. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", Image.FromFile("image.jpg"), 100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", Image.FromFile("image.jpg"), 100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Stream)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.IO.Stream | stream | Image stream |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
Stream imageStream = new MemoryStream(File.ReadAllBytes("image.jpg"));
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", imageStream);
//Set image size.
image.Size = new SizeF(100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
Dim imageStream As Stream = New MemoryStream(File.ReadAllBytes("image.jpg"))
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", imageStream)
'Set image size.
image.Size = New SizeF(100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Stream, SizeF)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Stream stream, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.IO.Stream | stream | Image stream. |
System.Drawing.SizeF | size | Size of the image. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
Stream imageStream = new MemoryStream(File.ReadAllBytes("image.jpg"));
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", imageStream, new SizeF(100,100));
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
Dim imageStream As Stream = New MemoryStream(File.ReadAllBytes("image.jpg"))
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", imageStream, New SizeF(100,100))
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, Stream, Single, Single)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, Stream stream, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.IO.Stream | stream | |
System.Single | width | Image width |
System.Single | height | Image height |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
Stream imageStream = new MemoryStream(File.ReadAllBytes("image.jpg"));
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", imageStream, 100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
Dim imageStream As Stream = New MemoryStream(File.ReadAllBytes("image.jpg"))
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", imageStream, 100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, String)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.String | path | Image path. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg");
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg")
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, String, SizeF)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, string path, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Image name. |
System.String | path | Image path. |
System.Drawing.SizeF | size | Image size. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg", new SizeF(100,100));
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg", New SizeF(100,100))
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaImage(String, String, Single, Single)
Initializes a new instance of the PdfXfaImage class.
Declaration
public PdfXfaImage(string name, string path, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The image name. |
System.String | path | The image path. |
System.Single | width | The width of the image. |
System.Single | height | The height of the image. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg", 100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg", 100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Properties
Rotate
Gets or sets the rotation angle
Declaration
public PdfXfaRotateAngle Rotate { get; set; }
Property Value
Type |
---|
PdfXfaRotateAngle |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg");
//Set image size.
image.Size = new SizeF(100, 100);
//Set the rotation angle.
image.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg")
'Set image size.
image.Size = New SizeF(100, 100)
'Set the rotation angle.
image.Rotate = PdfXfaRotateAngle.RotateAngle90
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Size
Gets or sets the image size
Declaration
public SizeF Size { get; set; }
Property Value
Type |
---|
System.Drawing.SizeF |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a image and add the properties.
PdfXfaImage image = new PdfXfaImage("image1", "image.jpg");
//Set image size.
image.Size = new SizeF(100, 100);
//Add the image to the XFA form.
mainForm.Fields.Add(image);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a image and add the properties.
Dim image As New PdfXfaImage("image1", "image.jpg")
'Set image size.
image.Size = New SizeF(100, 100)
'Add the image to the XFA form.
mainForm.Fields.Add(image)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()