GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / AutoCropPage Method / AutoCropPage(Single,Single,Single,Single) Method
Specifies the width of the left margin for the cropped content.
Sets the height of the top margin for the cropped content.
Sets the width of the right margin for the cropped content.
Sets the height of the bottom margin for the cropped content.
Example





In This Topic
AutoCropPage(Single,Single,Single,Single) Method
In This Topic
Automaticaly crops currently selected page of loaded PDF document based on page content.
Syntax
'Declaration
 
Public Overloads Function AutoCropPage( _
   ByVal MarginLeft As Single, _
   ByVal MarginTop As Single, _
   ByVal MarginRight As Single, _
   ByVal MarginBottom As Single _
) As GdPictureStatus
public GdPictureStatus AutoCropPage( 
   float MarginLeft,
   float MarginTop,
   float MarginRight,
   float MarginBottom
)
public function AutoCropPage( 
    MarginLeft: Single;
    MarginTop: Single;
    MarginRight: Single;
    MarginBottom: Single
): GdPictureStatus; 
public function AutoCropPage( 
   MarginLeft : float,
   MarginTop : float,
   MarginRight : float,
   MarginBottom : float
) : GdPictureStatus;
public: GdPictureStatus AutoCropPage( 
   float MarginLeft,
   float MarginTop,
   float MarginRight,
   float MarginBottom
) 
public:
GdPictureStatus AutoCropPage( 
   float MarginLeft,
   float MarginTop,
   float MarginRight,
   float MarginBottom
) 

Parameters

MarginLeft
Specifies the width of the left margin for the cropped content.
MarginTop
Sets the height of the top margin for the cropped content.
MarginRight
Sets the width of the right margin for the cropped content.
MarginBottom
Sets the height of the bottom margin for the cropped content.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

Be aware that the values of coordinates and dimensions are expressed in the current units defined by the GdPicturePDF.SetMeasurementUnit method.

Example
How to AutoCrop specified page of loaded PDF document. using(GdPicturePDF gdpicturePDF = New GdPicturePDF()) { gdpicturePDF.LoadFromFile("sample.pdf"); gdpicturePDF.AutoCropPage(0, 0, 0, 0); gdpicturePDF.SaveToFile("sample_cropped.pdf"); }
Using gdpicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("sample.pdf")
    gdpicturePDF.AutoCropPage(0, 0, 0, 0)
    gdpicturePDF.SaveToFile("sample_cropped.pdf")
End Using

	
See Also