'Declaration
Public Function CreateFromText( _ ByVal Conformance As PdfConformance, _ ByVal PageWidth As Single, _ ByVal PageHeight As Single, _ ByVal MarginLeft As Single, _ ByVal MarginTop As Single, _ ByVal MarginRight As Single, _ ByVal MarginBottom As Single, _ ByVal TextAlignment As TextAlignment, _ ByVal Text As String, _ ByVal TextSize As Single, _ ByVal FontName As String, _ ByVal FontBold As Boolean, _ ByVal FontItalic As Boolean, _ ByVal Embedded As Boolean, _ ByVal UseFontBBox As Boolean _ ) As GdPictureStatus
public GdPictureStatus CreateFromText( PdfConformance Conformance, float PageWidth, float PageHeight, float MarginLeft, float MarginTop, float MarginRight, float MarginBottom, TextAlignment TextAlignment, string Text, float TextSize, string FontName, bool FontBold, bool FontItalic, bool Embedded, bool UseFontBBox )
public function CreateFromText( Conformance: PdfConformance; PageWidth: Single; PageHeight: Single; MarginLeft: Single; MarginTop: Single; MarginRight: Single; MarginBottom: Single; TextAlignment: TextAlignment; Text: String; TextSize: Single; FontName: String; FontBold: Boolean; FontItalic: Boolean; Embedded: Boolean; UseFontBBox: Boolean ): GdPictureStatus;
public function CreateFromText( Conformance : PdfConformance, PageWidth : float, PageHeight : float, MarginLeft : float, MarginTop : float, MarginRight : float, MarginBottom : float, TextAlignment : TextAlignment, Text : String, TextSize : float, FontName : String, FontBold : boolean, FontItalic : boolean, Embedded : boolean, UseFontBBox : boolean ) : GdPictureStatus;
public: GdPictureStatus CreateFromText( PdfConformance Conformance, float PageWidth, float PageHeight, float MarginLeft, float MarginTop, float MarginRight, float MarginBottom, TextAlignment TextAlignment, string* Text, float TextSize, string* FontName, bool FontBold, bool FontItalic, bool Embedded, bool UseFontBBox )
public: GdPictureStatus CreateFromText( PdfConformance Conformance, float PageWidth, float PageHeight, float MarginLeft, float MarginTop, float MarginRight, float MarginBottom, TextAlignment TextAlignment, String^ Text, float TextSize, String^ FontName, bool FontBold, bool FontItalic, bool Embedded, bool UseFontBBox )
Parameters
- Conformance
- A member of the PdfConformance enumeration. Specifies the required conformance to the PDF or PDF/A standard of a newly created PDF document.
If you use the value of the PdfConformance.PDF, the toolkit will create the PDF document conformed to the lowest PDF version (version 1.3 is the minimum) based on what the output PDF document will contain.
Please note that the fonts are always embedded in a PDF/A compliant file regardless of what you specify in the Embedded parameter.
- PageWidth
- Sets the page width of a new PDF document in points.
- PageHeight
- Sets the page height of a new PDF document in points.
- MarginLeft
- Sets the width of the left margin on pages in points.
- MarginTop
- Sets the height of the top margin on pages in points.
- MarginRight
- Sets the width of the right margin on pages in points.
- MarginBottom
- Sets the height of the bottom margin on pages in points.
- TextAlignment
- A member of the TextAlignment enumeration. Specifies the horizontal alignment of the text within the bounding box.
- Text
- Contains the input text as a string. This text will be set as a content of a new PDF document.
- TextSize
- Sets the text size in points.
- FontName
- Specifies the name of the font to write the input text in.
- FontBold
- Sets the font weight. Set this parameter to true if you want to use bold font, otherwise set it to false.
- FontItalic
- Sets the font style. Set this parameter to true if you want to use italic font, otherwise set it to false.
- Embedded
- Specifies the font embedding. Set this parameter to true if you want to embed the font into a newly created PDF document, otherwise set it to false.
Please note that embedding the font inside the PDF document always increases the document's size. But for a better portability of PDF documents it is recommended to embed the fonts into the files. The fonts are always embedded in a PDF/A compliant file regardless of the Embedded parameter.
Also the font you specify needs to allow copying to be embedded into a PDF file. The fonts under copyright cannot be copied.
- UseFontBBox
- Specifies if the font's bounding box should be used to determine the height of the font. It is set to false by default. You can set it to true for better calculation of the line spacing.
Return Value
We strongly recommend always checking this status first.