Hi Team,
The attached 7zip file has an png file in it. When we ran it through below code. It generated the attached pdf file.
Issue : After conversion of png images to searchable pdf, I see some yellow patch region in rectangle shapes which is not in the orginal image.
I wanted to use DetectAreasMode as Combine since we are expecting png images with some text it. It works perfect with DetectAreasMode as NONE. But it fails with COMBINE or PHOTO. Can you please look into it.
Code:
List recognitionResult = new();
RecognitionSettings drsSinglePage = new()
{
AllowedCharacters = CharactersAllowedType.ALL,
Language = Language.Eng,
IgnoredCharacters = "",
LinesFiltration = false,
UpscaleSmallFont = true,
DetectAreasMode = DetectAreasMode.COMBINE,
AutoSkew = false,
ThreadsCount = 0,
};
try
{
using (MemoryStream filestream = new(objectValetServices.GetBytes(oCRReceptorOutput)))
{
OcrInput GeneralImages = new(InputType.SingleImage)
{
filestream
};
recognitionResult.Add(asposeBaseOcrApi.Recognize(GeneralImages, drsSinglePage).FirstOrDefault());
filestream.Close();
}
}
FileSave
AsposeOcr.SaveMultipageDocument(PdfToSearchablePdfStream, SaveFormat.Pdf, recognitionResult);
2MB.7z (2.6 MB)
2mb_rendered1.pdf (3.5 MB)