Drawings SDK Developer Guide > Working with .dwg Files > Working with Other File Formats > Importing from Other Formats > Importing PDF Files > PDF Import Usage Examples
PDF Import Usage Examples

An example of using PDF import functionality is located in the OdaMfcApp sample application. The sample source code is located in the Drawing\Examples\win\OdaMfcApp folder of the Drawings SDK installation directory. Note that the OdaMfcApp sample is available only for Windows platforms.

To import PDF file content into a drawing database:

  1. Open or create a drawing to store the imported content of a PDF file, then select File > Import Pdf.

  2. Click Browse, then select the PDF file to import. The dialog with import parameters appears.

  3. Set the import parameters, then click OK to add the PDF file content to the database.
  4. Check the import result in the drawing structure and render the target drawing database:

OdaMfcApp also contains a sample command for PDF import: pdfin. This command imports PDF file content in console mode and supports import from a PDF underlay entity contained in the drawing database to the database itself.

To run the pdfin command:

  1. Select Edit > Registered Commands > IMPORTS > pdfin:

  2. Choose to import from a separate PDF file or from an underlay entity:

If you can't find the pdfin command in the application menu, the appropriate module is not loaded. To load it, select Tools > Load Applications. You will see the list of loaded modules:

Click Load and add the TD_PdfImport.tx file to the list. The exact name of the file differs depending on the ODA software version and compiler. For example, for ODA version 2019 Update 1 and Microsoft® Visual Studio® 2017, the module file is named TD_PdfImport_19.7_15.tx.

Source code for the PDF import commands is available in the Drawing\Imports\PdfImport\Source\PdfImportCmd.h and PdfImportCmd.cpp files.

See Also

PDF Import Font Handling
PDF Import Parameters
PDF Import Process
Importing PDF Files
OdPdfImport Classes
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.