Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jul 21, 2020 1:37 pm

I have a document that is not very searchable.

When I search for Rathmann it does not find it.

When I copy and paste Rathmann into search box it pastes in 5DWKPDQQ.

When searching 5DWKPDQQ if finds Rathmann

Could you help me make this document searchable please?

---The uploaded file is just one page cut from the document due to file upload size limit.

[email protected]
 
Posts: 110
Joined: Tue May 19, 2015 8:09 pm

Wed Jul 22, 2020 8:15 am

Hello,

Thanks for your post.
I did notice that your PDF document is not searchable in Adobe, when copying and pasting your document content into the search box, the content is inconsistent. I am afraid that this is related to Adobe itself mechanism. However, using our the latest version(Spire.PDF (hot fix) version 6.7.8) can search successfully. The below is my testing code and I uploaded my output file for your reference.
Code: Select all
 
            PdfDocument pdf = new PdfDocument("6343fos20200801_356.pdf");
            PdfTextFind[] result = null;
            foreach (PdfPageBase page in pdf.Pages)
            {
                result = page.FindText("Rathmann", TextFindParameter.None).Finds;
                foreach (PdfTextFind find in result)
                {
                    find.ApplyHighLight();
                }
            }
            pdf.SaveToFile("result.pdf");

At the same time, our Spire.PDF also supports extracting the text content. You also can try the following code to extract them to a .txt file, and then search the string in it. If there is any other question, just feel free to write back.
Code: Select all
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile("6343fos20200801_356.pdf");
            StringBuilder content = new StringBuilder();
            foreach (PdfPageBase page in doc.Pages)
            {
                content.Append(page.ExtractText());
            }
            String fileName = "outPut.txt";
            File.WriteAllText(fileName, content.ToString());

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Fri Jul 31, 2020 11:07 am

Hi Spencer,

Greetings from E-iceblue.
Regarding the issue you posted on our forum, did we resolve your issue?
Thanks in advance for your valuable feedback and time.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Fri Jul 31, 2020 3:37 pm

No we have not resolved it. The document may have been created incorrectly.

[email protected]
 
Posts: 110
Joined: Tue May 19, 2015 8:09 pm

Mon Aug 03, 2020 5:36 am

Hi Spencer,

Thanks for your quick response.
Yes, there are problems when searching your source PDF document in Adobe. Sorry, at present we don’t have a better way to operate your source document to make it can be searched in Adobe. If we can help you with anything else, just feel free to contact us.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Return to Spire.PDF