Thanks Yousif, we still found some problematic pdfs with this. However we have eventually managed to position our own higlighting based on the gettextruninfo from a non-font embedded swf which so far appears to be a bit more consistent.
On 20 April 2010 13:11, Yousif Masoud <[email protected]> wrote: > On Tue, Apr 20, 2010 at 11:26 AM, DannyT <[email protected]> wrote: > >> Sorry for the running commentary but this is driving me potty. >> >> If the font is not embedded, the height property of the gettextruninfo >> call returns a decimal between 0 and 1 - does anyone know what this relates >> to and if it can be translated to a pixel height at all? >> >> Cheers, >> >> >> On 20 April 2010 08:51, DannyT <[email protected]> wrote: >> >>> Or maybe I'm missing something, i basically want to be able to highlight >>> and/or getTextRunInfo on any text in a pdf. As we allow pdfs to be uploaded >>> there's no guarantees we'll have the font installed to embed. >>> >>> Has anyone else tackled this? I can see scribd.com manage to do it >>> somehow. >>> >>> Any suggestions much appreciated :) >>> >>> >>> On 19 April 2010 10:59, DannyT <[email protected]> wrote: >>> >>>> We're working on a pdf viewer with a search function and use >>>> TextSnapshot.getTextRunInfo to highlight the search results. This is >>>> somewhat sporadic as where the PDF contains a font that is NOT in the fonts >>>> path passed in to pdf2swf then we don't have access to all of the >>>> information (corner0x, height etc.). >>>> >>>> I've just tested a service onlinefontconverter[dot]com which allowed me >>>> to upload a pdf and then download the fonts contained within it. Does >>>> anyone >>>> know if something like this is available in swftools or of some other >>>> executable (paid or OS) we could use to extract the fonts and put them in a >>>> temp directory which is then passed to pdf2swf? >>>> >>> >>> >>> >>> -- >>> http://danny-t.co.uk >>> >> >> >> >> -- >> http://danny-t.co.uk >> > > Hi Danny, > I've implemented the search function using textSnapShot and getTextRunInfo > too. > > When converting a document, if you use the -f flag, it will embed the > fonts. I recommend using the -f flag. > > Use the -F flag if you want to include a font directory. > > use pdf2swf -h for more details. > > Thanks, > Yousif > > -- http://danny-t.co.uk
