GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / SetJBIG2PMSThreshold Method
Specifies new threshold value between 0 and 1.
Example





In This Topic
SetJBIG2PMSThreshold Method (GdPicturePDF)
In This Topic
Changes the threshold of JBIG2 encoder pattern matching and substitution (PMS). The value can be set in range form 0 to 1. Any number lower than 1 may lead to lossy compression. Default value is 0.75.
Syntax
'Declaration
 
Public Sub SetJBIG2PMSThreshold( _
   ByVal Threshold As Single _
) 
public void SetJBIG2PMSThreshold( 
   float Threshold
)
public procedure SetJBIG2PMSThreshold( 
    Threshold: Single
); 
public function SetJBIG2PMSThreshold( 
   Threshold : float
);
public: void SetJBIG2PMSThreshold( 
   float Threshold
) 
public:
void SetJBIG2PMSThreshold( 
   float Threshold
) 

Parameters

Threshold
Specifies new threshold value between 0 and 1.
Remarks
It is recommend to use the GdPicturePDF.GetStat method to identify the specific reason for the method's failure, if any. Please ensure that you have successfully created or loaded a PDF document, otherwise the method does nothing.

Please use the GdPicturePDF.SetCompressionForBitonalImage method to specify the compression scheme for bitonal images.

Example
How to set the JBIG2 PMS threshold correctly.
Dim gdpicturePDF As New GdPicturePDF()
'Firstly, create or load the PDF document.
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
    'Set the required parameter.
    gdpicturePDF.SetJBIG2PMSThreshold(1)
    'Process your document here, for example, add a bitonal image.
Else
    MessageBox.Show("The file can't be loaded.", "Example: SetJBIG2PMSThreshold")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
//Firstly, create or load the PDF document.
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
    //Set the required parameter.
    gdpicturePDF.SetJBIG2PMSThreshold(1);
    //Process your document here, for example, add a bitonal image.
}
else
    MessageBox.Show("The file can't be loaded.", "Example: SetJBIG2PMSThreshold");
gdpicturePDF.Dispose();
See Also