[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] Text selection fails
From: |
Sean Laurent |
Subject: |
Re: [Swftools-common] Text selection fails |
Date: |
Mon, 7 Dec 2009 15:51:26 -0600 |
Thanks. That solved my first problem. Now text selection works in that I can
call setSelected() and getSelectedText() returns the selection as expected. Woo
woo!
Unfortunately, highlighting is not working. I can select text just fine, but
the expected border doesn't appear around the selected text. I'm convert from
pdf using the following options:
pdf2swf -T9 -f -G -o file.swf file.pdf
I've tried it with and without flattening (-G). Neither seems to make a
difference.
My Flex code looks something like the following:
private function searchDocument(searchText:String, startPos:int = 0) : void {
var matchLocation:int = _mainClip.textSnapshot.findText(startPos, searchText,
false);
var clip:MovieClip = ldr.content as MovieClip;
var text:TextSnapshot = clip.textSnapshot;
text.setSelected(matchLocation, matchLocation + searchText.length, true);
text.setSelectColor(0xffcc33);
trace("selectedText: " + text.getSelectedText(false));
}
I've tried leaving the selection color as the default (0xFFFF00) or changing it
around, but no luck. The trace lines shows me that it's finding and selecting
matches. But nothing gets highlighted. :(
Any suggestions?
-Sean
On Dec 6, 2009, at 3:38 PM, Matthias Kramm wrote:
> On Tue, Dec 01, 2009 at 02:05:25PM -0600, Sean Laurent <address@hidden> wrote:
>> I'm using pdf2swf 0.9.0 and I can successfully convert and display a
>> large variety of PDFs. However, I can't seem to select any text:
>
> Try converting the file with the -f option:
> pdf2swf -f file.pdf -o file.swf
>
> This should probably be a FAQ item.
>
> Matthias
>