Skip to main content
Participant
September 13, 2016
Question

Combining CosObjs

  • September 13, 2016
  • 2 replies
  • 389 views

I am creating a signature plugin (based on the DocSign sample) and I want the appearance to include a graphic, for which I can use DigSigAPXObjectFromLogo, and some text, for which I can use DigSigAPCreateCompositeTextXObj.

Is there any way to combine the CosObj objects from those 2 functions into a single CosObj? If not, what's the best way to achieve my goal?

Thanks

This topic has been closed for replies.

2 replies

Legend
September 13, 2016

You'd use APIs like CosNewStream, CosNewDict, CosDictPutString and more. But before you can do that you need to know EXACTLY the structure of Form XObjects, all their keys and values, and how to create page streams with marking operators. The chapter "Graphics" in 32000-1 is crucial. Once you have this, the use of the Cos API should flow from it.

Legend
September 13, 2016

I've never used the API, but are the Cos objects each Form XObjects? If so you can make a third Form XObject which includes the other two as Resources and has a pretty short and trivial page stream. No special API for this, just creating streams, dictionaries etc.

kevpWacomAuthor
Participant
September 13, 2016

It appears the Cos objects are indeed Form XObjects.

Unfortunately, I'm very much a newcomer to the Acrobat SDK and not familiar with the API for creating streams, dictionaries etc. I would be grateful for any suggestions where to start looking, or better yet sample code you could point me towards.

Thanks