If you place the characters far apart from each other the search algorith
thinks that they are separated words. The last iText version has a feature
that allows you to use a font with your choice of character widths. See the
example font_widths.java in my site. This may solve your problem if you know
the correct original font width that you are emulating.

Best Regards,
Pauklo Soares

> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 21:11
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] Searchable Text
> 
> What are the requirements for text to be searchable in PDF?
> 
> What I'm doing is this.
> 
> I'm trying to create an alternate method to generate mainframe xerox
> forms.
> 
> I've created a parser for the xerox form language that will create
> PDFTemplates.
> 
> When I go to match the report data to the template I have to be very
> explicit (the forms are many, and very complex), So I determine the
> spacing
> to use and put the report line to the template 1 character at a time.
> 
> ---CODE SAMPLE---
> 
>      formTemplate.beginText();
>      formTemplate.setFontAndSize(baseFont, pointSize);
>      //Write out the report line a character at a time
>      for (int i=1; i < lineSize; i++) {
>           if (String.valueOf(lineChar[i]).trim().length() > 0 &&
> !Character.isISOControl(lineChar[i])) {
>                formTemplate.setTextMatrix(new Float(xVar).floatValue(),
> height - (new Float(yVar).floatValue()));
>                formTemplate.showText(String.valueOf(lineChar[i]));
>           }
> 
>           xVar = xVar + charSpacing;
> 
>      }
>      formTemplate.endText();
> 
> ---CODE SAMPLE END---
> 
> My problem is the report data is not searchable.  I've tried putting the
> data out in "words" (buffer until space), and using setCharacterSpacing()
> to keep things looking good.  But if I use setCharacterSpacing(>1) the
> report data is not searchable either.
> 
> Thanks for the help,
> Matt
> 
> 
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions

_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to