Class PdfLoadedPage
Represents a page loaded from a PDF document.
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLoadedPage : PdfPageBase, IPdfWrapper
Examples
//Load the document
PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
//get the first page from the document
PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
//Get the annotation collection
PdfLoadedAnnotationCollection annotations = page.Annotations;
//Save the document
lDoc.Save("output.pdf");
lDoc.Close(true);
'Load the document
Dim lDoc As New PdfLoadedDocument("input.pdf")
'get the first page from the document
Dim page As PdfLoadedPage = TryCast(lDoc.Pages(0), PdfLoadedPage)
'Get the annotation collection
Dim annotations As PdfLoadedAnnotationCollection = page.Annotations
'Save the document
lDoc.Save("output.pdf")
lDoc.Close(True)
Properties
Annotations
Gets or Sets the collection of the page's annotations.
Declaration
public PdfLoadedAnnotationCollection Annotations { get; set; }
Property Value
Type | Description |
---|---|
PdfLoadedAnnotationCollection | The PdfLoadedAnnotationCollection that represents the page's annotations |
Examples
//Load the document.
PdfLoadedDocument lDoc = new PdfLoadedDocument("inputAnnotation.pdf");
//get the first page from the document.
PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
//Get the annotation collection.
PdfLoadedAnnotationCollection annotations = page.Annotations;
//Save the document.
lDoc.Save("sample.pdf");
lDoc.Close(true);
'Load the document.
Dim lDoc As New PdfLoadedDocument("inputAnnotation.pdf")
'Get the first page from the document.
Dim page As PdfLoadedPage = TryCast(lDoc.Pages(0), PdfLoadedPage)
'Get the annotation collections.
Dim annotations As PdfLoadedAnnotationCollection = page.Annotations
'Save the document.
lDoc.Save("sample.pdf")
lDoc.Close(True)
See Also
ArtBox
Gets page region containing meaningful content (Read only).
Declaration
public RectangleF ArtBox { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF | The RectangleF that represents the art box of the page |
Remarks
Art box is only read only, we cann't set value for loaded page art box.
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page art box value.
RectangleF rect = lpage.ArtBox;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page art box value.
Dim rect As RectangleF = lpage.ArtBox
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
BleedBox
Gets page region after clipping (Read only).
Declaration
public RectangleF BleedBox { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF | The RectangleF that represents the bleed box of a page |
Remarks
Bleed box is only read only, we cann't set value for loaded page bleed box.
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page bleed box value.
RectangleF rect = lpage.BleedBox;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page bleed box value.
Dim rect As RectangleF = lpage.BleedBox
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
ColorSpace
Gets the ColorSpace details(Read only).
Declaration
public string[] ColorSpace { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page base document.
string colorSpace = page.ColorSpace;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
See Also
CropBox
Gets the visible region of the page (Read only).
Declaration
public RectangleF CropBox { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF | The RectangleF that represents the crop box of the page |
Remarks
Crop box is only read only, we cann't set value for loaded page crop box value.
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page crop box value.
RectangleF rect = lpage.CropBox;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page crop box value.
Dim rect As RectangleF = lpage.CropBox
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
Document
Gets the base document (Read only).
Declaration
public PdfDocumentBase Document { get; }
Property Value
Type | Description |
---|---|
PdfDocumentBase | The PdfDocumentBase, which is base class of PdfLoadedDocument |
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page base document.
PdfLoadedDocument basedoc = lpage.Document as PdfLoadedDocument;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page base document.
Dim basedoc As PdfLoadedDocument = TryCast(lpage.Document, PdfLoadedDocument)
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
MediaBox
Gets the media box of the PDF page (Read only).
Declaration
public RectangleF MediaBox { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF | The RectangleF that represents the media box of the page, which is intended to be displayed or printed. |
Remarks
Media box is only read only, we cann't set value for loaded page Media box value.
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page Media box value.
RectangleF rect = lpage.MediaBox;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page Media box value.
Dim rect As RectangleF = lpage.MediaBox
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
Redactions
Gets collection of the page's redactions.
Declaration
public List<PdfRedaction> Redactions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<PdfRedaction> | list of redaction objects |
Examples
//Load the document.
PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
//Get the first page from the document.
PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
//Create a redaction object
PdfRedaction redaction = new PdfRedaction(new RectangleF(40, 40, 50, 20));
//Set fill color for the redaction bounds
redaction.FillColor = System.Drawing.Color.Green;
//Add redaction object into redaction collection of loaded page
page.Redactions.Add(redaction);
//Save and Close the document.
lDoc.Save("sample.pdf");
lDoc.Close(true);
'Load the document.
Dim lDoc As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
//Create a redaction object
Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(40, 40, 50, 20))
//Set fill color for the redaction bounds
redaction.FillColor = Color.Green
//Add redaction object into collection
page.Redactions.Add(redaction)
'Save the document.
lDoc.Save("sample.pdf")
lDoc.Close(True)
Size
Gets the size of the page (Read only).
Declaration
public override SizeF Size { get; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF | The SizeF that represents the size of the page |
Overrides
TrimBox
Returns page region after trimming (Read only).
Declaration
public RectangleF TrimBox { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF | The RectangleF that represents the trim box of a page |
Remarks
Trim box is only read only, we cann't set value for loaded page trim box.
Examples
//Load an existing document.
PdfLoadedDocument document = new PdfLoadedDocument("input.pdf");
//Get first page of loaded document.
PdfLoadedPage lpage = document.Pages[0] as PdfLoadedPage;
//Get loaded page trim box value.
RectangleF rect = lpage.TrimBox;
//Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Load an existing document.
Dim document As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
'Get first page of loaded document.
Dim lpage As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)
'Get loaded page trim box value.
Dim rect As RectangleF = lpage.TrimBox
'Save and Close the document.
document.Save("Output.pdf")
document.Close(True)
See Also
Methods
AddRedaction(PdfRedaction)
Add redaction to the PDF page.
Declaration
public void AddRedaction(PdfRedaction redaction)
Parameters
Type | Name | Description |
---|---|---|
PdfRedaction | redaction |
Examples
//Load the existing PDF document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
//Create a redaction object
PdfRedaction redaction = new PdfRedaction(new RectangleF(343, 167, 100, 25), Color.Black);
//Add redaction object into redaction collection of loaded page
page.AddRedaction(redaction);
//Redact the contents from PDF document.
loadedDocument.Redact();
//Creating the stream object
MemoryStream stream = new MemoryStream();
//Save the document into stream.
loadedDocument.Save(stream);
//Close the documents.
loadedDocument.Close(true);
'Load the existing PDF document
Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(docStream)
'Create a redaction object
Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(343, 167, 100, 25), Color.Black)
'Add redaction object into redaction collection of loaded page
page.AddRedaction(redaction)
'Redact the contents from PDF document.
loadedDocument.Redact()
'Creating the stream object
Dim stream As MemoryStream = New MemoryStream()
'Save the document into stream.
loadedDocument.Save(stream)
'Close the document.
loadedDocument.Close(True)
OnBeginSave(EventArgs)
Raises BeginSave event.
Declaration
protected virtual void OnBeginSave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event arguments. |
Events
BeginSave
Raises before the page saves.
Declaration
public event EventHandler BeginSave
Event Type
Type | Description |
---|---|
System.EventHandler |