Hi 

I was looking into it more yesterday night and also found some case where 
TrueType font are crashing 

Currently the main reason I would like to have the font is to determine the 
length of the character into a BT/ET block

I have search functionality in my app where I have a copy of the text per page 
and search that , but once I take the user to the right page  l would like to 
highlight the search result block

At the moment i can scan manually the code to get the start location of each 
text block and their size but without the font information I can't find where 
the text end , also if my search result was in the middle of a text block I 
would need to calculate where the part of the text I need to highlight start 

Once have figure that out I think it will also be quite easy to implement 
annotation in my application and also text selection / copy

Maybe there is an other way to do that ? This is the only information that I 
really need from the font , the width of each char 

Thanks a lot for this library , I hope I can successfully integrate it into my 
project and hopefully contribute some code or fixes 

Damien 

  

Sent from my iPad

On 2 May 2010, at 11:38, Dominik Seichter <[email protected]> wrote:

> Hi,
> 
> The relevant code, where PdfFontCID ist called with a NULL PdfEncoding is 
> only 
> called, when you try to construct a PdfFont from an existing object in a PDF 
> file. Support for this is not very good. It works with simple fonts, but 
> PoDoFo 
> is currently not able to consturct the encoding for a CID font from a PDF 
> file. 
> So, PoDoFo should not crash in this case, but maybe throw an exception that 
> this is not supported.
> 
> What do you want to do excactly? Maybe we can find another solution.
> 
> Best regards,
>       Dominik
> 
> Am Sonntag 02 Mai 2010 schrieb xteo:
>> Hi ,
>> 
>> I have recently started looking at podofo for one of my project that need
>> PDF support .
>> 
>> It look like a really great library !!
>> 
>> to get started and make sure all was working ,
>> I builded the library in my project and replicate the code from the code
>> that extract the text from a PDF .
>> 
>> version downloaded from the website : 0.8.0 compiled on Mac .
>> 
>> on some PDF its working fine and I get what I expect but on some other it
>> crash .
>> 
>> I have looked into it and fond the cause but I am missing a little bit of
>> context to try to fix it :
>> 
>> int : PdfFontFactory.cpp
>> 
>> PdfFont* PdfFontFactory::CreateFont( FT_Library* pLibrary, PdfObject*
>> pObject ) {
>> ......
>> 
>>       pFont       = new PdfFontCID( pMetrics, NULL, pObject, false );
>> 
>> }
>> 
>> This create a PdfFontCID with a NULL pPdfEncoding.
>> 
>> This later leads to issue in the constructor when void PdfFontCID::Init(
>> bool bEmbed ) is called and m_pEncoding is NULL .
>> 
>>      // The encoding is here usually a (Predefined) CMap from
>> PdfIdentityEncoding: m_pEncoding->AddToDictionary(
>> m_pObject->GetDictionary() );
>>      ^^^^^^^^^^^ is NULL
>> 
>> I am not sure what to make of the comment , I have try to pass various
>> encoding to PdfFontCID , but didn't managed to fix the problem .
>> 
>> Please let me know if there is anything ovious that I am missing .
>> 
>> Damien
>> 
> 
> 
> -- 
> **********************************************************************
> Dominik Seichter - [email protected]
> KRename  - http://www.krename.net  - Powerful batch renamer for KDE
> KBarcode - http://www.kbarcode.net - Barcode and label printing
> PoDoFo - http://podofo.sf.net - PDF generation and parsing library
> SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
> Alan - http://alan.sf.net - A Turing Machine in Java
> **********************************************************************

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to