DATAKIT API  V2025.1
PdfWriteLayout.hpp File Reference

Go to the source code of this file.

Functions

void CreatePDFLayout (const Dtk_string &inFileName, Dtk_Int32 artworkIndex, std::map< Dtk_Node::NodeDataTypeEnum, Dtk_Size_t > &inModelInventory)
 

Function Documentation

◆ CreatePDFLayout()

void CreatePDFLayout ( const Dtk_string inFileName,
Dtk_Int32  artworkIndex,
std::map< Dtk_Node::NodeDataTypeEnum, Dtk_Size_t > &  inModelInventory 
)
285 {
286 
287  //**************************************************************************************************************//
288  // Cartridge
289  //**************************************************************************************************************//
290  Dtk_pnt origin = PdfWriteCartridge(inFileName, inModelInventory);
291 
292 
293  //**************************************************************************************************************//
294  // 3D annotation creation
295  //**************************************************************************************************************//
296  if (artworkIndex > -1)
297  {//3D Annotation
298  //**************************************************************************************************************//
299  // Computing annotation Bounding Box
300  //**************************************************************************************************************//
301  Dtk_Double64 margin = 16.0, bottom, top, left, right;
302  bottom = origin[1];
303  left = margin;
304  right = Pdfw::Layout::GetCurrentPageWidth() - margin;
305  top = Pdfw::Layout::GetCurrentPageHeight() - margin;
306  Dtk_Double64 annotBBox[4] = { left, bottom, right, top };
307  //WARNING : no text must be added to current page after this 3d annotation or the result pdf file will have some errors in adobe reader....
308  Pdfw::Layout::Create3DAnnotation(artworkIndex, annotBBox);
309  }
310 }
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::GetCurrentPageWidth
Dtk_Double64 GetCurrentPageWidth()
Gets current page width.
Pdfw::Layout::GetCurrentPageHeight
Dtk_Double64 GetCurrentPageHeight()
Gets current page height.
Dtk_Double64
double Dtk_Double64
Definition: define.h:699
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
PdfWriteCartridge
Dtk_pnt PdfWriteCartridge(const Dtk_string &inFileName, std::map< Dtk_Node::NodeDataTypeEnum, Dtk_Size_t > &inModelInventory)
Definition: PdfWriteLayout.cpp:166