Hi,
To publish the document to a PDF, two options:
use PrintManager.
Dim oPM as PrintManager
Set oPM = oDoc.PrintManger
oPM.Printer = "Adobe PDF"
oPM.PrinteToFile "c:\test.pdf"
using TranslatorAddin
Please firstly have a look at the topic "TranslatorAddin" in the API help document. The following code sample is for your reference. Although it is written in VBA, it would need little effort to translate to C++. Please let me know if you have any difficulty.
Sub test()
Dim addins As ApplicationAddIns
Set addins = app.ApplicationAddIns
Dim oPDFAddin As TranslatorAddIn
'Set oPDFAddin = ThisApplication.ApplicationAddIns.ItemById ("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Create a nameValueMap
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium
Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check
Debug.Print oPDFAddin.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions)
If oPDFAddin.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
'this setting has no effect
' oOptions.Value("All_Color_AS_Black") = "False" 'True
End If
'change to a path on your system
oDataMedium.FileName = "C:\ExportPDF.pdf"
' Publish document
Call oPDFAddin.SaveCopyAs(ThisDocument, oContext, oOptions, oDataMedium)
End Sub