Hi,

 

I'm trying to manipulate the fonts in a document.  Specifically in some
PDField objects.

I suspect there's an easier way to do this, but first I'm trying to get
the fonts which are used in the Document. So I'm doing this:

 

            PDDocumentCatalog docCatalog =
pdfDocument.getDocumentCatalog();

            COSDictionary cosDictionary = docCatalog.getCOSDictionary();

 

            PDResources pdResources = new PDResources(cosDictionary);

            //Map phontCash = new HashMap();

            Map fonts = pdResources.getFonts();

for(Iterator iterator = fonts.entrySet().iterator(); iterator.hasNext()
; )   

            {   

                  //whether I use the phontCash, which is empty or just
call getFonts() I'm receiving the same exception;

                  // Exception with running testPDF:
java.lang.RuntimeException: Not yet implemented

            }

 

I'm guessing there's something organically wrong with what I'm doing,
but I somewhat at a loss to find examples.  The documentation has just
enough to explain the hierarchy.  Is there an example of setting a font
for a PDField which could be provided?  I've looked through the
examples, and it looks like it knows more about a font then I do.

Thanks,

Peter

 

Reply via email to