WordDocument document = new WordDocument(@"sample.docx"); document.UpdateAlternateChunks(); document.Save("Output.doc"); document.Close(); |
Query |
Details |
1. By using PerformOCR is it possible to convert it to searchable pdf for large file. I am receiving out of memory exception which works for 1 page or 10 page file.
PFA the code snippet i have used and file
List<string> matchedtextarray = matchedtext.Split(',').ToList();
List<TextSearchItem> searchItems = new List<TextSearchItem>();
foreach (string s in matchedtextarray)
{
searchItems.Add(new TextSearchItem(s, TextSearchOptions.None));
}
OCRProcessor processor = new OCRProcessor(location);
processor.Settings.Language = Languages.English;
processor.PerformOCR(loadedDocument1, loc2 );
loadedDocument1.Save("OCR.pdf");
loadedDocument1.Close(true);
|
We have tried to reproduce the reported issue with the provided PDF document in our latest version 18.2.0.44. But we regret to let you know that we were unable to reproduce it. Please find the sample which we tried from below,
Please try the above sample in your end and revert us with modified sample with product version details.
|
adding one more question i am not able to search words using findtext in searchable pdf where as its works for non searchable pdf non image texts.
List<string> matchedtextarray = matchedtext.Split(',').ToList();
PdfLoadedDocument loadedDocument1 = new PdfLoadedDocument(searchable pdf );
List<TextSearchItem> searchItems = new List<TextSearchItem>();
foreach (string s in matchedtextarray)
{
searchItems.Add(new TextSearchItem("indio", TextSearchOptions.None));
}
loadedDocument1.FindText(searchItems, out TextSearchResultCollection searchResult);
searchResult always gives result as null
adding the file in which indio keyword is available.
|
We can reproduce the issue with the provided details, we will analyze further on it and update you with more detail on September 10, 2020 |