PHP Classes

Blank page and doubts

Recommend this page to a friend!

      PHP PDF to Text  >  All threads  >  Blank page and doubts  >  (Un) Subscribe thread alerts  
Subject:Blank page and doubts
Summary:It doesn't show the page number or the string I searched
Messages:3
Author:Benjamin Moises Villalobos Abreu
Date:2017-04-03 20:55:28
 

  1. Blank page and doubts   Reply   Report abuse  
Picture of Benjamin Moises Villalobos Abreu Benjamin Moises Villalobos Abreu - 2017-04-03 20:55:28
Hello! I really love this example and it help me a lot! but I have a problem when I try to search a string in a pdf file to get the match between the string and the page number it doesn't show me anything the page turns all white like if I didn't anything to print.

Also sorry if I ask to much but I have a doubt, if it is possible to show the pdf page where that string to search is and if it matches with the page number so that of all the lets say 10 pages it shows me only the 5 page where the string I'm searching is?

  2. Re: Blank page and doubts   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2017-04-03 21:21:17 - In reply to message 1 from Benjamin Moises Villalobos Abreu
Hi Benjamin,

Thanks for your feedback.

Would it be possible for you to send me your test script along with the PDF file at teh following address :

christian.vigh@wuthering-bytes.com

The text string search function has been developed for such a long time that I'm afraid I neglected it a little bit during successive evolutions ! so an example would help me.

Regarding your second question, normally it is possible to get all the pages that contain the searched string using the document_strpos function ; however, if it does not work, an example would be welcome too !

With kind regards,
Christian.

  3. Re: Blank page and doubts   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2017-04-05 10:37:15 - In reply to message 1 from Benjamin Moises Villalobos Abreu
Hi Benjamin,

There were two bugs in my class :
- In PDF files, text can be specified as is, or can use an octal notation (among other forms). In your case, for example, the string "5,185,514" on the first page was preceded by a space in octal notation ; this gave : "\0405,185,514", \040" being the code for the ascii space (decimal 32). Unfortunately, the digit "5" was included in the decoding of the escape sequence. This is why you saw a control character followed by the string ",185,514" (and lots of other similar things in the rest of the document). The string you searched in the example you sent to me was not found because it felt in this case : the first digit of the number you searched was mistakenly included in the octal escape sequence.
- There was a bug in the document_strxpos() functions : it returned a zero-based offset, whereas the page contents found in the Pages property are indexed by their page number (starting from 1)

Version 1.5.2 should solve these issues.

With kind regards,
Christian.