we build searchable PDFs with the following function:
Code: Select all
if (oGdPicturePDF.LoadFromFile(pFile, false) == GdPicture9.GdPictureStatus.OK)
{
pdfID = oGdPictureImaging.PdfOCRStart(pOcrFile, true, title, author, subject, keywords, creator);
if (pdfID == 0)
{
return false;
}
for (int i = 1; i <= oGdPicturePDF.GetPageCount(); i++)
{
oGdPicturePDF.SelectPage(i);
imageID = oGdPicturePDF.RenderPageToGdPictureImage(pResolution, true);
if (imageID == 0)
{
return false;
}
oGdPictureImaging.PdfAddGdPictureImageToPdfOCR(pdfID, imageID, lang, directory, "");
oGdPictureImaging.ReleaseGdPictureImage(imageID);
}
oGdPicturePDF.CloseDocument();
oGdPictureImaging.PdfOCRStop(pdfID);
}
else
{
return false;
}
Maybe there is an easier way to create an ocr-pdf from a normal pdf?
greetings