Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a website which i convert pdf documents to images and display those images in a webpage.

I want the text content of the images indexed in google but i could not find out how to do it in a legal way.

An example: In a webpage, there's an image which contains this sentence: "I am a human being". There's no such text in webpage, but as the programmer of the site, I know that that sentence will be in the image. Is there a way to have this page indexed with "I am human being" sentence?

share|improve this question
    
by the way, i already tried to make an html page which contains only the text and redirect it to real page onload. But then i found out that this is called "cloaking" and google penalized my site. –  directorscott Jul 31 '12 at 14:48
    
How much text is in one of your PDF documents/images? Is "I am a human being" a typical example? –  w3d Jul 31 '12 at 15:10
    
Documents are e-books mostly and they contain ~200 pages with full of texts. John Conde's solution might be applicable if alt attribute had no character limit but in my case, i will not be able to put all text of a page to alt attribute –  directorscott Jul 31 '12 at 15:25
    
In that case img alt text is not a viable solution. In theory the longdesc attribute might have been an answer, but I don't think search engines make use of this (browsers don't seem to)? –  w3d Jul 31 '12 at 15:41
1  
Honestly, this workflow sounds ridiculous. (Without context.) Can you explain what the point of this is? If you want text indexed, why not just make it text? Does you client not want people being able to copy/paste or something? Given more information, it might be possible for us to approach this another way. It'd probably be just about as insecure as hidden text, but possibly less work. (The underlying point here is that the reason it's hard to make this work, is that this is not how things are supposed to work.) –  Su' Aug 1 '12 at 15:56
show 2 more comments

1 Answer

Use the alt attribute of the <img> tag. That exactly what this is for.

share|improve this answer
    
I don't have page-by-page texts right now but i can produce them. Thank you for solution. –  directorscott Jul 31 '12 at 15:20
    
Sorry but i just found out that img tag's alt attribute has character limit (125 i think). So this solution is not applicable in my case –  directorscott Jul 31 '12 at 15:24
    
@directorscott Who told you that? They're lying. –  Su' Jul 31 '12 at 18:37
    
@Su' Don't you think the alt text has a limit? Or just not 125 chars? I think the alt text has a limit, but that we can't say precisely what it is. This test appears to suggest that Google has indexed just the first 16 words. Matt Cutts in his video says, "...you are not spamming; this is a total of 7 words, if you've got 200 words in your ALT text [expressed in a way that suggests this is way too much], ... If you've got 20 or 25, that’s even getting a little bit out there". –  w3d Aug 1 '12 at 9:51
    
@w3d The comment was a blanket statement about the alt attribute. There is no such limit defined in the spec. Cutts is talking about what Google does. (Never mind this entire question is kind of bizarre.) –  Su' Aug 1 '12 at 15:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.