PdfContent Class
Represents a PDF content.
public sealed class PdfContent : PdfContentGroup
Public NotInheritable Class PdfContent
Inherits PdfContentGroup
- Inheritance:
- PdfContent
Methods
BeginEdit()
Begins editing of the PdfContent.
Calling BeginEdit() is optional for Content and is mandatory for any other PdfContent that is going to be edited.
Call EndEdit(Boolean) to commit the edited content and all resources (fonts, images, etc.) used by the edited content to the underlying content stream and the associated resource dictionary or CancelEdit() to discard the changes and roll back to content specified in the underlying content stream.
This method will be ignored if called on a PdfContent that is already being edited or is PdfFormContent's Content.
Remarks
Calling BeginEdit() is optional for Content because GemBox.Pdf detects the first change to Content and implicitly calls BeginEdit() which sets the PdfPage as the current editing page of the PdfDocument.
The PdfPage remains the current editing page of the PdfDocument until:
- The EndEdit(Boolean) or CancelEdit() method is called on Content of the current editing page of the PdfDocument.
- The Content of another PdfPage is edited, thus implicitly calling EndEdit(Boolean) on Content of the current editing page and BeginEdit() on Content of the newly edited page which sets it as the current editing page of the PdfDocument.
- The GemBox.Pdf determines that content of the current editing page should be committed to the underlying content stream such as when saving a PdfDocument to a file or cloning a PdfDocument or a PdfPage.
To override this behavior, call BeginEdit() method before and EndEdit(Boolean) method after editing the Content to take control of when the edited content is committed to the underlying content stream.
Exceptions
CancelEdit()
Cancels editing of the PdfContent by discarding changes since the last BeginEdit() call and rolling back to content specified in the underlying content stream.
This method will be ignored if called on a PdfContent that is not being edited or is PdfFormContent's Content.
EndEdit(Boolean)
Ends editing of the PdfContent by committing the edited content and all resources (fonts, images, etc.) used by the edited content to the underlying content stream and the associated resource dictionary.
Calling EndEdit(Boolean) is optional for Content and is mandatory for any other PdfContent that is being edited.
This method will be ignored if called on a PdfContent that is not being edited or is PdfFormContent's Content.
Parameters
force
- Boolean
If set to true, forces the committing of the, potentially unchanged, content and all resources (fonts, images, etc.) used by the content to the underlying content stream and the associated resource dictionary.
ToString()
Returns a Unicode text contained in this PdfContent.
Returns
A Unicode text contained in this PdfContent.
Overrides
Inherited Properties
Bounds | Gets the upright bounds of the PdfContentGroup. (Inherited from PdfContentGroup) |
Collection | Gets the PdfContentElementCollection that the PdfContentElement belongs to. (Inherited from PdfContentElement) |
ElementType | Gets the Group value. (Inherited from PdfContentGroup) |
Elements | Gets the content elements such as text, paths and external objects (images and forms) contained directly in this group. (Inherited from PdfContentGroup) |
Format | Gets or sets the formatting properties applied to the PdfVisualContentElement. (Inherited from PdfVisualContentElement) |
Next | Gets the next PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Previous | Gets the previous PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Text | Gets the snapshot of text contained in this PdfContentGroup using the Default text options. (Inherited from PdfContentGroup) |
Transform | Gets or sets the transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system. All coordinates used after the transformation are expressed in the transformed coordinate system. tipBefore setting the Transform, move PdfVisualContentElement into its own PdfContentGroup so that the transformation is confined to that PdfContentGroup and doesn't have any effect on PdfContentElements outside that PdfContentGroup. (Inherited from PdfVisualContentElement) |
Inherited Methods
DrawAnnotation(PdfAnnotation) | Draws the annotation. (Inherited from PdfContentGroup) |
DrawAnnotation(PdfAnnotation, PdfMatrix) | Draws the annotation with the specified transformation. (Inherited from PdfContentGroup) |
DrawImage(PdfImage, PdfMatrix) | Draws image with the specified transformation. (Inherited from PdfContentGroup) |
DrawImage(PdfImage, PdfPoint) | Draws image at the specified location. (Inherited from PdfContentGroup) |
DrawImage(PdfImage, PdfPoint, PdfSize) | Draws image at the specified location and of the specified size. (Inherited from PdfContentGroup) |
DrawText(PdfFormattedText, PdfMatrix) | Draws formatted text with the specified transformation. (Inherited from PdfContentGroup) |
DrawText(PdfFormattedText, PdfPoint) | Draws formatted text at the specified location. (Inherited from PdfContentGroup) |
DrawText(PdfFormattedTextLine, PdfPoint) | Draws formatted text line at the specified location. (Inherited from PdfContentGroup) |
GetText(PdfTextOptions) | Gets the snapshot of text contained in this PdfContentGroup using the specified text options. (Inherited from PdfContentGroup) |