On Sun, 2018-02-11 at 23:50 +0100, Olivier Mascia wrote:
> Dear,
> To parallel the standard properties setter/getter like
> SetAuthor/GetAuthor,... it might be wise to add:
>       const PdfString & PdfInfo::GetCustomKey(const PdfName &sName)
> const;
>       {
>               return this->GetStringFromInfoDict(sName);
>       }
> to PdfInfo.h to balance the SetCustomKey public method.  Or to have a
> public way to enumerate the keys from InfoDict.  Is there such thing
> that I would have missed?

having complete API looks like a good idea. In the meantime, you can:

   PdfName name = "xxx";

   if (document->GetInfo()->GetObject()->GetDictionary().HasKey(name)){
      const PdfObject *object = document->GetInfo()->GetObject()->
      if (object && (object->IsString() || object->IsHexString())) {
         std::wstring wstr = object->GetString().GetStringW();
         // wstr contains the value;

I'm not going to add the API there, I'm only showing that with PoDoFo
you can achieve anything by using low-level API, without relying on
provided higher-level APIs by PoDoFo itself. It's good to be aware of
it, because there are many things which can be done in PDF for which
PoDoFo doesn't have higher-level API at all.

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Podofo-users mailing list

Reply via email to