|
From: | Mark A. Lowe |
Subject: | RE: [Swftools-common] Within SWF search |
Date: | Thu, 17 Apr 2008 08:47:40 +1000 |
No worries Dmitry, I think my temp server was
emptied and that link didn’t work for others – I’ve fixed it now: http://www.multimediaresourceaustralia.com/~temp/pdf2swf/searchTextSample.zip Cheers, Mark.
MMR, Suite 409, 434 St. Kilda Road, Melbourne, 3004 From: Dmitry K Valberg
[mailto:address@hidden Hello, Mark! Thank you for much for the
example! It’s exactly what I needed. And thank you for such a quick
reply :) Have a nice day! Dmitry From: Mark A. Lowe
[mailto:address@hidden Hey mate, Think the example you mentioned
was mine. I’ve re-uploaded it for you! And I’ve copied the email
discussion below. The new link is: http://www.multimediaresourceaustralia.com/~temp/searchTextSample.zip Hope this helps! Cheers, Mark.
MMR, Suite 409, 434 St. Kilda Road, Melbourne, 3004 Hey Jan, I've uploaded a sample to : http://www.multimediaresourceaustralia.com/~temp/searchTextSample.zip It contains my working PDF file, outputted SWF file, and
a flash8 (and Flash CS3) FLA which loads the SWF and has the Search Text button
with the hltext function on it. There are some instructions in the .txt file. Hope this helps! mark lowe senior multimedia developer multimedia resource australia t: +61 3 9602 4750 f: +61 3 9606 0408 e: w: level 2, 351 elizabeth st, melbourne vic 3000 [
courier correspondence ] p.o. box 205, fitzroy vic 3065 [ all other
correspondence ] -----Original Message----- From: jan bahnsen [mailto:address@hidden Sent: Friday, November 16, 2007 12:19 AM To: Mark A. Lowe Subject: Re: [Swftools-common] PDF2SWF and
getTextSnapShot() Hi Mark, great stuff! > If anyone would like some sample files give me a
shout, Would really appreciate if you could pop over a sample -
will be very useful for better understanding! Cheers, Jan. 2007/11/15, Mark A. Lowe <address@hidden>: > Many thanks Fabio, > I've managed to get somewhere with your
actionscript. > I also had a problem with how I was creating my swf
from pdf2swf. > > For everyone else make sure you follow these steps: > > 1. Use Flash 8 or previous version (I used 6) with
the -T command : > pdf2swf -T 6 2. Use the -f command for full fonts :
pdf2swf -f 3. Test > your outputted swf with: swfdump -t filename.swf ,
you should see a list of DEFINETEXT statements and the corresponding text. Due
to a font conflict I was seeing DEFINETEXT followed by jumbled up text on my
first pdf. > 4. Test your outputted swf with: swfstrings
filename.swf, you should see your text and a LOT of ???????s. Again, I had
garbage text when trying to convert my original PDF. > > If the swfdump and swfstrings tests are working,
load your pdf2swf.swf into Flash. Publish it for 8. > I loaded it into a movieclip on my root timeline
called 'loader' : >
loader.loadMovie("pdf2swf_files/6new.swf"); > I have a movieclip called 'searchText_mc' and have
the following code for it: > > searchText_mc. { > hltext
("wonderful"); > } > > And then the hltext is as Fabio provided. This will
yellow-highlight all the occurrences of the search string: > > function hltext ( txt ) > { >
trace("hltext"); > var mc =
_root.loader; > var
my_snap:TextSnapshot = mc.getTextSnapshot(); > var
start_pos:Number = 0; > > start_pos
= my_snap.findText ( start_pos, txt, false ); >
trace("start_pos : " + start_pos); > while (
start_pos > 0 ) > { >
trace ( start_pos ); >
my_snap.setSelected( start_pos, start_pos + txt.length, true ); >
start_pos += txt.length; >
start_pos = my_snap.findText ( start_pos, txt, false ); > } > > } > > If anyone would like some sample files give me a
shout, From:
address@hidden
[mailto:address@hidden On Behalf Of Dmitry
K Valberg Hello! I know this has been discussed before, but the only
sample/example showing how to do search in SWF files produced by PDF2SWF is no
longer offline. So I was wondering if there is an simple example on how I can
add search functionality to my SWF files? I have been trying my luck with Flex 3 and SWFLoader, sadly
even example posted on Adobe Flex 3 reference manual doesn’t work. http://livedocs.adobe.com/flex/3/html/Working_with_Text_18.html Tried both Flex 3, Flash 9 with all kinds of textfields and
types. Thank you, Dmitry K Valberg Norway, A-Pressen |
[Prev in Thread] | Current Thread | [Next in Thread] |