Process gets stuck while Converting JPG to PDF using C#

I am using Aspose.pdf version(20.12.0.0) to convert JPG to pdf format. But somehow one JPG file is not working.
It is stuck at pdf.Save(PDFTargetFilePath,SaveFormat.Pdf); line and creating a PDF file in the TargetFilepath with 0KB .Its not moving forward from here.
annulation.jpg (7.5 KB)

But when I use the latest version of Aspose.pdf (24.2.0) it throws an error at pdf.Save(PDFTargetFilePath,SaveFormat.Pdf); line

Error Message: Page have not room to place a paragraphs

Can you please tell me what’s the reason behind the error and also what will be the best approach to handle these kind of scenarios for avoiding these error.

Also i am attaching source code here.
public static class PDFConverterTest
{
public static void ConvertPNGTOPDF(string PNGImageFilePath,string PDFTargetFilePath)
{
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document();
Bitmap bitmap = new Bitmap(PNGImageFilePath);
int width = bitmap.Width;
int height = bitmap.Height;
string tmpJpg = GetTempFileName();
bitmap.Save(tmpJpg, ImageFormat.Png);
bitmap.Dispose();
//Create a section in the Pdf object
Page sec2 = pdf.Pages.Add();
//Create an image object in the section
Aspose.Pdf.Image image2 = new Aspose.Pdf.Image();
//Add image object into the Paragraphs collection of the section
sec2.Paragraphs.Add(image2);
//Set the path of image file
image2.File = tmpJpg;
sec2.PageInfo.Width = width + 2.04f;
sec2.PageInfo.Height = height + 2.04f;
pdf.Save(PDFTargetFilePath,SaveFormat.Pdf);
}
static string GetTempFileName()
{
string Temp = “”;
do
{
Temp = Path.GetTempPath() + Path.GetRandomFileName();
} while (File.Exists(Temp));
return Temp;
}
}

@sharook
I added lines assigning zero values to the margins (sec2.PageInfo.Margin.xxx) and the document began to be generated without errors.
(By default there are non-null values and when checking Height < Margin.Top + Margin.Bottom raises exception)

var pdf = new Aspose.Pdf.Document();

int width, height;

using (var bitmap = new Bitmap(dataDir + "annulation.jpg"))
{
    width = bitmap.Width;
    height = bitmap.Height;
}

//Create a section in the Pdf object
Page sec2 = pdf.Pages.Add();
//Create an image object in the section
var image2 = new Aspose.Pdf.Image();
image2.File = dataDir + "annulation.jpg";

// Set the path of image file
sec2.PageInfo.Margin.Top = 0;
sec2.PageInfo.Margin.Bottom = 0;
sec2.PageInfo.Margin.Left = 0;
sec2.PageInfo.Margin.Right = 0;

sec2.PageInfo.Width = width + 2.04f;
sec2.PageInfo.Height = height + 2.04f;

//Add image object into the Paragraphs collection of the section
sec2.Paragraphs.Add(image2);

pdf.Save(dataDir + "result.pdf", SaveFormat.Pdf);