CreatePDFRendition(Vault, DrawingObjVer, DrawingName, LayoutName, TargetObjVer, PDFName, UpdateSingleFileDocumentTitle, LogIdentifier)
Description
Creates a PDF rendition of the named DWG file contained within the specified object. The generated PDF rendition is of the specified Layout.
A log file is generated if a LogIdentifier is provided, no log file is created if the LogIdentifier is Nothing. Please see Log Files for more information.
If no DWG file with the specified Drawing Name exists, then an error is raised.
Syntax
Sub CreatePDFRendition(Vault As Vault, DrawingObject As ObjVer, DrawingName As String, LayoutName As String, TargetObject As ObjVer, PDFName As String, UpdateSingleFileDocumentTitle As Boolean, LogIdentifier As Object)
Parameters
|
Name |
Data Type |
Description |
|
Vault |
The Vault object provided by the event handler. |
|
|
DrawingObjVer |
ObjVer of object containing a DWG file to process. This could be provided by the event handler or created dynamically using CreateObject("MFilesAPI.ObjVer"). |
|
|
DrawingName |
String |
The name of the DWG file to process (excluding the file extension). Use with Multi File Document (MFD) objects containing more than one DWG file. |
|
LayoutName |
String |
Name of the Layout to render to PDF e.g. Model, Layout1 Or one of the keywords below: <ActiveLayout> - Renders to PDF the active Layout/Model when the drawing was last saved. <FirstLayout> - Renders to PDF the first Layout tab (excluding Model). |
|
TargetObjVer |
ObjVer of the target object to receive the rendered PDF file. This could be provided by the event handler or created dynamically using CreateObject("MFilesAPI.ObjVer"). The target ObjVer can be the same as the DrawingObjVer or a separate object. If the target object is a Single File Document (SFD) then the rendered PDF will replace the original content. Otherwise the rendered PDF will be added to the Multi File Document (MFD) object. |
|
|
PDFName |
String |
Name of the generated PDF as shown in Multi File Document (MFD) objects. Or the object title when UpdateSingleFileDocumentTitle is set to True for Single File Document (SFD) objects. |
|
UpdateSingleFileDocumentTitle |
Boolean |
If this parameter is True, the Single File Document (SFD) object name should be renamed to match the specified PDFName. |
|
LogIdentifier |
String or TypedValue |
Used to determine the filename of the log file. To create a log file for the current activity pass in the provided ActivityID. If this parameter is Nothing, then no log file is generated. |
Return
No return value.
Example
'create ExcitechDOCS DWG Processor object
Set dwgProcessor = GetExtensionObject("ExcitechDOCS.DWGProcessor")
'create PDF Rendition
dwgProcessor.CreatePDFRendition Vault, ObjVer, "A Drawing Name", "<ActiveLayout>", ObjVer, "A PDF Name", False, ActivityID
The resulting log file would contain the following information:
01/01/2019 09:00:00:3701 - Create PDF Rendition
01/01/2019 09:00:00:3761 - DWG File Count: 1
01/01/2019 09:00:00:3771 - Creating ODA COM Object. (dllhost.exe)
01/01/2019 09:00:00:4371 - Call CreatePDFRendition COM method.
01/01/2019 09:00:01:1101 - Processing Object: ID 1 Version 14
01/01/2019 09:00:01:1256 - DrawingName: A Drawing Name
01/01/2019 09:00:01:1411 - FileVer: ID 1 Version 5
01/01/2019 09:00:01:1421 - Download DWG to temp file: C:\ProgramData\Excitech Docs\DWG Processor\Temp\31dheqpl.dwg
01/01/2019 09:00:01:1871 - Open DWG file
01/01/2019 09:00:01:5512 - Repath References
01/01/2019 09:00:01:8082 - Plot Settings
----------------------------------------------------------------------------------------------------------------------------------
Plot Layout: A1
Plot Type: Layout
Plot Centered: False
Paper Rotation: _90degrees
Paper Origin: 0.00, 0.00
Paper Size: 594.06, 841.04
Paper Units: Millimeters
Paper Margins: (Top): 3.17 (Left): 3.17 (Right): 3.17 (Bottom): 3.17
----------------------------------------------------------------------------------------------------------------------------------
01/01/2019 09:00:01:8152 - Exporting PDF
01/01/2019 09:00:02:0032 - Delete temp files from server
01/01/2019 09:00:02:0182 - Replacing SFD file with PDF file
01/01/2019 09:00:02:0532 - Delete temp PDF file from server
01/01/2019 09:00:02:0578 - Releasing COM object.