Here's the code that should work best for you, this code looks for .idw files with the same name as the .ipt or .iam file in the same folder, if the matching .idw doesn't exist, it just skips and moves on.
There's a few things to note here, this method uses the PDF Save Copy As method that comes with Inventor which comes with the unfortunate side effect of each drawing layer being a separate layer on the PDF side as well allowing the reader to select with layers to turn off, which many companies don't like due to copyright issues. The only solution I know of to get around this is by having Windows 10 which has a built-in Microsoft PDF to Print, then the code would be changed to use a Drawing Print code method.
I left the oFolder text string entry open since you may want the PDF to be saved in a different location than me, let me know if you need any help generating this string, or if the string changes depending on the drawing it's printing.
SyntaxEditor Code Snippet
'Set Folder options as you see fit here
oFolder = 'Enter Folder String here.
'PDF Options
PDFAddIn = oAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oPDFContext = oTG.CreateTranslationContext
oPDFContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oPDFOptions = oTG.CreateNameValueMap
oPDFDataMedium = oTG.CreateDataMedium
oPDFOptions.Value("All_Color_AS_Black") = 0
oPDFOptions.Value("Remove_Line_Weights") = 1
oPDFOptions.Value("Vector_Resolution") = 4800
oPDFOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'Generate List of all Documents Referenced for this Assembly.
oRefDocs = ThisApplication.ActiveDocument.AllReferencedDocuments
'Generate Document Reference.
Dim oDoc As Document
'Peruse each document in generated Documents list.
For Each oDoc In oRefDocs
'Generate text string of .idw file to look for in the same folder as component file.
idwPathName = Left(oDoc.FullDocumentName, Len(oDoc.FullDocumentName) - 3) & "idw"
'Check if generated drawing file name exists.
If System.IO.File.Exists(idwPathName) Then
'Open drawing file.
oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)
'Remove idw extension for PDF save.
oFileName = Left(oDoc.DisplayName, Len(oDoc.DisplayName) - 3)
'Generate text string of idw name and folder location.
oPDFDataMedium.FileName = oFolder + "\" + oFileName + "pdf"
'Save PDF Copy.
Call PDFAddIn.SaveCopyAs(oDrawDoc, oPDFContext, oPDFOptions, oPDFDataMedium)
'Close drawing file.
oDrawDoc.Close(True)
End If
Next
'Top Level Document reference.
oDoc = ThisApplication.ActiveDocument
'Generate text string of .idw file to look for in the same folder as Assembly file.
idwPathName = Left(oDoc.FullDocumentName, Len(oDoc.FullDocumentName) - 3) & "idw"
'Check if generated drawing file name exists.
If System.IO.File.Exists(idwPathName) Then
'Open drawing file.
oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)
'Remove idw extension for PDF save.
oFileName = Left(oDoc.DisplayName, Len(oDoc.DisplayName) - 3)
''Generate text string of idw name and folder location.
oPDFDataMedium.FileName = oFolder + "\" + oFileName + "pdf"
'Save PDF Copy.
Call PDFAddIn.SaveCopyAs(oDrawDoc, oPDFContext, oPDFOptions, oPDFDataMedium)
'Close drawing file.
oDrawDoc.Close(True)
End If