Render objects and annotations into the PDF

<< Click to Display Table of Contents >>

Navigation:  Tasks > Draw Shapes / Text objects on PDF >

Render objects and annotations into the PDF

If you need to save the objects with the PDF you need to call the command COMPDF_RenderDrawobjects.

 

The parameter is a bit field. The following bits are used

 1 : RenderAnnotations - Render the annotations which are not widgets and not Popups

 2 : RenderWidgets - Render widgets annotations.

 4 : RenderPopups - also render popup annotations

 8 : DeleteRenderedObjects - deletes draw objects and annotations after rendering

16 : UseOriginalDataForRendering - use the original V and AS values when windgets are rendered

32 : UnderPageLayer - Render the draw objects under the page

64 : OverPageLayer  - Render the draw objects over the page (or document draw objects)

128: Do not render or delete. Just count how many objects would be affected

 

Note: Links, file attachments, movie and sound annotations are never rendered!

 

The return value is the count of objects which were converted.

 

The objects are not deleted - use WPViewPDF1.ClearDrawObject(-1, -1); to delete all shapes.

 

The command can be used to "flatten" the annotations.

 

To do so, it is required that the annotations have been converted into draw objects (which makes them editable) using COMPDF_ACRO_MAKEDRAWOBJ.

 

This commands will flatten all annotations and remove them:

 

Command(COMPDF_ACRO_MAKEDRAWOBJ,'',0);  

Command( COMPDF_RenderDrawobjects, 1+2+8);

 

to render the objects. You can change the save mode to remove the annotations when saving the file

 see COMPDF_Ann_SetAnnotSaveMode.