We will surely look into your requirements and investigate its feasibility. However, could you please share complete code snippet which you are using at your side so that we can generate a feature request accordingly.
private void ConvertPdf()
{
var pdf = new Aspose.Pdf.Document("input.pdf");
pdf.Convert(GetHocr);
}
private string GetHocr(System.Drawing.Image img)
{
Console.WriteLine("Processing image on page ??"); // How to show current page?
string hocr = GenerateHocr(img); // function that returns HOCR of image
return hocr;
}
All this needs is simply an overload of the CallBackGetHocr delegate that provides the page number. So the GetHocr method can be:
private string GetHocr(System.Drawing.Image img, int pageNumber)
{
Console.WriteLine("Processing image on page " + pageNumber);
string hocr = GenerateHocr(img); // function that returns HOCR of image
return hocr;
}
Or it could provide the Page object, i.e.
private string GetHocr(System.Drawing.Image img, Aspose.Pdf.Page page)
{
Console.WriteLine("Processing image on page " + page.Number);
string hocr = GenerateHocr(img); // function that returns HOCR of image
return hocr;
}
This would also allow skipping images from certain pages. E.g.
private string GetHocr(System.Drawing.Image img, int pageNumber)
{
// Only generate HOCR for pages 1-3
if (pageNumber < 4)
{
string hocr = GenerateHocr(img); // function that returns HOCR of image
return hocr;
}
else
{
return "";
}
}
We have logged a feature request as PDFNET-48540 in our issue tracking system. We will investigate the feasibility of your requirements and keep you informed about the status of their implementation. Please be patient and spare us some time.
The earlier logged ticket is currently under the phase of investigation. As soon as its investigation is complete, we will be able to share some updates about ticket resolution and ETA. We have recorded your concerns along with the ticket as well and will inform you in this forum thread once the ticket is resolved. Please spare us some time.