Enum PdfImageType
- Namespace
- Syncfusion.Pdf.Graphics
- Assembly
- Syncfusion.Pdf.Portable.dll
Specifies the type of the PdfImage.
public enum PdfImageType
Fields
Bitmap = 0
Specifies the image is bitmap.
Metafile = 1
Specifies the image is metafile.
Examples
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a page to the document.
PdfPage page = doc.Pages.Add();
//Create PDF graphics for the page
PdfGraphics graphics = page.Graphics;
string rtfData = @"{\rtf1\ansi\deff0 {\colortbl;\red0\green0\blue0;\red255\green0\blue0; }Default Color\line\cf2Red Color\line\cf1Default Color}";
//Load image from rtf data.
PdfImage image = PdfImage.FromRtf(rtfData, 200, PdfImageType.Bitmap)
//Draw the image
graphics.DrawImage(image, 0, 0);
//Save the document.
doc.Save("Output.pdf");
//Close the document.
doc.Close(true);
'Create a new PDF document.
Dim doc As New PdfDocument()
'Add a page to the document.
Dim page As PdfPage = doc.Pages.Add()
'Create PDF graphics for the page
Dim graphics As PdfGraphics = page.Graphics
Dim rtfData As String = "{\rtf1\ansi\deff0 {\colortbl;\red0\green0\blue0;\red255\green0\blue0; }Default Color\line\cf2Red Color\line\cf1Default Color}"
'Load image from rtf data.
Dim Image As PdfImage = PdfImage.FromRtf(rtfData, 200, PdfImageType.Bitmap)
'Draw the image
graphics.DrawImage(image, 0, 0)
'Save the document.
doc.Save("Output.pdf")
'Close the document.
doc.Close(True)