LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Enumerations | Functions
document.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/model/defs.h>
#include <LayOutAPI/model/imagerep.h>
#include <time.h>

Go to the source code of this file.

Enumerations

enum  LODocumentVersion {
  LODocumentVersion_1 = 1, LODocumentVersion_2 = 2, LODocumentVersion_3 = 3, LODocumentVersion_2013 = 13,
  LODocumentVersion_2014 = 14, LODocumentVersion_2015 = 15, LODocumentVersion_2016 = 16, LODocumentVersion_2017 = 17,
  LODocumentVersion_2018 = 18, LODocumentVersion_2019 = 19, LODocumentVersion_Current = LODocumentVersion_2019, LONumDocumentVersions
}
 Defines the different versions of the .layout file format that are supported. More...
 
enum  LODocumentUnits {
  LODocumentUnits_FractionalInches = 0, LODocumentUnits_DecimalInches, LODocumentUnits_DecimalFeet, LODocumentUnits_DecimalMillimeters,
  LODocumentUnits_DecimalCentimeters, LODocumentUnits_DecimalMeters, LODocumentUnits_DecimalPoints, LONumDocumentUnits
}
 Defines the different units formats that are available. More...
 

Functions

LO_RESULT LODocumentCreateEmpty (LODocumentRef *document)
 Creates a new empty document object. It will contain one page and one layer. More...
 
LO_RESULT LODocumentCreateFromFile (LODocumentRef *document, const char *path)
 Creates a new document object by loading an existing .layout file. More...
 
LO_RESULT LODocumentCreateFromTemplate (LODocumentRef *document, const char *path)
 Creates a new document object using an existing .layout file as a template. This differs from LODocumentCreateFromFile in that the new document won't have a path until it is saved for the first time. More...
 
LO_RESULT LODocumentRelease (LODocumentRef *document)
 Releases a document object. The object will be invalidated if releasing the last reference. Note: it is important to call LODocumentRelease before calling LOTerminate, otherwise LODocumentRelease may fail unpredictably. More...
 
LO_RESULT LODocumentAddReference (LODocumentRef document)
 Adds a reference to an document object. More...
 
LO_RESULT LODocumentSaveToFile (LODocumentRef document, const char *path, LODocumentVersion version)
 Saves a document to a file at the given path. Passing an empty path string will save the document at its current path. More...
 
LO_RESULT LODocumentExportToPDF (LODocumentRef document, const char *path, LODictionaryRef options_dict)
 Exports the document to a .pdf file at the indicated path. If a valid options dictionary object is provided, then it can specify additional PDF export options. The following options (declared in documentexportoptions.h) may be specified in the options dictionary to override their default values: More...
 
LO_RESULT LODocumentExportToImageSet (LODocumentRef document, const char *export_path, const char *base_name, LOImageRepOutputFormat format, LODictionaryRef options_dict)
 Exports the document as a series of image files at the indicated path. For multi-page documents, each page will append its page number to base_name to use as the file name. If a valid options dictionary object is provided, then it can specify additional image export options. The following options (declared in documentexportoptions.h) may be specified in the options dictionary to override their default values: More...
 
LO_RESULT LODocumentGetFilePath (LODocumentRef document, SUStringRef *path)
 Gets the full path to a document's .layout file. More...
 
LO_RESULT LODocumentGetNumberOfLayers (LODocumentRef document, size_t *num_layers)
 Gets the number of layers in a document. More...
 
LO_RESULT LODocumentGetLayerAtIndex (LODocumentRef document, size_t index, LOLayerRef *layer_definition)
 Gets a reference to the layer definition at the given index for a document. More...
 
LO_RESULT LODocumentGetLayers (LODocumentRef document, LOLayerListRef layer_definitions)
 Populates a LOLayerListRef with all of the layer definitions in a document. More...
 
LO_RESULT LODocumentGetActiveLayer (LODocumentRef document, LOLayerRef *layer_definition)
 Gets a reference to the document's active layer definition. More...
 
LO_RESULT LODocumentSetActiveLayer (LODocumentRef document, LOLayerRef layer_definition)
 Sets the document's active layer definition. More...
 
LO_RESULT LODocumentReorderLayer (LODocumentRef document, LOLayerRef layer_definition, size_t new_index)
 Moves a layer to a different index within a document's list of layers. This will move the layer such that its new index becomes new_index. More...
 
LO_RESULT LODocumentAddLayer (LODocumentRef document, bool shared, LOLayerRef *layer_definition)
 Adds a new layer to the document. The user is not responsible for releasing the returned layer definition object. More...
 
LO_RESULT LODocumentRemoveLayer (LODocumentRef document, LOLayerRef *layer_definition, bool delete_entities)
 Removes a layer from a document. There must be at least one other unlocked and visible layer on every page. If this is not the case, then the next layer will be automatically unlocked and made visible on all pages as necessary to proceed with the operation. *layer_definition will be set to invalid by this function. More...
 
LO_RESULT LODocumentGetPageInfo (LODocumentRef document, LOPageInfoRef *page_info)
 Gets the page info object for a document. More...
 
LO_RESULT LODocumentGetGrid (LODocumentRef document, LOGridRef *grid)
 Gets the grid object for a document. More...
 
LO_RESULT LODocumentGetNumberOfPages (LODocumentRef document, size_t *num_pages)
 Gets the total number of pages in a document. More...
 
LO_RESULT LODocumentGetPageAtIndex (LODocumentRef document, size_t index, LOPageRef *page)
 Gets the page at a given index in a document. More...
 
LO_RESULT LODocumentGetPages (LODocumentRef document, LOPageListRef pages)
 Populates a LOPageListRef object with all the pages in a document. More...
 
LO_RESULT LODocumentGetInitialPage (LODocumentRef document, LOPageRef *page)
 Gets a reference to the page that will be shown the next time the document is opened in LayOut. More...
 
LO_RESULT LODocumentSetInitialPage (LODocumentRef document, LOPageRef page)
 Sets the page that will be shown the next time the document is opened in LayOut. More...
 
LO_RESULT LODocumentAddPage (LODocumentRef document, LOPageRef *page)
 Adds a new page to a document. The user is not responsible for releasing the returned page object. More...
 
LO_RESULT LODocumentRemovePage (LODocumentRef document, LOPageRef *page)
 Removes a page from a document. *page will be set to invalid by this function. More...
 
LO_RESULT LODocumentReorderPage (LODocumentRef document, LOPageRef page, size_t new_index)
 Moves a page to a different index within a document's list of pages. This will move the page such that its new index becomes new_index. More...
 
LO_RESULT LODocumentAddEntity (LODocumentRef document, LOEntityRef entity, LOLayerRef layer_definition, LOPageRef page)
 Adds an entity to a document and place it on the given layer and page. If the given layer is a shared layer then page may be an invalid object. The entity must not already belong to a document. If entity is a group, then the group along with all of its children will be added to the document. More...
 
LO_RESULT LODocumentAddEntityUsingIndexes (LODocumentRef document, LOEntityRef entity, size_t layer_index, size_t page_index)
 Adds an entity to a document and places it on the layer at layer_index and page at page_index. If the specified layer is a shared layer then page_index will be ignored. The entity must not already belong to a document. If entity is a group, then the group along with all of its children will be added to the document. More...
 
LO_RESULT LODocumentRemoveEntity (LODocumentRef document, LOEntityRef *entity)
 Removes an entity from a document. If entity is a group, then the group and all of its children will be removed from the document. More...
 
LO_RESULT LODocumentGetNumberOfSharedEntities (LODocumentRef document, size_t *num_shared_entities)
 Gets the number of entities on shared layers at the top of a document's group hierarchy. This count will include LOGroupRef entities so the group hierarchy can be traversed. More...
 
LO_RESULT LODocumentGetSharedEntityAtIndex (LODocumentRef document, size_t index, LOEntityRef *entity)
 Gets the shared entity at the top of a document's group hierarchy at the specified index. More...
 
LO_RESULT LODocumentGetSharedEntities (LODocumentRef document, LOEntityListRef entity_list)
 Populates a LOEntityListRef with the entities on shared layers at the top of a document's group hierarchy. This will include LOGroupRef entities so the group hierarchy can be traversed. More...
 
LO_RESULT LODocumentGetObjectSnap (LODocumentRef document, bool *object_snap)
 Gets whether or not object snap is enabled in a document. More...
 
LO_RESULT LODocumentSetObjectSnap (LODocumentRef document, bool object_snap)
 Sets whether or not object snap is enabled in a document. More...
 
LO_RESULT LODocumentGetGridSnap (LODocumentRef document, bool *grid_snap)
 Gets whether or not grid snap is enabled in a document. More...
 
LO_RESULT LODocumentSetGridSnap (LODocumentRef document, bool grid_snap)
 Sets whether or not grid snap is enabled in a document. More...
 
LO_RESULT LODocumentGetTimeCreated (LODocumentRef document, time_t *time_created)
 Returns the time at which a document was created. More...
 
LO_RESULT LODocumentGetTimeModified (LODocumentRef document, time_t *time_modified)
 Returns the last time that the document was edited. More...
 
LO_RESULT LODocumentGetTimePublished (LODocumentRef document, time_t *time_published)
 Returns the last time that the document was printed or exported. More...
 
LO_RESULT LODocumentGetUnits (LODocumentRef document, LODocumentUnits *units, double *precision)
 Gets the units and precision for a document. More...
 
LO_RESULT LODocumentSetUnits (LODocumentRef document, LODocumentUnits units, double precision)
 Sets the units and precision for a document. More...
 
LO_RESULT LODocumentGetNumberOfAutoTextDefinitions (LODocumentRef document, size_t *size)
 Gets the number of auto text definitions in a document. More...
 
LO_RESULT LODocumentGetAutoTextDefinitionAtIndex (LODocumentRef document, size_t index, LOAutoTextDefinitionRef *autotext)
 Gets the auto text at the specified index. More...
 
LO_RESULT LODocumentGetAutoTextDefinitionByName (LODocumentRef document, const char *name, LOAutoTextDefinitionRef *autotext)
 Gets the auto text with the specified name. More...
 
LO_RESULT LODocumentGetAutoTextDefinitions (LODocumentRef document, LOAutoTextDefinitionListRef autotexts)
 Populates a LOAutoTextDefinitionListRef object with all the auto text in a document. More...
 
LO_RESULT LODocumentAddAutoTextDefinition (LODocumentRef document, int type, const char *name, LOAutoTextDefinitionRef *autotext)
 Adds an auto text definition to a document. More...
 
LO_RESULT LODocumentRemoveAutoTextDefinition (LODocumentRef document, LOAutoTextDefinitionRef *autotext, bool convert_tags_to_normal_text)
 Removes an auto text definition from a document. More...
 
LO_RESULT LODocumentGetLengthFormatter (LODocumentRef document, SULengthFormatterRef *formatter)
 Gets the length formatter settings from the document. The given length formatter object must have been constructed using SULengthFormatterCreate. It must be released using SULengthFormatterRelease. More...
 

Enumeration Type Documentation

Defines the different units formats that are available.

Enumerator
LODocumentUnits_FractionalInches 

6-1/2"

LODocumentUnits_DecimalInches 

6.5"

LODocumentUnits_DecimalFeet 

0.54167'

LODocumentUnits_DecimalMillimeters 

165.1 mm

LODocumentUnits_DecimalCentimeters 

16.51 cm

LODocumentUnits_DecimalMeters 

1.651 m

LODocumentUnits_DecimalPoints 

468 pt

LONumDocumentUnits 

Defines the different versions of the .layout file format that are supported.

Enumerator
LODocumentVersion_1 

LayOut 1.0.

LODocumentVersion_2 

LayOut 2.0.

LODocumentVersion_3 

LayOut 3.0.

LODocumentVersion_2013 

LayOut 2013.

LODocumentVersion_2014 

LayOut 2014.

LODocumentVersion_2015 

LayOut 2015.

LODocumentVersion_2016 

LayOut 2016.

LODocumentVersion_2017 

LayOut 2017.

LODocumentVersion_2018 

LayOut 2018.

LODocumentVersion_2019 

LayOut 2019.

LODocumentVersion_Current 

The most current version supported.

LONumDocumentVersions 

Function Documentation

LO_RESULT LODocumentAddAutoTextDefinition ( LODocumentRef  document,
int  type,
const char *  name,
LOAutoTextDefinitionRef autotext 
)

Adds an auto text definition to a document.

Since
LayOut 2017, API 2.0
Parameters
[in]documentThe document object.
[in]typeThe desired type of the new auto text.
[in]nameThe desired name of the new auto text.
[out]autotextThe autotext definition object.
Returns
LO_RESULT LODocumentAddEntity ( LODocumentRef  document,
LOEntityRef  entity,
LOLayerRef  layer_definition,
LOPageRef  page 
)

Adds an entity to a document and place it on the given layer and page. If the given layer is a shared layer then page may be an invalid object. The entity must not already belong to a document. If entity is a group, then the group along with all of its children will be added to the document.

Parameters
[in]documentThe document object.
[in]entityThe entity object.
[in]layer_definitionThe layer definition object.
[in]pageThe page object.
Returns
LO_RESULT LODocumentAddEntityUsingIndexes ( LODocumentRef  document,
LOEntityRef  entity,
size_t  layer_index,
size_t  page_index 
)

Adds an entity to a document and places it on the layer at layer_index and page at page_index. If the specified layer is a shared layer then page_index will be ignored. The entity must not already belong to a document. If entity is a group, then the group along with all of its children will be added to the document.

Parameters
[in]documentThe document object.
[in]entityThe entity object.
[in]layer_indexThe layer definition index.
[in]page_indexThe page index.
Returns
LO_RESULT LODocumentAddLayer ( LODocumentRef  document,
bool  shared,
LOLayerRef layer_definition 
)

Adds a new layer to the document. The user is not responsible for releasing the returned layer definition object.

Parameters
[in]documentThe document object.
[in]sharedWhether or not the new layer should be a shared layer.
[out]layer_definitionThe new layer definition object.
Returns
LO_RESULT LODocumentAddPage ( LODocumentRef  document,
LOPageRef page 
)

Adds a new page to a document. The user is not responsible for releasing the returned page object.

Parameters
[in]documentThe document object.
[out]pageThe page object.
Returns
LO_RESULT LODocumentAddReference ( LODocumentRef  document)

Adds a reference to an document object.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
Returns
LO_RESULT LODocumentCreateEmpty ( LODocumentRef document)

Creates a new empty document object. It will contain one page and one layer.

Parameters
[out]documentThe newly created document.
Returns
LO_RESULT LODocumentCreateFromFile ( LODocumentRef document,
const char *  path 
)

Creates a new document object by loading an existing .layout file.

Parameters
[out]documentThe document created from the .layout file.
[in]pathThe path to the .layout file on disk.
Returns
LO_RESULT LODocumentCreateFromTemplate ( LODocumentRef document,
const char *  path 
)

Creates a new document object using an existing .layout file as a template. This differs from LODocumentCreateFromFile in that the new document won't have a path until it is saved for the first time.

Parameters
[out]documentThe document created using the .layout file as a template.
[in]pathThe path to the layout template file on disk.
Returns
LO_RESULT LODocumentExportToImageSet ( LODocumentRef  document,
const char *  export_path,
const char *  base_name,
LOImageRepOutputFormat  format,
LODictionaryRef  options_dict 
)

Exports the document as a series of image files at the indicated path. For multi-page documents, each page will append its page number to base_name to use as the file name. If a valid options dictionary object is provided, then it can specify additional image export options. The following options (declared in documentexportoptions.h) may be specified in the options dictionary to override their default values:

  • key: LOExportOption_StartPage, value: Int32
    Start page index. Defaults to 0.
  • key: LOExportOption_EndPage, value: Int32
    End page index. Defaults to the index of the last page in the document.
  • key: LOExportOption_DPI, value: Int32
    Image DPI. This will determine the pixel dimensions of the output images, in conjunction with the document's page width and height. Defaults to 96.
Parameters
[in]documentThe document object.
[in]export_pathThe directory path to where the images should be exported.
[in]base_nameThe base name for the image files.
[in]formatWhat file format the images should be exported to.
[in]options_dictThe options dictionary. If the dictionary object is invalid then default options will be used.
Returns
LO_RESULT LODocumentExportToPDF ( LODocumentRef  document,
const char *  path,
LODictionaryRef  options_dict 
)

Exports the document to a .pdf file at the indicated path. If a valid options dictionary object is provided, then it can specify additional PDF export options. The following options (declared in documentexportoptions.h) may be specified in the options dictionary to override their default values:

Parameters
[in]documentThe document object.
[in]pathThe file path where the pdf should be exported.
[in]options_dictThe options dictionary. If the dictionary object is invalid then default options will be used.
Returns
LO_RESULT LODocumentGetActiveLayer ( LODocumentRef  document,
LOLayerRef layer_definition 
)

Gets a reference to the document's active layer definition.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[out]layer_definitionThe active layer definition in the document.
Returns
LO_RESULT LODocumentGetAutoTextDefinitionAtIndex ( LODocumentRef  document,
size_t  index,
LOAutoTextDefinitionRef autotext 
)

Gets the auto text at the specified index.

Since
LayOut 2017, API 2.0
Parameters
[in]documentThe document object.
[in]indexThe index of the auto text object.
[out]autotextThe auto text object.
Returns
LO_RESULT LODocumentGetAutoTextDefinitionByName ( LODocumentRef  document,
const char *  name,
LOAutoTextDefinitionRef autotext 
)

Gets the auto text with the specified name.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[in]nameThe name of the auto text object to get.
[out]autotextThe auto text object.
Returns
LO_RESULT LODocumentGetAutoTextDefinitions ( LODocumentRef  document,
LOAutoTextDefinitionListRef  autotexts 
)

Populates a LOAutoTextDefinitionListRef object with all the auto text in a document.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[out]autotextsThe list to populate with the auto texts in the document.
Returns
LO_RESULT LODocumentGetFilePath ( LODocumentRef  document,
SUStringRef path 
)

Gets the full path to a document's .layout file.

Parameters
[in]documentThe document object.
[out]pathThe path to the document's .layout file.
Returns
LO_RESULT LODocumentGetGrid ( LODocumentRef  document,
LOGridRef grid 
)

Gets the grid object for a document.

Parameters
[in]documentThe document object.
[out]gridThe grid object for the document.
Returns
LO_RESULT LODocumentGetGridSnap ( LODocumentRef  document,
bool *  grid_snap 
)

Gets whether or not grid snap is enabled in a document.

Parameters
[in]documentThe document object.
[out]grid_snapWhether grid snap is enabled or not.
Returns
LO_RESULT LODocumentGetInitialPage ( LODocumentRef  document,
LOPageRef page 
)

Gets a reference to the page that will be shown the next time the document is opened in LayOut.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[out]pageThe active page in the document.
Returns
LO_RESULT LODocumentGetLayerAtIndex ( LODocumentRef  document,
size_t  index,
LOLayerRef layer_definition 
)

Gets a reference to the layer definition at the given index for a document.

Parameters
[in]documentThe document object.
[in]indexThe index of the layer to get.
[out]layer_definitionThe layer definition at the given index.
Returns
LO_RESULT LODocumentGetLayers ( LODocumentRef  document,
LOLayerListRef  layer_definitions 
)

Populates a LOLayerListRef with all of the layer definitions in a document.

Parameters
[in]documentThe document object.
[out]layer_definitionsThe list to populate with the layer definitions in the document.
Returns
LO_RESULT LODocumentGetLengthFormatter ( LODocumentRef  document,
SULengthFormatterRef formatter 
)

Gets the length formatter settings from the document. The given length formatter object must have been constructed using SULengthFormatterCreate. It must be released using SULengthFormatterRelease.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[out]formatterThe formatter to apply the document's settings to.
Returns
LO_RESULT LODocumentGetNumberOfAutoTextDefinitions ( LODocumentRef  document,
size_t *  size 
)

Gets the number of auto text definitions in a document.

Since
LayOut 2017, API 2.0
Parameters
[in]documentThe document object.
[out]sizeThe amount of auto text definitions in the document.
Returns
LO_RESULT LODocumentGetNumberOfLayers ( LODocumentRef  document,
size_t *  num_layers 
)

Gets the number of layers in a document.

Parameters
[in]documentThe document object.
[out]num_layersThe number of layers in the document.
Returns
LO_RESULT LODocumentGetNumberOfPages ( LODocumentRef  document,
size_t *  num_pages 
)

Gets the total number of pages in a document.

Parameters
[in]documentThe document object.
[out]num_pagesThe number of pages.
Returns
LO_RESULT LODocumentGetNumberOfSharedEntities ( LODocumentRef  document,
size_t *  num_shared_entities 
)

Gets the number of entities on shared layers at the top of a document's group hierarchy. This count will include LOGroupRef entities so the group hierarchy can be traversed.

Parameters
[in]documentThe document object.
[out]num_shared_entitiesThe number of shared entities.
Returns
LO_RESULT LODocumentGetObjectSnap ( LODocumentRef  document,
bool *  object_snap 
)

Gets whether or not object snap is enabled in a document.

Parameters
[in]documentThe document object.
[out]object_snapWhether object snap is enabled or not.
Returns
LO_RESULT LODocumentGetPageAtIndex ( LODocumentRef  document,
size_t  index,
LOPageRef page 
)

Gets the page at a given index in a document.

Parameters
[in]documentThe document object.
[in]indexThe index of the page to get.
[out]pageThe page object.
Returns
LO_RESULT LODocumentGetPageInfo ( LODocumentRef  document,
LOPageInfoRef page_info 
)

Gets the page info object for a document.

Parameters
[in]documentThe document object.
[out]page_infoThe page info object for the document.
Returns
LO_RESULT LODocumentGetPages ( LODocumentRef  document,
LOPageListRef  pages 
)

Populates a LOPageListRef object with all the pages in a document.

Parameters
[in]documentThe document object.
[out]pagesThe list to populate with the pages in the document.
Returns
LO_RESULT LODocumentGetSharedEntities ( LODocumentRef  document,
LOEntityListRef  entity_list 
)

Populates a LOEntityListRef with the entities on shared layers at the top of a document's group hierarchy. This will include LOGroupRef entities so the group hierarchy can be traversed.

Parameters
[in]documentThe document object.
[in]entity_listThe entity list to populate.
Returns
LO_RESULT LODocumentGetSharedEntityAtIndex ( LODocumentRef  document,
size_t  index,
LOEntityRef entity 
)

Gets the shared entity at the top of a document's group hierarchy at the specified index.

Parameters
[in]documentThe document object.
[in]indexThe 0-based entity index for the desired shared entity.
[out]entityThe entity object.
Returns
LO_RESULT LODocumentGetTimeCreated ( LODocumentRef  document,
time_t *  time_created 
)

Returns the time at which a document was created.

Parameters
[in]documentThe document object.
[out]time_createdThe time when the document was created.
Returns
LO_RESULT LODocumentGetTimeModified ( LODocumentRef  document,
time_t *  time_modified 
)

Returns the last time that the document was edited.

Parameters
[in]documentThe document object.
[out]time_modifiedThe last time the document was edited.
Returns
LO_RESULT LODocumentGetTimePublished ( LODocumentRef  document,
time_t *  time_published 
)

Returns the last time that the document was printed or exported.

Parameters
[in]documentThe document object.
[out]time_publishedThe last time the document was printed or exported.
Returns
LO_RESULT LODocumentGetUnits ( LODocumentRef  document,
LODocumentUnits units,
double *  precision 
)

Gets the units and precision for a document.

Parameters
[in]documentThe document object.
[out]unitsThe units setting for the document.
[out]precisionThe units precision. This is expressed as a value in the current units.
Returns
LO_RESULT LODocumentRelease ( LODocumentRef document)

Releases a document object. The object will be invalidated if releasing the last reference. Note: it is important to call LODocumentRelease before calling LOTerminate, otherwise LODocumentRelease may fail unpredictably.

Parameters
[in]documentThe document object.
Returns
LO_RESULT LODocumentRemoveAutoTextDefinition ( LODocumentRef  document,
LOAutoTextDefinitionRef autotext,
bool  convert_tags_to_normal_text 
)

Removes an auto text definition from a document.

Since
LayOut 2017, API 2.0
Parameters
[in]documentThe document object.
[in]autotextThe auto text definition object.
[in]convert_tags_to_normal_textTrue if the auto text being deleted should retain its tags in normal text.
Returns
LO_RESULT LODocumentRemoveEntity ( LODocumentRef  document,
LOEntityRef entity 
)

Removes an entity from a document. If entity is a group, then the group and all of its children will be removed from the document.

Parameters
[in]documentThe document object.
[in]entityThe entity object.
Returns
LO_RESULT LODocumentRemoveLayer ( LODocumentRef  document,
LOLayerRef layer_definition,
bool  delete_entities 
)

Removes a layer from a document. There must be at least one other unlocked and visible layer on every page. If this is not the case, then the next layer will be automatically unlocked and made visible on all pages as necessary to proceed with the operation. *layer_definition will be set to invalid by this function.

Parameters
[in]documentThe document object.
[in]layer_definitionThe layer definition object.
[in]delete_entitiesWhether or not to delete the entities on the layer that is being removed. If the entities are not deleted, they will be moved to the next valid layer. This may cause groups to be split if the next valid layer does not have the same sharedness as the layer being removed.
Returns
LO_RESULT LODocumentRemovePage ( LODocumentRef  document,
LOPageRef page 
)

Removes a page from a document. *page will be set to invalid by this function.

Parameters
[in]documentThe document object.
[in]pageThe page object.
Returns
LO_RESULT LODocumentReorderLayer ( LODocumentRef  document,
LOLayerRef  layer_definition,
size_t  new_index 
)

Moves a layer to a different index within a document's list of layers. This will move the layer such that its new index becomes new_index.

Parameters
[in]documentThe document object.
[in]layer_definitionThe layer definition object.
[in]new_indexThe index to move the layer to.
Returns
LO_RESULT LODocumentReorderPage ( LODocumentRef  document,
LOPageRef  page,
size_t  new_index 
)

Moves a page to a different index within a document's list of pages. This will move the page such that its new index becomes new_index.

Parameters
[in]documentThe document object.
[in]pageThe page object.
[in]new_indexThe index the page should be moved to.
Returns
LO_RESULT LODocumentSaveToFile ( LODocumentRef  document,
const char *  path,
LODocumentVersion  version 
)

Saves a document to a file at the given path. Passing an empty path string will save the document at its current path.

Parameters
[in]documentThe document object.
[in]pathThe file path where the document should be saved.
[in]versionThe file version to save the file as.
Returns
LO_RESULT LODocumentSetActiveLayer ( LODocumentRef  document,
LOLayerRef  layer_definition 
)

Sets the document's active layer definition.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[in]layer_definitionThe layer definition to set as active.
Returns
LO_RESULT LODocumentSetGridSnap ( LODocumentRef  document,
bool  grid_snap 
)

Sets whether or not grid snap is enabled in a document.

Parameters
[in]documentThe document object.
[in]grid_snapWhether to enable or disable grid snap.
Returns
LO_RESULT LODocumentSetInitialPage ( LODocumentRef  document,
LOPageRef  page 
)

Sets the page that will be shown the next time the document is opened in LayOut.

Since
LayOut 2018, API 3.0
Parameters
[in]documentThe document object.
[in]pageThe page to set as active.
Returns
LO_RESULT LODocumentSetObjectSnap ( LODocumentRef  document,
bool  object_snap 
)

Sets whether or not object snap is enabled in a document.

Parameters
[in]documentThe document object.
[in]object_snapWhether to enable or disable object snap.
Returns
LO_RESULT LODocumentSetUnits ( LODocumentRef  document,
LODocumentUnits  units,
double  precision 
)

Sets the units and precision for a document.

Parameters
[in]documentThe document object.
[in]unitsThe units setting for the document.
[in]precisionThe units precision. This is expressed as a value in the specified units. LayOut only allows for a finite set of precision values for each units setting, so it will set the precision to the closest valid setting for the specified units. See the "Units" section of LayOut's "Document Setup" dialog for a reference of the available precisions for each units setting.
Returns