This is great News !! Make sense I have been reading the PDF spec and other kind of annotation are not too hard to implement directly , but once I there if I build nice getter I will contribute them ;)
hopefully this works out well , and once my application link against Podofo it will tempting to sort my font problem. I have a small question , not more PDF than PoDoFo related but if you have an idea it would be really nice, do you know what is the general approach to highlight the text of a search result ? at the moment I am trying something like scanning the text and when I find the text I am looking for trying to locate its bound on screen and create a semi transparent Box around it . my approach current fail because without font I can not locate the text in the screen with accurately . do you know if there is a better/simpler way ? just fishing really :) Thanks a lot for your help Damien On 3 May 2010, at 23:08, Dominik Seichter wrote: > Hi, > > Opening existing PDF files, adding annotations to them and saving them is > perfectly doable using PoDoFo, even if for example font encodings are not > supported directly. > > PoDoFo supports any kind of PDF annotation, only the basic ones are supported > using the API though. You can create any other annotation by adding the keys > and values described in the PDF Reference to the dictionary returned by > PdfAnnotation::GetObject()->GetDictionary(). > > Adding API support for other annotations is merely a matter of adding getters > and setters for the keys and values you would add otherwise directly to the > dictionary as described above. > > Best regards, > Dom > > Am Montag 03 Mai 2010 schrieb xteo: >> Hi , >> >> I need to asses how much time doing this plus implementing it into my app >> is gonna take before I start going that direction, but I think its >> something I might be able to do. >> I have currently left this feature on my "Maybe list" until I can see if I >> will have time . >> >> looking at the feature set of PoDoFo I was also very interested into the >> Annotation feature . >> >> here is was I would like to be able to do : >> >> Open a PDF >> go to specific pages and add Annotation ( of several kinds ) and save back >> the PDF . >> >> is that something PoDoFo can do ? even if some part of the documents ( like >> fonts ) are not supported by PoDoFo ? >> >> reading the documentation and the code I notice that not all Annotation >> type are supported, if that still the case. It seams that the basic one >> are supported already that is great, how much work is involve in >> supporting some other one ? I can't really see what is missing ? >> >> Thanks a lot >> >> Damien >> >> On 3 May 2010, at 22:35, Dominik Seichter wrote: >>> Hi, >>> >>> I think the issue is always that PdfEncodingFactory is unable to create a >>> encoding for most fonts. I changed current SVN to throw an exception >>> instead of returning a NULL pointer. This should prevent the crashes, at >>> least. >>> >>> If you really need this feature, I suggest fixing PdfEncodingFactory to >>> be able to create the encodings used in your fonts. >>> Still, there might be some changes necessary to PdfFontMetrics to allow >>> creating every kind of font from the font data embedded in the PDF file, >>> but I think getting the encodings done is the first step. >>> >>> Best regards, >>> Dom >>> >>> Am Sonntag 02 Mai 2010 schrieb xteo: >>>> 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
