Message 1 of 8
idw to PDF

Not applicable
01-02-2006
09:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi friends
I had problem that Printing Idw File to pdf.
i have one code which below run successfully, but when i open this pdf file error occurs that
"File extension is not correct or file is corrupted."
can anyone help why this happened
thanks in advance.
Private Sub PrintidwAsPdf()
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Dim oDrgDoc As DrawingDocument
Set oDrgDoc = ThisApplication.ActiveDocument
Dim oDrgPrintMgr As DrawingPrintManager
Set oDrgPrintMgr = oDrgDoc.PrintManager
Dim drawingname As String
drawingname = ThisApplication.ActiveDocument.DisplayName
' Remove file extension
drgnameno = Len(drawingname)
drgname = Left(drawingname, drgnameno - 4)
oDrgPrintMgr.Printer = "cutePDF Writer"
' Get the name of the printer that will be used if not pdf
If MsgBox("Inventor will now use """ & oDrgPrintMgr.Printer & """ to create a pdf of """ & drgname & """ ", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
End If
oDrgPrintMgr.ColorMode = kPrintColorPalette
oDrgPrintMgr.NumberOfCopies = 1
oDrgPrintMgr.Orientation = kLandscapeOrientation
oDrgPrintMgr.PaperSize = kPaperSizeA4
oDrgPrintMgr.PrintRange = kPrintAllSheets
oDrgPrintMgr.ScaleMode = kPrintBestFitScale
Dim pdf_pathname As String
pdf_pathname ="C:\" & drgname & ".pdf"
' Save as filename
oDrgPrintMgr.PrintToFile pdf_pathname
End If
End Sub
I had problem that Printing Idw File to pdf.
i have one code which below run successfully, but when i open this pdf file error occurs that
"File extension is not correct or file is corrupted."
can anyone help why this happened
thanks in advance.
Private Sub PrintidwAsPdf()
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Dim oDrgDoc As DrawingDocument
Set oDrgDoc = ThisApplication.ActiveDocument
Dim oDrgPrintMgr As DrawingPrintManager
Set oDrgPrintMgr = oDrgDoc.PrintManager
Dim drawingname As String
drawingname = ThisApplication.ActiveDocument.DisplayName
' Remove file extension
drgnameno = Len(drawingname)
drgname = Left(drawingname, drgnameno - 4)
oDrgPrintMgr.Printer = "cutePDF Writer"
' Get the name of the printer that will be used if not pdf
If MsgBox("Inventor will now use """ & oDrgPrintMgr.Printer & """ to create a pdf of """ & drgname & """ ", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
End If
oDrgPrintMgr.ColorMode = kPrintColorPalette
oDrgPrintMgr.NumberOfCopies = 1
oDrgPrintMgr.Orientation = kLandscapeOrientation
oDrgPrintMgr.PaperSize = kPaperSizeA4
oDrgPrintMgr.PrintRange = kPrintAllSheets
oDrgPrintMgr.ScaleMode = kPrintBestFitScale
Dim pdf_pathname As String
pdf_pathname ="C:\" & drgname & ".pdf"
' Save as filename
oDrgPrintMgr.PrintToFile pdf_pathname
End If
End Sub