Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I Save to PDF

8 REPLIES 8
Reply
Message 1 of 9
Neufeld
264 Views, 8 Replies

How can I Save to PDF

Hello,
Is there a macro that saves or prints a drawing to a PDF with the same name in the same folder?

Thank you,
Juan
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Neufeld

Check it out @ cbliss.com


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hello,

Is there a macro that saves or prints a drawing to a PDF with the same
name in the same folder?

Thank you,
Juan

Message 3 of 9
Anonymous
in reply to: Neufeld

I think Kent Kellers site has something that will
allow you to save as a pdf and your normal CAD file at the same time. I can't
remember the name right now. (its KWIK-something though)

 

Gary Marzetti


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Check it out @ cbliss.com


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hello,

Is there a macro that saves or prints a drawing to a PDF with the same
name in the same folder?

Thank you,
Juan

Message 4 of 9
Anonymous
in reply to: Neufeld

Do a search for One click PDF and hard copy as the
subject, it was started on 12-2 and the program name is KwikPrints

 

Gary Marzetti
Message 5 of 9
Anonymous
in reply to: Neufeld

Opp... sorry. You're right, Gary.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Do a search for One click PDF and hard copy as
the subject, it was started on 12-2 and the program name is
KwikPrints

 

Gary
Marzetti
Message 6 of 9
Anonymous
in reply to: Neufeld

KWiKPrints only prints the file, it doesn't save it, and it doesn't have any built in PDF
tools. If you have a PDF writer you can set up KWiKPrints to use it.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Gary_M" wrote in message
news:6E512BB917AA8134A00B46962A17609D@in.WebX.maYIadrTaRb...
> I think Kent Kellers site has something that will allow you to save as a pdf and your
normal CAD file at the same time. I can't remember the name right now. (its KWIK-something
though)
>
> Gary Marzetti
> "Calimesa" wrote in message
news:9BEA60DAE9A0C3915D014526D8797C86@in.WebX.maYIadrTaRb...
> Check it out @ cbliss.com
> "Neufeld" wrote in message
news:f1a56cb.-1@WebX.maYIadrTaRb...
> Hello,
> Is there a macro that saves or prints a drawing to a PDF with the same name in the
same folder?
> Thank you,
> Juan
>
Message 7 of 9
Anonymous
in reply to: Neufeld

Here is my setup

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Opp... sorry. You're right, Gary.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Do a search for One click PDF and hard copy as
the subject, it was started on 12-2 and the program name is
KwikPrints

 

Gary
Marzetti
Message 8 of 9
Anonymous
in reply to: Neufeld

I wasn't sure - I knew you could set it up to do that. I already had the PDF
Driver so I guess that's why I didn't have a problem.

Gary Marzetti
Message 9 of 9
Anonymous
in reply to: Neufeld

This is a code I've modified to print a dwf to a
specific folder.  You can easily modify it to a pdf driver.

 


I have two sets of code for creating a DWF to a
folder.  This one is the current one I use, and it runs off of the
DWFwriter that you can download from the Autodesk webpage.  This was built
using some code I was using to do a SaveAs to create the DWF, so there's some
extra code. 

 

Once the DWFwriter is installed open the
DWFwriter 2 Beta driver and under "Advanced
Properties" -> "DWF
Filename" to select "Don't prompt - use source
filename".  Make this choice
and the "Save As" dialog will not appear
any longer.

When DWFwriter 2 Beta is installed, a string value in the
registry is
created with an empty
value:

HKCU\Software\Autodesk\DWFwriter\2\Publish Directory

Change
this value to your desired target directory (with or without a
trailing \)
and your DWF files will land here.

 

I have also added code that will write text stating
it's a reference document, print the DWF, and then delete the text.  We do
this for our standards. 

 

Here's the code, take it and copy it into your IDW
template.  Everytime you do a save it will create the DWF to a specified
folder:

 

Option Explicit

 

Private obDocument As Document

 

Public WithEvents DocEvents As
DocumentEvents

 

Public Sub
AutoSave_Copy_by_Event()
    Set DocEvents =
ThisApplication.ActiveDocument.DocumentEvents
End Sub

 

Public Sub DocEvents_OnSave(ByVal BeforeOrAfter As
EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As
HandlingCodeEnum)
    SaveAsType "dwf"
End Sub

 

Private Sub SaveAsType(szFileType As
String)

 

ThisApplication.SilentOperation = True

 

Set obDocument =
ThisApplication.ActiveDocument

 

If obDocument.DocumentType <> 12292
Then
        Exit
Sub
    Else
        Dim
szFileName As String
        Dim
szExtension As String
Dim oPrintMgr As DrawingPrintManager

 


    ' Create a new sketch on the active
sheet.
    Dim oSketch As DrawingSketch
   
Set oSketch = obDocument.ActiveSheet.Sketches.Add
   

    'Name the sketch
    'oSketch.Name =
"DWF"
   
    ' Open the sketch for edit so
the text boxes can be created.
    ' This is only required for
drawing sketches, not part.
   
oSketch.Edit
   
    Dim oTG As
TransientGeometry
    Set oTG =
ThisApplication.TransientGeometry
   
    '
Create text with simple string as input.  Since this doesn't
use
    ' any text overrides, it will default to the active
text style.
    Dim sText As String
    Dim
oTextBox As TextBox
    sText = "<StyleOverride Bold='True'
FontSize='.4'>REFERENCE ONLY<Br/>NOT A RELEASED
DOCUMENT</StyleOverride>"
    Set oTextBox =
oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(1.5, 3),
sText)
          

    ' Exit the sketch from the edit
environment.
    oSketch.ExitEdit

 

 

 

 

 

 Set oPrintMgr =
ThisApplication.ActiveDocument.PrintManager
    'This is the
name of the DWF printer on my system. Probably should
   
'Determine this by other means.
   
   
'Set the paper size
    Dim oDrawDoc As
DrawingDocument
    Set oDrawDoc =
ThisApplication.ActiveDocument
   
    Dim
oSheet As Sheet
    Dim oSheetSize As
String
    Set oSheet = oDrawDoc.ActiveSheet

 

   
    ' Check to see if a filename is
defined.
    If oSheet.Size = kADrawingSheetSize
Then
        oSheetSize =
kPaperSizeLetter
         '"B
Size"
    ElseIf oSheet.Size = kBDrawingSheetSize
Then
        oSheetSize =
kPaperSize11x17
        '"C
Size"
    ElseIf oSheet.Size = kCDrawingSheetSize
Then
        oSheetSize =
kPaperSizeCustom
          '"D
Size"
    ElseIf oSheet.Size = kDDrawingSheetSize
Then
        oSheetSize =
kPaperSizeCustom
   
     
'"Custom Size"
    ElseIf oSheet.Size =
kCustomDrawingSheetSize Then
       
oSheetSize = kPaperSizeCustom
       

    End If
   
   

    oPrintMgr.Printer = "Autodesk
DWFwriter"
    oPrintMgr.NumberOfCopies =
1
    oPrintMgr.Orientation =
kLandscapeOrientation
    oPrintMgr.ScaleMode =
kPrintBestFitScale
    oPrintMgr.PrintRange =
kPrintAllSheets
    oPrintMgr.PaperSize = oSheetSize

 

'get the full file name from obDocument
     
'  szFileName =
obDocument.DisplayName
       

'Determine the extension of the file
      
' szExtension = Right(szFileName, 3)

 

'If the extension is IDW then print a DWF of the file, if not do
nothing
       ' If szExtension = "idw"
Then
           '
szFileName = Left(szFileName, Len(szFileName) - 3) &
szFileType
           
'szFileName = "I:\Autodesk Inventor\DWF\" &
szFileName
            
' Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent,
szFileName)
           
oPrintMgr.SubmitPrint
           

        'End If
    End
If
   
   
oSketch.Delete
   
   
ThisApplication.SilentOperation = False
   
End
Sub

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> 

face=Arial size=2>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report