This is a migrated thread and some comments may be shown as answers.

Searching in exported PDF file.

1 Answer 100 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Jakub
Top achievements
Rank 1
Iron
Jakub asked on 08 Aug 2016, 09:25 AM

Hi,

here is my sample console app:

using System.IO;
using Telerik.Windows.Documents.FormatProviders.Pdf;
using Telerik.Windows.Documents.Model;
 
namespace PdfExportTest
{
    class Program
    {
        static void Main(string[] args)
        {
            RadDocument doc = new RadDocument();
            RadDocumentEditor editor = new RadDocumentEditor(doc);
 
            Section section = new Section();
            doc.Sections.Add(section);
 
            editor.Document.CaretPosition.MoveToStartOfDocumentElement(section);
            editor.InsertLine("TEST");
 
            var provider = new PdfFormatProvider();
 
            using (Stream stream = new FileStream(@"C:\\temp\\test.pdf", FileMode.Create))
            {
                provider.Export(doc, stream);
            }
        }
    }
}

When use search option to find "TEST", Adobe Reader shows it couldn't find any matching words.

Is it known issue that Adobe Reader can't find words in exported documents?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 10 Aug 2016, 01:39 PM
Hello Jakub,

I have tried the following steps:
  1. Generate PDF file using the code you have sent with the latest version of RadRichTextBox.
  2. Open the file with Adobe Reader.
  3. Click in the beginning of the word "TEST" so that I see that the caret in the viewer is positioned before the word.
  4. Press Ctrl+F and write the text "TEST" for the word to search.
  5. Press on "Next" button to find the next appearance of the word in the PDF file.
As a result, Adobe Reader successfully finds the word "TEST" and marks it. This may be seen in the attached screenshot.

Could you confirm that by following the same steps you reproduce the same result?

Regards,
Deyan
Telerik by Progress

Tags
PdfProcessing
Asked by
Jakub
Top achievements
Rank 1
Iron
Answers by
Deyan
Telerik team
Share this question
or