How to get font details from the attached image

Hi Team,

My requirement is to get font details from the attached jpeg image and PDF using java.
please kindly help me to get those details.

Thanks & regards,
priyanga G

@priyanga,

Kindly forward us the JPEG image and PDF file. We will look into it and update you accordingly.

Hi @ikram.haq,

Thanks for your feedback .Here I have attached the samples.

sample1:sample1.zip (57.0 KB)

sample2: sample2.zip (549.9 KB)

Thanks & regards,
Priyanga G

@priyanga,

This is to update you that support to detect font is not present in Aspose.OCR. There is no plan for the support of this feature. We are sorry for the inconvenience caused.

Hi @ikram.haq,

I have tried get text option for text color,bold,italic. I am not able to get font size and font name.

Please kindly help me to get the the font size and name.

Thanks & regards,
Priyanga G.

@priyanga,

As updated in my last post that the feature you are looking for is not available. There is no plan for the support of this feature. We are sorry for the inconvenience caused. However, you can detect if the text is italic or not. Following is the sample code for your reference.

CODE:

OcrEngine ocrEngine = new OcrEngine();
ocrEngine.Image = ImageStream.FromFile("imageFile");

        if (ocrEngine.Process())
        {
            Console.WriteLine(ocrEngine.Text);

            IRecognizedPartInfo[] text = ocrEngine.Text.PartsInfo;

            foreach (IRecognizedTextPartInfo symbol in text)
            {
                Console.WriteLine("Text : " + symbol.Text);
                Console.WriteLine("isItalic : " + symbol.Italic);
                Console.WriteLine("Language : " + symbol.Language);
            }
        }

Hi @ikram.haq,

Thanks for your feedback.
From the aspose.ocr java documentation mentioned the getPartsInfo() method returns the following information.please ,kindly help me to get the font size,font name from the attached sample.

sample1: sample2.zip (549.9 KB)

getPartsInfo

Returns:
Each part has its own style, font, text size, color, language and more. If the text consists of several parts that are written by different font (or a different language, etc.), then according to each will have an element in this array. It is divided by the words into parts, if have large text that has the same style. Parts are consistently followed, that they found in the original text so they are following here.

@priyanga,

Yes, it is correct that each part has its own style, font, text size, color, language. But the feature of detecting font size,font name is not supported. In the code example of documentation you can see that we can only have information about is text italic or not. Furthermore, you can access the IRecognizedTextPartInfo interface details and explore.

Hi @ikram.haq,

please ,kindly help me to solve this issue.Once the detecting font size,font name feature has been included. please,kindly update the status.

We are awaiting for your quick solution.

Thanks & regards,
priyanga G

@priyanga,

We surly will update you once the feature will be available. Further to update you that we are currently working on Aspose.OCR for Cloud. Development on Aspose.OCR for .NET is temporarily suspended.

We are sorry for the inconvenience.

Hi @ikram.haq,

Is there any update on this to get the font size from image?

@eyenan4u

We regret to inform that such functionality is not present in the API at the moment. However, could you please share a sample image with us. We will log a feature request in our issue tracking system and share the ID with you.

Thanks Asad.

And one more clarification, If I convert EPS to PDF conversion using Aspose.pdf then I will get pdf with junks only,.
Please advice me to convert eps to pdf conversion.

@eyenan4u

Would you kindly share your sample EPS file and code snippet which you are using to convert. We will test the scenario in our environment and address it accordingly.

@asad.ali

Below is the code and you can take any eps file at your end.

System.IO.FileStream psStream = new FileStream(InputEpsFile, System.IO.FileMode.Open, System.IO.FileAccess.Read);
Aspose.Page.EPS.PsDocument eps = new Aspose.Page.EPS.PsDocument(psStream);

System.IO.Stream pdfStream = System.IO.File.Open(OutputPdfFile, System.IO.FileMode.Create, System.IO.FileAccess.Write);

Aspose.Page.EPS.Device.PdfDevice device = new Aspose.Page.EPS.Device.PdfDevice(pdfStream);

Aspose.Page.EPS.Device.PdfSaveOptions options = new Aspose.Page.EPS.Device.PdfSaveOptions(true);

eps.Save(device, options);
psStream.Close();
pdfStream.Close();

@asad.ali
EPS2PDF_Error.PNG (5.1 KB)

We get the output as attached here.

@asad.ali,

Any update please?

@eyenan4u

Sorry for the delayed response.

Would you please make sure that you are using a valid license while converting EPS to PDF as we tested with one of our sample files and were unable to notice the issue.

@asad.ali

Yes, using with a valid license only.

@eyenan4u

We would like to share with you that there are issues which were already logged regarding EPS to PDF conversion where output PDFs were blank or corrupted. However, they all are logged in reference to some specific EPS file. It would be good if you can please share your sample EPS file so that issue can be investigated accordingly and can be resolved for those type of files as well.