New Forum | Previous | Next | (P-PDF) Developers
Topic: Re: Acrobat Core API Question
Conf: (P-PDF) Developers, Msg: 56235
Date: 5/29/2002 05:18 PM
It's fun to pass down a little bit of history. COS stands for Carousel
Object Store. Carousel was the initial code name for Acrobat. You will also
see it in the Type and Creator fields for PDF files on the Macintosh. Some
people also claim it stands for COS Object Store, but that discussion could
go on forever.
If you read the PDF file specification version 1.3, section 3.2 discusses
objects. Each of these basic types, as well as composite objects, have an
in memory representation referred to as a CosObject. The Cos level of the
API is considered the lowest level of the API. Working at that level
provides the least amount of abstraction from the PDF file format and the
least amount of protection to ensure that you create valid PDF.
Using annotions as an example, if you create a PDAnnot object and add it to
the page using PDPageAddNewAnnot(), the method knows that annot objects
must be added to the annots array for that page and does it for you. The
Cos level provides no such assistance. You could call CosObjDestroy() on
the CosObject returned from PDAnnotGetCosObj(). The annot object would be
destroyed but the reference in the annots array would not be removed. The
resulting PDF would be invalid and raise an error when trying to draw that
In general, it is best to use the higher level abstractions in the API
(PDAnnot, PDDoc, etc) where they are available and use the Cos level only
when necessary. When using CosObjects to create form fields, keep the PDF
Specification close at hand and pay careful attention to direct and
indirect object types as well as inheritance of form field attributes or
risk creating invalid or inefficient PDF.
At 11:22 AM 7/18/01 -0400, you wrote:
>--- Planet PDF Forum | http://forum.planetpdf.com ----
>Thank you, I thought so, but was not sure.
>By the way what does COS mean?
>What is the difference between an annot object
>and a cos object?
>On 7/18/2001 11:11:05 AM, mgavin wrote:
> >> I need a little help in figuring out which of the
> >>API objects refer to PDF Form fields. My C/C++ is
> >>rusty. The Acrobat Forms API reference mentions a PDField object,
> >>and goes on to say that the Core API reference has details. I can't
> >>seem to find any
> >>instance of PDField in the core doc.
> >>I'm simply trying to create a pdf form field,
> >>not enumerate it (ala FormDemo.cpp).
> >>Any suggestions?
> >>thanks in advance
> >A form field is a type of
> >annotation (widget). As such
> >you can
> >create a new form field on a
> >PDPage using
> >PDPageCreateAnnot. You
> >then need to create the
> >various CosObjects needed by a
> >form field and
> >add them to the PDAnnot using
> >Mark Gavin
> >Chief Technology Officer
> >Appligent, Inc. (formerly
> >Digital Applications, Inc.)
> >60 South Lansdowne Avenue
> >Lansdowne, PA 19050
> >(610) 284-4006
>------- Planet PDF Store's Top 10 List for May ---------
> ARTS Split and Merge - Stamp PDF - Jaws PDF Creator
> Gemini - Amyuni PDF Converter - Crackerjack - BCL Drake
> iCopy - ARTS Import - Mapsoft Impress Stamper
> Find out why these were the best-selling products last
> month. Free demos of each at the Planet PDF Store!
>---- Powered by foxitsoftware.com & www.PlanetPDF.com ----