DATAKIT API  V2025.1
Pdfw::Layout Namespace Reference

Enumerations

enum  PageDirection { PORTRAIT = 0, LANDSCAPE }
 
enum  PageSizes {
  SIZE_LETTER = 0, SIZE_LEGAL, SIZE_A3, SIZE_A4,
  SIZE_A5, SIZE_B4, SIZE_B5, SIZE_EXECUTIVE,
  SIZE_US4x6, SIZE_US4x8, SIZE_US5x7, SIZE_COMM10,
  SIZE_EOF
}
 

Functions

DtkErrorStatus Create3DAnnotation (Dtk_UInt32 inArtworkIndex, Dtk_Double64 inBBox[4], Dtk_Int32 inModelDisplayIndex=-1, Dtk_Int32 inLayerID=-1, RenderMode inRenderMode=Unset, Lighting inLighting=UnsetLighting, Dtk_bool inAnnotActivation=0)
 Creates 3D Annotation from 3D artwork in current page with its 2d bounding box. More...
 
Dtk_ErrorStatus CreateOutline (Dtk_string inName)
 Creation of outline. More...
 
DtkErrorStatus End3DArtwork (Dtk_UInt32 &outartworkIndex)
 Ends Writing of 3D Artwork. More...
 
Dtk_ErrorStatus EndPage ()
 End of page. More...
 
Dtk_ErrorStatus FillRectangle (Dtk_Double64 inBBox[4], Dtk_RGB inColor)
 Fills a rectangle area with color. More...
 
DtkErrorStatus Get3DArtworkBBox (Dtk_pnt &outPmin, Dtk_pnt &outPmax)
 Gets oriented XYZ bounding box corners. More...
 
Dtk_Double64 GetCurrentPageHeight ()
 Gets current page height. More...
 
Dtk_Double64 GetCurrentPageWidth ()
 Gets current page width. More...
 
DtkErrorStatus Init3DArtwork (Dtk_string inAnnotName=Dtk_string(), Pdfw::WriteOptions *inWriteOptions=NULL)
 Starts Writing of 3D Artwork (3D model) More...
 
Dtk_ErrorStatus InitPage (Dtk_RGB inColor=Dtk_RGB(255, 255, 255), Dtk_Double64 inWidth=842, Dtk_Double64 inHeight=595)
 LAYOUT METHODS. More...
 
Dtk_ErrorStatus SetCurrentPageSize (Dtk_Double64 inWidth, Dtk_Double64 inHeight)
 Sets current page size. More...
 
Dtk_ErrorStatus SetCurrentPageSize (PageSizes inSize, PageDirection inDirection)
 Sets current page size. More...
 
Dtk_ErrorStatus WriteCompositeText (Dtk_CompositeText &inCompositeText)
 Write a composite text. More...
 
Dtk_ErrorStatus WritePicture (Dtk_string inPicturePath, Dtk_Double64 inPictureBBox[4])
 Write a picture. More...
 
Dtk_ErrorStatus WritePolylines (Dtk_tab< Dtk_PolylinePtr > &inTabPolylines)
 Write a set of polylines. More...
 

Enumeration Type Documentation

◆ PageDirection

Enumerator
PORTRAIT 
LANDSCAPE 
475  {
476  PORTRAIT = 0,
477  LANDSCAPE
478  } PageDirection;

◆ PageSizes

Enumerator
SIZE_LETTER 
SIZE_LEGAL 
SIZE_A3 
SIZE_A4 
SIZE_A5 
SIZE_B4 
SIZE_B5 
SIZE_EXECUTIVE 
SIZE_US4x6 
SIZE_US4x8 
SIZE_US5x7 
SIZE_COMM10 
SIZE_EOF 
457  {
458  SIZE_LETTER = 0,
459  SIZE_LEGAL,
460  SIZE_A3,
461  SIZE_A4,
462  SIZE_A5,
463  SIZE_B4,
464  SIZE_B5,
466  SIZE_US4x6,
467  SIZE_US4x8,
468  SIZE_US5x7,
469  SIZE_COMM10,
470  SIZE_EOF
471  } PageSizes;

Function Documentation

◆ Create3DAnnotation()

DtkErrorStatus Pdfw::Layout::Create3DAnnotation ( Dtk_UInt32  inArtworkIndex,
Dtk_Double64  inBBox[4],
Dtk_Int32  inModelDisplayIndex = -1,
Dtk_Int32  inLayerID = -1,
RenderMode  inRenderMode = Unset,
Lighting  inLighting = UnsetLighting,
Dtk_bool  inAnnotActivation = 0 
)

Creates 3D Annotation from 3D artwork in current page with its 2d bounding box.

Parameters
[in]inArtworkIndex : index of artwork in document
[in]inBBox : bounding box of annotation in current page in points (72 points per inch)
[in]inModelDisplayIndex : Annotation default model display index (optionnal)
[in]inLayerID : Layer ID(optionnal)
[in]inRenderMode : Render mode(optionnal)
[in]inLighting : Lighting(optionnal)
[in]inAnnotActivation : Activation option(optionnal) (see LayoutOptions structure)
Returns
dtkNoError if it is OK.
Remarks
No text object must be added after this call in the same page or pdf file will be invalid
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false
//...
Dtk_ID artworkIndex;
Dtk_Double64 annotBBox[4];
// if(err ==dtkNoError)
// err = Pdfw::Layout::SetCurrentPageSize(Pdfw::Layout::SIZE_A4, Pdfw::Layout::LANDSCAPE);
if(err ==dtkNoError)
annotBBox[0] = 0.0;annotBBox[1] = 0.0;annotBBox[2] = Pdfw::Layout::GetCurrentPageWidth();annotBBox[3] = Pdfw::Layout::GetCurrentPageHeight();
if(err ==dtkNoError)
//... Call Pdfw methods to create 3D Artwork ....
if(err ==dtkNoError)
err = Pdfw::Layout::End3DArtwork(artworkIndex);
if(err ==dtkNoError)
err = Pdfw::Layout::Create3DAnnotation(artworkIndex, annotBBox);
if(err ==dtkNoError)
//...

◆ CreateOutline()

Dtk_ErrorStatus Pdfw::Layout::CreateOutline ( Dtk_string  inName)

Creation of outline.

Parameters
[in]inName : name of outline
Returns
dtkNoError if it is OK.
Remarks
This function must be when called page is initialised

◆ End3DArtwork()

DtkErrorStatus Pdfw::Layout::End3DArtwork ( Dtk_UInt32 outartworkIndex)

Ends Writing of 3D Artwork.

Parameters
[out]outartworkIndex : index of created artwork in document
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ EndPage()

Dtk_ErrorStatus Pdfw::Layout::EndPage ( )

End of page.

Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ FillRectangle()

Dtk_ErrorStatus Pdfw::Layout::FillRectangle ( Dtk_Double64  inBBox[4],
Dtk_RGB  inColor 
)

Fills a rectangle area with color.

Parameters
[in]inBBox : the 2D bounding box of the area
[in]inColor : the color to fill with
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ Get3DArtworkBBox()

DtkErrorStatus Pdfw::Layout::Get3DArtworkBBox ( Dtk_pnt outPmin,
Dtk_pnt outPmax 
)

Gets oriented XYZ bounding box corners.

Parameters
[out]outPmin : 1st 3D corner
[out]outPmax : 2nd 3D corner
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ GetCurrentPageHeight()

Dtk_Double64 Pdfw::Layout::GetCurrentPageHeight ( )

Gets current page height.

Returns
page height in points (72 points per inch)
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ GetCurrentPageWidth()

Dtk_Double64 Pdfw::Layout::GetCurrentPageWidth ( )

Gets current page width.

Returns
page width in points (72 points per inch)
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ Init3DArtwork()

DtkErrorStatus Pdfw::Layout::Init3DArtwork ( Dtk_string  inAnnotName = Dtk_string(),
Pdfw::WriteOptions inWriteOptions = NULL 
)

Starts Writing of 3D Artwork (3D model)

Parameters
[in]inAnnotName : Name of the annotation ( This is not mandatory )
[in]inWriteOptions : Write Options of the annotation ( This is not mandatory )
Returns
dtkNoError if it is OK.
Remarks
inAnnotName must be unique and must not equal InitWrite() inOutputFile Dtk_string
This will only modify artwork options, not the layout options
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ InitPage()

Dtk_ErrorStatus Pdfw::Layout::InitPage ( Dtk_RGB  inColor = Dtk_RGB(255, 255, 255),
Dtk_Double64  inWidth = 842,
Dtk_Double64  inHeight = 595 
)

LAYOUT METHODS.

Initialization of page : starting a new page in document

Parameters
[in]inColor : page color ( This is not mandatory )
[in]inWidth : page width ( This is not mandatory )
[in]inHeight : page height ( This is not mandatory )
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ SetCurrentPageSize() [1/2]

Dtk_ErrorStatus Pdfw::Layout::SetCurrentPageSize ( Dtk_Double64  inWidth,
Dtk_Double64  inHeight 
)

Sets current page size.

Parameters
[in]inWidth : width of page in points (72 points per inch)
[in]inHeight : height of page in points
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ SetCurrentPageSize() [2/2]

Dtk_ErrorStatus Pdfw::Layout::SetCurrentPageSize ( PageSizes  inSize,
PageDirection  inDirection 
)

Sets current page size.

Parameters
[in]inSize : size of page
[in]inDirection : direction of page (landscape or portrait)
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ WriteCompositeText()

Dtk_ErrorStatus Pdfw::Layout::WriteCompositeText ( Dtk_CompositeText inCompositeText)

Write a composite text.

Parameters
[in]inCompositeText : the composite text to be written
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ WritePicture()

Dtk_ErrorStatus Pdfw::Layout::WritePicture ( Dtk_string  inPicturePath,
Dtk_Double64  inPictureBBox[4] 
)

Write a picture.

Parameters
[in]picturePath : the path of the picture to be written
[in]inPictureBBox : the 2D bounding box of the picture
Returns
dtkNoError if it is OK.
Remarks
Supported picture formats are : JPEG baseline (no JPEG progressive), PNG 8-bit-per-channel only
BMP non-1bpp, non-RLE and GIF (*comp always reports as 4-channel)
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false

◆ WritePolylines()

Dtk_ErrorStatus Pdfw::Layout::WritePolylines ( Dtk_tab< Dtk_PolylinePtr > &  inTabPolylines)

Write a set of polylines.

Parameters
[in]inTabPolylines : Array of Dtk_PolylinePtr to be written
Returns
dtkNoError if it is OK.
Remarks
This function must be called when WriteOptions.Layout.CreateAutomaticLayout is false
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:689
Pdfw::Layout::Create3DAnnotation
DtkErrorStatus Create3DAnnotation(Dtk_UInt32 inArtworkIndex, Dtk_Double64 inBBox[4], Dtk_Int32 inModelDisplayIndex=-1, Dtk_Int32 inLayerID=-1, RenderMode inRenderMode=Unset, Lighting inLighting=UnsetLighting, Dtk_bool inAnnotActivation=0)
Creates 3D Annotation from 3D artwork in current page with its 2d bounding box.
Pdfw::Layout::SIZE_US4x8
@ SIZE_US4x8
Definition: pdfw.hpp:467
Pdfw::Layout::SIZE_B5
@ SIZE_B5
Definition: pdfw.hpp:464
Pdfw::Layout::SIZE_A3
@ SIZE_A3
Definition: pdfw.hpp:460
Pdfw::Layout::EndPage
Dtk_ErrorStatus EndPage()
End of page.
Pdfw::Layout::GetCurrentPageWidth
Dtk_Double64 GetCurrentPageWidth()
Gets current page width.
Pdfw::Layout::SIZE_LETTER
@ SIZE_LETTER
Definition: pdfw.hpp:458
Pdfw::Layout::GetCurrentPageHeight
Dtk_Double64 GetCurrentPageHeight()
Gets current page height.
Pdfw::Layout::SIZE_US5x7
@ SIZE_US5x7
Definition: pdfw.hpp:468
Pdfw::Layout::PageDirection
PageDirection
Definition: pdfw.hpp:475
Dtk_Double64
double Dtk_Double64
Definition: define.h:699
Pdfw::Layout::SetCurrentPageSize
Dtk_ErrorStatus SetCurrentPageSize(PageSizes inSize, PageDirection inDirection)
Sets current page size.
Pdfw::Layout::SIZE_EXECUTIVE
@ SIZE_EXECUTIVE
Definition: pdfw.hpp:465
Pdfw::Layout::Init3DArtwork
DtkErrorStatus Init3DArtwork(Dtk_string inAnnotName=Dtk_string(), Pdfw::WriteOptions *inWriteOptions=NULL)
Starts Writing of 3D Artwork (3D model)
Pdfw::Layout::SIZE_LEGAL
@ SIZE_LEGAL
Definition: pdfw.hpp:459
Pdfw::Layout::PageSizes
PageSizes
Definition: pdfw.hpp:457
Pdfw::Layout::LANDSCAPE
@ LANDSCAPE
Definition: pdfw.hpp:477
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Pdfw::Layout::SIZE_US4x6
@ SIZE_US4x6
Definition: pdfw.hpp:466
Pdfw::Layout::SIZE_A5
@ SIZE_A5
Definition: pdfw.hpp:462
Pdfw::Layout::End3DArtwork
DtkErrorStatus End3DArtwork(Dtk_UInt32 &outartworkIndex)
Ends Writing of 3D Artwork.
Pdfw::Layout::PORTRAIT
@ PORTRAIT
Definition: pdfw.hpp:476
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:140
Pdfw::Layout::SIZE_COMM10
@ SIZE_COMM10
Definition: pdfw.hpp:469
Pdfw::Layout::SIZE_EOF
@ SIZE_EOF
Definition: pdfw.hpp:470
Pdfw::Layout::SIZE_B4
@ SIZE_B4
Definition: pdfw.hpp:463
Pdfw::Layout::SIZE_A4
@ SIZE_A4
Definition: pdfw.hpp:461
Pdfw::Layout::InitPage
Dtk_ErrorStatus InitPage(Dtk_RGB inColor=Dtk_RGB(255, 255, 255), Dtk_Double64 inWidth=842, Dtk_Double64 inHeight=595)
LAYOUT METHODS.