We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Saved PDF pages result in text that can not be string searched/matched

I recently wrote a Windows desktop app (using the SF 16.1460.0.24 libraries) that searches pdf document text and extracts pages that have matches. I add the pages to new pdf documents, append additional pages to it, and ultimately save the new doc on disk. This works very well, with one little snag. I can't do the same with the saved documents. I can not search and match text in those documents I create and save. I'm missing some little detail no doubt. Any suggestions?

2 Replies

KC Karthikeyan Chandrasekar Syncfusion Team November 8, 2018 08:38 AM UTC

Hi Robert, 
Thank you for contacting Syncfusion support. It will be more helpful if you could provide us the input PDF document and the code snippet from which the issue is reproduced. So that we could investigate in this and provide you the solution. 

Regards, 
Karthikeyan  



RD Robert Dickow November 9, 2018 12:12 AM UTC

Thanks for your support. I found a solution. I have learned that in order to get the correct page structure added to a new document, I needed to use this:

`(PdfDocument) newDoc.ImportPage((PdfLoadedDocument) doc, (int) pageCounter);`

but I was using this:

`(PdfDocument) newDoc.ImportPage((PdfLoadedDocument) doc, (PdfLoadedPage) page);`

I think the second overloaded parameter is supposed to be PdfPage and not PdfLoadedPage in order to work correctly. It didn't throw and error, but the new document ended up with text that for some reason can't be searched from extractedText on followup processing of a pdf document saved from newDoc.

Loader.
Up arrow icon