JBIG2SaveFlags Example for Delphi

procedure TForm1.Button1Click(Sender: TObject);
var
   nRet: Integer; 
begin
   LEADImage1.JBIG2SaveFlags:= FLAG_JBIG2_TPON; 
   LEADImage1.JBIG2TemplateType:= 2; 
   LEADImage1.JBIG2GBATX1:= 3; 
   LEADImage1.JBIG2GBATY1:= -1; 
   LEADImage1.JBIG2GBATX2:= -3; 
   LEADImage1.JBIG2GBATY2:= -1; 
   LEADImage1.JBIG2GBATX3:= 2; 
   LEADImage1.JBIG2GBATY3:= -2; 
   LEADImage1.JBIG2GBATX4:= -2; 
   LEADImage1.JBIG2GBATY4:= -2; 

   nRet:= LEADImage1.Save('c:\Output.jb2', FILE_JBIG2, 24, 2, SAVE_OVERWRITE); 
   if(nRet = SUCCESS)then
      ShowMessage('Saved Successfully') 
   else
      ShowMessage('Error Saving: ' + IntToStr(nRet)); 
end;