ODA Product: | ODA PRC SDK |
Sample Name: | OdDgn2PdfExportWithPrc |
Categories: | C++ / Beginner / Working with .dgn files, Working with .prc files / Android, iOS, macOS, Linux, Windows |
Source Code Location: | CommonApplications/Prc/Examples/OdPdfExportWithPrc |
Sample console application that illustrates .dgn to .pdf export functionality with enabled PRC format support.
The example creates a simple .dgn file and exports its content to a specified .pdf file as a PRC mesh.
To run the OdDgn2PdfExportWithPrc
sample application, please do the following:
<PRC_DIR>\exe\<version>
<PRC_DIR>/bin/<version>
<PRC_DIR>
is a directory where you unpacked the PRC SDK archive.
To determine your <version>
parameter, please see the
appropriate section
in the Download ODA PRC SDK topic.
OdDgn2PdfExportWithPrc <export case> <target file>
export case
|
Name of an export case to execute.
The export case determines the export parameters and options.
Currently only one export case is available:
|
target file
|
Full path to the output .pdf file that will contain all exported content. |
If the application executed properly, you will see the following console window:
If an error occurs during the application execution, you will see an appropriate error message in the console window. For example, the following picture illustrates the program output in the case when it was called with wrong arguments:
The sample application creates a new PDF file with specified name that can be open with any available PDF viewer with support of PRC format.
The entry point (the main() function) is located in the OdDgn2PdfExportWithPrc.cpp file. This file also contains a declaration of the MyServicesForTestDGN class, which implements a combination of the platform-dependent functionality (platform-dependent operations and progress metering) for .dgn and .prc files.
The main() function checks input arguments, creates a custom services instance (a MyServiceForTestDGN object) and then calls the OdDgn2PdfExportWithPrcStart() function.
Below is the functions call schema:
main()
|
|->OdDgn2PdfExportWithPrcStart()
|
|-->OdDgn2PdfSimpleExample(OdDgHostAppServices&, OdString)
|
|-->OdDgn2PdfSimpleExample(OdDgHostAppServices, OdString, PDFExportParams, bool, void (*fillerfunc)(OdDgDatabasePtr&))
|
|-->fillDatabase()
| |
| |-->addSphere()
| |
| |-->addBox()
| |
| |-->addCylinder()
| |
| |-->addSmartSolid()
|
|-->fillLayoutList()
export
case
input argument.
This function runs the OdDgn2PdfSimpleExample(OdDgHostAppServices&, OdString) function.
This function does the following:
Gets the active DGN model and creates several entities for it.
Input parameter:
This function does the following:
Extracts layouts from the specified DGN database and fills the specified string array with their names.
Input parameters:
Adds a solid sphere to the DGN database.
Input parameters:
Adds a solid sphere to the DGN database.
Input parameters:
Adds a solid cylinder to the DGN database.
Input parameters:
Adds a smart solid object to the DGN database.
Input parameters:
Export a Drawing to a .prc File
ODA PRC SDK Sample Applications
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|